CN109729000A - A kind of instant communicating method and device - Google Patents
A kind of instant communicating method and device Download PDFInfo
- Publication number
- CN109729000A CN109729000A CN201811541568.9A CN201811541568A CN109729000A CN 109729000 A CN109729000 A CN 109729000A CN 201811541568 A CN201811541568 A CN 201811541568A CN 109729000 A CN109729000 A CN 109729000A
- Authority
- CN
- China
- Prior art keywords
- server
- package informatin
- weak net
- authentication
- simplified
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 52
- 102000006479 Heterogeneous-Nuclear Ribonucleoproteins Human genes 0.000 claims abstract description 167
- 108010019372 Heterogeneous-Nuclear Ribonucleoproteins Proteins 0.000 claims abstract description 167
- 238000004891 communication Methods 0.000 claims abstract description 66
- 230000005540 biological transmission Effects 0.000 claims abstract description 51
- 238000012795 verification Methods 0.000 claims description 30
- 230000008859 change Effects 0.000 claims description 26
- 238000004590 computer program Methods 0.000 claims description 14
- 238000012217 deletion Methods 0.000 claims description 7
- 230000037430 deletion Effects 0.000 claims description 7
- 238000004422 calculation algorithm Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000012360 testing method Methods 0.000 description 4
- 235000013399 edible fruits Nutrition 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 235000014510 cooky Nutrition 0.000 description 2
- 238000009795 derivation Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 210000004556 brain Anatomy 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000005303 weighing Methods 0.000 description 1
Abstract
A kind of instant communicating method and device provided in an embodiment of the present invention, applied to the client with server communication, method includes: to judge whether current network environment is weak net environment by judging whether current network environment is weak net environment;If current network environment is weak net environment, authentication package informatin is simplified, the authentication package informatin after being simplified;IM instant messages and simplified authentication package informatin are sent to server;The total amount of data of IM and simplified authentication package informatin is less than the data volume of the maximum transmission unit of network.Compared with the prior art, after the embodiment of the present invention judges that current network is weak net environment, the IM and simplified authentication package informatin for being less than the data volume of Network Maximum Transmission unit are sent to server, packets lost caused by unpacking is avoided, the success rate of client Yu server instant messaging can be improved.
Description
Technical field
The present invention relates to fields of communication technology, more particularly to a kind of instant communicating method and device.
Background technique
The development of instant messaging provides biggish convenience to people's life, and people can use client and pass through in real time
Server knows network up-to-date information, to meet user demand.
When client and server carry out instant messaging, is established after TCP link with server, send authentication to server
Package informatin finally sends IM (Instant messaging, immediately) information.Due to authentication package informatin and the number of IM instant messages
Larger according to measuring, client needs authentication package informatin splitting into several parcels, then by IM instant messages and splits into several
Parcel compressed and encoded, then to server is sent to, therefore, between a client and a server instant messaging rely on
Network environment it is poor in the case where, authenticate the parcel of package informatin during being sent to server or the parcel of IM often lost
It loses, the transmission of IM instant messages is caused usually to fail.Therefore, under weak net environment, instant messaging between client and server
Success rate is lower.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of instant communicating method and device, and client is by judging current net
After network is weak net environment, the IM for the data volume for being less than Network Maximum Transmission unit is sent to server and simplified authentication packet is believed
Breath improves the success rate of client and server instant messaging.Specific technical solution is as follows:
In a first aspect, the embodiment of the invention provides a kind of instant communicating method, applied to the client with server communication
End includes:
Judge whether current network environment is weak net environment;
If current network environment is weak net environment, authentication package informatin is simplified, the authentication after being simplified
Package informatin;Authentication package informatin is coding and compressed authentication package informatin;
Instant messages IM and simplified authentication package informatin are sent to server;IM and it is simplified authentication package informatin it is total
Data volume is less than the data volume of the maximum transmission unit of network.
Optionally, instant messages IM and simplified authentication package informatin are sent to server, comprising:
Instant messages IM and simplified authentication package informatin are sent to the weak net port of server;Weak net port is server
The newly-increased port for the reception information under weak net environment.
Optionally, before judging whether current network environment be weak net environment, the embodiment of first aspect present invention
A kind of instant communicating method provided further include:
Transmission control protocol TCP network connection is established with server.
Optionally, judge whether current network environment is weak net environment, comprising:
If sending the number of authentication package informatin failure to server under current network environment is more than frequency threshold value,
Determine that current network environment is weak net environment;
Alternatively, if not received in the given time after sending heartbeat package informatin to server under current network environment
The information returned to server then determines that current network environment is weak net environment.
Optionally, if current network environment is weak net environment, authentication package informatin is simplified, after being simplified
Authentication package informatin, comprising:
If current network environment is weak net environment, deletes non-authentication identification information in authentication package informatin and reservation is recognized
Identification information is demonstrate,proved, using the authentication package informatin after deletion as simplified authentication package informatin;Identification information is authenticated to be used for and service
The unique identification that device is authenticated.
Optionally, non-authentication identification information includes: statistical information and air control information;Certification identification information includes: user's mark
Know symbol and authentication information.
Optionally, before the step of sending instant messages IM and simplified authentication package informatin to server, the present invention
Embodiment provides a kind of instant communicating method further include: encrypts to instant messages IM.
Optionally, instant messages IM and simplified authentication package informatin are sent to server, comprising:
Encrypted IM and the simplified authentication package informatin are sent to server.
Optionally, if current network environment is weak net environment, one kind that first aspect present invention embodiment provides is
When communication means further include:
Change the waiting time;
According to the waiting time after change, receives server and return to the message receipt for being directed to IM;Waiting time after change
Greater than the waiting time of script.
Second aspect, the embodiment of the invention provides a kind of instant communicating methods, applied to the service with client communication
Device, server include: that newly-increased the be used for port of reception information and non-weak net port, method under weak net environment include:
Pass through it is weak net port receive client send instant messages IM and simplified authentication package informatin, wherein IM and
The total amount of data of simplified authentication package informatin is less than the data volume of the maximum transmission unit of network;Or, passing through non-weak net port
The authentication package informatin that client is sent is received, authentication verification is carried out based on the authentication package informatin received, sends and reflects to client
Verification result is weighed, the instant messages IM that client is sent based on authentication verification result is received.
Optionally, by it is weak net port receive client send instant messages IM and simplified authentication package informatin it
Before, the embodiment of second aspect of the present invention offer further include:
Transmission control protocol TCP network connection is established with client.
Optionally, if received IM is encrypted IM, processor is receiving client hair by weak net port
After the instant messages IM and simplified authentication package informatin that send, the embodiment of second aspect of the present invention offer further include:
IM is decrypted.
The third aspect, the embodiment of the invention provides a kind of immediate communication devices, applied to the client with server communication
End, device include:
Judgment module, for judging whether current network environment is weak net environment;
Simplify module, if being weak net environment for current network environment, authentication package informatin is simplified, is obtained
Simplified authentication package informatin;
Weak net sending module, for sending instant messages IM and simplified authentication package informatin to server;IM and simplification
The total amount of data of authentication package informatin afterwards is less than the data volume of the maximum transmission unit of network.
Optionally, weak net sending module is specifically used for:
Instant messages IM and simplified authentication package informatin are sent to the weak net port of server;Weak net port is server
The port of newly-increased and difference and non-weak net port.
A kind of immediate communication device that third aspect present invention embodiment provides, further includes:
Network connecting module, for establishing transmission control protocol TCP network connection with server.
Optionally, judgment module is specifically used for:
If sending the number of authentication package informatin failure to server under current network environment is more than frequency threshold value,
Determine that current network environment is weak net environment;
Alternatively, if not received in the given time after sending heartbeat package informatin to server under current network environment
The information returned to server then determines that current network environment is weak net environment.
Optionally, simplify module to be specifically used for:
If current network environment is weak net environment, deletes non-authentication identification information in authentication package informatin and reservation is recognized
Identification information is demonstrate,proved, using the authentication package informatin after deletion as simplified authentication package informatin;Identification information is authenticated to be used for and service
The unique identification that device is authenticated.
Optionally, a kind of immediate communication device that third aspect present invention embodiment provides further include:
Encrypting module, for being encrypted to IM;
Optionally, weak net sending module, is specifically used for: sending encrypted IM and simplified authentication packet letter to server
Breath.
A kind of immediate communication device that third aspect present invention embodiment provides further include:
Receipt receiving module, if being to change the waiting time under weak net environment for current network environment;According to change
Waiting time afterwards receives server and returns to the message receipt for being directed to IM;When waiting time after change is greater than the waiting of script
Between.
Fourth aspect, the embodiment of the invention provides a kind of immediate communication devices, applied to the service with client communication
Device, server include: that newly-increased the be used for port of reception information and non-weak net port, device under weak net environment include:
Pass through it is weak net port receive client send instant messages IM and simplified authentication package informatin, wherein IM and
The total amount of data of simplified authentication package informatin is less than the data volume of the maximum transmission unit of network;Or, passing through non-weak net port
The authentication package informatin that client is sent is received, authentication verification is carried out based on the authentication package informatin received, sends and reflects to client
Verification result is weighed, the instant messages IM that client is sent based on authentication verification result is received.
A kind of immediate communication device that fourth aspect present invention embodiment provides, further includes:
Network connecting module establishes transmission control protocol TCP network connection with client.
A kind of immediate communication device that fourth aspect present invention embodiment provides, further includes:
IM is decrypted in deciphering module.
5th aspect, present invention implementation provide a kind of terminal device, and the terminal device includes: and server communication
Client, the terminal device further include processor, communication interface, memory and communication bus, wherein the processor, institute
Communication interface is stated, the memory completes mutual communication by the communication bus;
The memory, for storing computer program;
The processor when for executing the program stored on memory, realizes method and step described in first aspect.
6th aspect, the embodiment of the invention provides a kind of server, including processor, communication interface, memory and logical
Believe bus, wherein the communication interface includes at least: weak net port and non-weak net port;The processor, the communication connect
Mouthful, the memory completes mutual communication by the communication bus;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes following method and steps:
The instant messages IM and simplified authentication package informatin that client is sent are received by the weak net port, wherein
The total amount of data of the IM and the simplified authentication package informatin is less than the data volume of the maximum transmission unit of network;Or,
The authentication package informatin that the client is sent is received by the non-weak net port, based on the authentication packet letter received
Breath carries out authentication verification, and Xiang Suoshu client sends authentication verification as a result, receiving the client is based on the authentication verification knot
The instant messages IM that fruit sends.
Optionally, a kind of server that sixth aspect present invention embodiment provides is by described in the weak net port reception
Before instant messages IM and simplified authentication package informatin that client is sent, it is also used to:
Transmission control protocol TCP network connection is established with the client.
Optionally, if received IM is encrypted IM, the processor is received by the weak net port
After instant messages IM and simplified authentication package informatin that the client is sent, what sixth aspect present invention embodiment provided
A kind of server, is also used to:
The IM is decrypted.
7th aspect, present invention implementation provide a kind of computer readable storage medium, the computer-readable storage medium
Instruction is stored in matter, when run on a computer, so that computer executes above-mentioned first aspect or second aspect is appointed
One method.
Eighth aspect, the embodiment of the present application provide a kind of application program, when run on a computer, so that calculating
Machine executes above-mentioned first aspect or second aspect either method.
9th aspect, present invention implementation additionally provides a kind of computer program product comprising instruction, when it is in computer
When upper operation, so that computer executes above-mentioned first aspect or any method of second aspect.
A kind of instant communicating method and device provided in an embodiment of the present invention, applied to the client with server communication,
By judging whether current network environment is weak net environment, judge whether current network environment is weak net environment;If worked as
Preceding network environment is weak net environment, then simplifies authentication package informatin, the authentication package informatin after being simplified;Authentication packet letter
Breath is coding and compressed authentication package informatin;IM instant messages and simplified authentication package informatin are sent to server;IM and
The total amount of data of simplified authentication package informatin is less than the data volume of the maximum transmission unit of network.Compared with the prior art, originally
The embodiment of invention judges that current network is the data volume to server transmission less than Network Maximum Transmission unit after weak net environment
IM and simplified authentication package informatin, avoid packets lost caused by unpacking, client can be improved with server i.e.
The success rate of Shi Tongxin.
A kind of communication means and device provided in an embodiment of the present invention pass through applied to the server with client communication
The weak net port receives instant messages IM and simplified authentication package informatin that client is sent, wherein the IM and described
The total amount of data of simplified authentication package informatin is less than the data volume of the maximum transmission unit of network;Or, passing through the non-weak net
Port receives the authentication package informatin that the client is sent, and carries out authentication verification, Xiang Suoshu based on the authentication package informatin received
Client sends authentication verification as a result, receiving the instant messages IM that the client is sent based on the authentication verification result.Phase
Than in weak net and non-weak net, server is all to receive client IM and authentication by non-weak net port in the prior art
Package informatin, the embodiment of the present invention increase weak net port newly and are used to receive the IM and simplified authentication package informatin in the case of weak net, nothing
It needs server after receiving the information that client is sent with non-weak net port, distinguishes the client under non-weak net and weak net environment again
The information sent is held, avoids server from distinguishing the information that the client under non-weak net and weak net environment is sent and mistake occurs, therefore
The success rate of client Yu server instant messaging can be improved, while improving the efficiency that server receives information.Implement this
Any product or method of invention do not necessarily require achieving all the advantages described above at the same time.
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.
Fig. 1 is a kind of flow chart of instant communicating method of first aspect provided in an embodiment of the present invention;
Fig. 2 is the flow chart that client is interacted with server under weak net environment provided in an embodiment of the present invention;
Fig. 3 is the flow chart that client is interacted with server under non-weak net environment provided in an embodiment of the present invention;
Fig. 4 is a kind of structure chart of immediate communication device of the third aspect provided in an embodiment of the present invention;
Fig. 5 is a kind of structure chart of terminal device provided in an embodiment of the present invention;
Fig. 6 is a kind of structure chart of server provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is described.
A kind of instant communicating method and device provided in an embodiment of the present invention, applied to the client with server communication,
By judging whether current network environment is weak net environment, judge whether current network environment is weak net environment;If worked as
Preceding network environment is weak net environment, then simplifies authentication package informatin, the authentication package informatin after being simplified;To server
Send IM instant messages and simplified authentication package informatin;The total amount of data of IM and simplified authentication package informatin is less than network
The data volume of maximum transmission unit.
A kind of instant communicating method provided in an embodiment of the present invention is briefly described first below.
In a first aspect, in order to improve the success rate of client Yu server instant messaging, from the client with server communication
The angle at end, as shown in Figure 1, the embodiment of the invention provides a kind of instant communicating methods, comprising:
S101, client judge whether current network environment is weak net environment;
With reference to Fig. 2, the S101 the step of before, server establishes TCP (Transmission firstly the need of with client
Control Protocol transmission control protocol) network connection, to test whether current network environment can be successfully transmitted simplification
Authentication package informatin afterwards, if test does not pass through just without executing step S101, to further improve under weak net environment i.e. yet
When information IM and it is simplified authentication package informatin transmission success rate.
In order to improve the success rate of client Yu server instant messaging, S101 can be using following at least one possible
Implementation judges whether current network environment is weak net environment:
In a kind of possible embodiment, if user end to server sends authentication under current network environment
The number of package informatin failure is more than frequency threshold value, then determines that current network environment is weak net environment.Wherein, frequency threshold value is pre-
The numerical value first set.
In alternatively possible embodiment, if user end to server sends the heart under current network environment
After jumping package informatin, the information of server return is not received in the given time, then determine that current network environment is weak net environment.
Wherein, the predetermined time is preset time value.
S102, if current network environment is weak net environment, client simplifies package informatin is authenticated, and obtains letter
Authentication package informatin after change;
In order to improve the success rate of client Yu server instant messaging, S102 can be using following at least one possible
Implementation, client simplify package informatin is authenticated:
In a kind of possible embodiment, if current network environment is weak net environment, client first will authentication
Package informatin is decoded and decompresses, and then deletes non-authentication identification information in authentication package informatin and retains certification identification information, will
Authentication package informatin after deletion is as simplified authentication package informatin.Wherein, certification identification information with server for being recognized
The unique identification of card;Certification identification information can include but is not limited to user identifier and authentication information.
Present embodiment, can be with by simplifying the non-authentication identification information in authentication package informatin and retaining certification identification information
Guarantee that client and server can improve client and server carry out by the carry out authentication of simplified authentication information
The rate of authentication.
In alternatively possible embodiment, if current network environment is weak net environment, client first will mirror
Power package informatin is decoded and decompresses, and statistical information and air control information in authentication package informatin is deleted, by the authentication packet after deletion
Information is as simplified authentication package informatin.
Wherein, authentication package informatin includes: statistical information, air control information, user identifier and authentication information;Simplified mirror
Weighing package informatin includes: user identifier and authentication information;Statistical information includes: the signal of client, the brand of client, client
System, client id, client the connection network for holding installation are WIFI or cable network etc.;Air control information includes: malice
The client id of access, the number of malicious access, the address of malicious access etc.;Authentication information can include but is not limited to
Cookie information and token.Cookie is website to distinguish user identity, carrying out session tracking and being stored in user's sheet
Data in ground terminal.Token represents the object for executing the right of operation.
Present embodiment simplifies authentication package informatin, only protects by deleting statistical information, air control information in authentication package informatin
User identifier and authentication information have been stayed, simplified authentication package informatin can be quickly obtained.
In addition, can also be to letter after above two embodiment to further reduce the data volume of authentication package informatin
Authentication package informatin after change second compression and/or coding again, to realize the effect for being further simplified authentication package informatin.
S103, user end to server send instant messages IM and simplified authentication package informatin;IM and simplified mirror
The total amount of data of power package informatin is less than the data volume of the maximum transmission unit of network.
Before user end to server sends IM, client encrypts IM, is believed with improving client and server
Cease the safety of transmission.
Wherein, client can be used preset password and be encrypted;Client can also use preset Encryption Algorithm.
Such as: MD5 (md5-challenge, Message-Digest Algorithm 5), SHA1 (Secure Hash Algorithm, Secure
Hash Algorithm), PBKDF2 (cipher key derivation function 2 based on password, Password-Based Key Derivation
Function 2), AES (Advanced Encryption Standard, Advanced Encryption Standard), DEA (data encryption algorithm,
Data Encryption Algorithm), one or more of Hash HASH scheduling algorithm algorithm combines and adds to IM
It is close.
It makes an appointment between client and server the cipher mode that IM is encrypted, it is assumed that client and server are about
Surely it is encrypted using preset password, then server will use preset password and IM is decrypted.If client uses
AES encryption algorithm encrypts IM, then server will use AES encryption algorithm and IM is decrypted.It is default compared to using
Password encrypted, the safety encrypted using preset algorithm to IM is higher.
After S103, server is after receiving client and sending IM and simplified authentication package informatin, server
IM is decrypted, the message receipt for being directed to IM is then sent to client;Wherein, message receipt is server for notifying visitor
Whether family end IM sends success, and message receipt can be with are as follows: the mark of ture or false.
Preset password or preset Encryption Algorithm can be used to the IM received the mode being decrypted in server.
Client changes the waiting time, according to the waiting time after change, receives the server and returns for the IM
Message receipt;Wherein, the waiting time after change is greater than the waiting time of client script.The waiting time of client script
It is client under non-weak net environment, waiting for server returns to the time of message receipt.
If client does not receive the message receipt of server transmission in the waiting time after change, client is to clothes
Business device sends IM failure, if receiving the message receipt of server transmission in the waiting time after client change, and message
Receipt is ture mark, then user end to server sends IM success.Client increases the waiting time, can be improved to receive and disappears
Cease the success rate of receipt.
Compared with the prior art, it after the embodiment of the present invention judges that current network is weak net environment, is sent to server small
In the IM and simplified authentication package informatin of the data volume of Network Maximum Transmission unit, avoids packet caused by unpacking and lose
It loses, the success rate of client Yu server instant messaging can be improved.
A kind of instant communicating method that first aspect of the embodiment of the present invention provides, method further include:
With reference to Fig. 3, if current network environment is non-weak net environment, user end to server sends authentication packet letter
Breath receives the authenticating result that server is sent according to the waiting time of script setting, receives server transmission in client
After authenticating result, client is based on authenticating result, judges whether to send IM to server.
Specifically, client can send authentication package informatin to the non-weak net port of server, receive clothes in client
It is engaged in after the authenticating result that device is sent, client is based on authenticating result, judges whether to send IM to the non-weak net port of server.This
When, after server receives the authentication package informatin of client transmission by the non-weak net port of itself, directly authentication will be wrapped
Information carries out authentication verification, then sends authentication verification to client as a result, and receiving the IM that client is sent.
Before user end to server sends IM, client encrypts IM, is believed with improving client and server
Cease the safety of transmission.Client cipher mode is identical as cipher mode in above-described embodiment in the present embodiment, no longer superfluous again
It states.At this point, server is received under non-weak net environment from the non-weak net port of body receiving client, the IM of transmission is carried out
Then decryption sends message receipt to client.Wherein, message receipt is server for notifying whether client IM sends into
Function;Message receipt are as follows: the mark of ture or false.
Client passes through under non-weak net environment in the present embodiment, sends authentication package informatin to server, server is to visitor
Authentication verification is carried out after the authentication package informatin that family end is sent, then sends authentication verification to client as a result, client is based on mirror
It weighs verification result and sends IM to server, ensure that client and server can be normally carried out instant messaging under non-weak net environment
Meanwhile the efficiency of client and server progress instant messaging can be improved.
Second aspect, in order to improve the success rate of client Yu server instant messaging, from the service with client communication
The angle of device, the embodiment of the invention provides another instant communicating methods, comprising:
The instant messages IM and simplified authentication package informatin that client is sent are received by the weak net port, wherein
The total amount of data of the IM and the simplified authentication package informatin is less than the data volume of the maximum transmission unit of network;Or,
The authentication package informatin that the client is sent is received by the non-weak net port, based on the authentication packet letter received
Breath carries out authentication verification, and Xiang Suoshu client sends authentication verification as a result, receiving the client is based on the authentication verification knot
The instant messages IM that fruit sends.With reference to Fig. 2, user end to server sends instant messages IM and simplified authentication package informatin
Afterwards, server receives client under weak net environment, the instant messages IM of transmission and simplified authentication package informatin.
Server side of the embodiment of the present invention has preset weak net port, compared with the prior art in weak net and non-weak net situation
Under, server is all to receive client IM by non-weak net port and authenticate package informatin, and reception can be improved in the embodiment of the present invention
The efficiency of IM and simplified authentication package informatin that client is sent under weak net environment, improve client and server Instant Messenger
The success rate of letter.
Client is received under weak net environment by weak net port in server, the instant messages IM of transmission and simplified
Before the step of authenticating package informatin, server establishes transmission control protocol TCP network connection firstly the need of with client, with test
Whether current network environment can be successfully transmitted simplified authentication package informatin, if test is not by also just without executing step
S101, to further improve the transmission success rate of instant messages IM and simplified authentication package informatin under weak net environment.
With reference to Fig. 3, server receives the authentication package informatin of transmission under non-weak net environment by the non-weak net port of itself
After carry out authentication verification, then to the client send authentication verification as a result, and receive the client be based on the authentication
As a result the IM sent.
The IM that the client is sent based on the authenticating result is received in server, the IM can be solved
It is close.It makes an appointment between client and server the cipher mode that IM is encrypted, it is assumed that client makes with server commitment
It is encrypted with preset password, then server will use preset password and IM is decrypted.If client is added using AES
Close algorithm encrypts IM, then server will use AES encryption algorithm and IM is decrypted.
After the IM that server receives that the client is sent based on the authenticating result, server is to client
Send the message receipt for being directed to the IM;Client can change the waiting time, then according to the waiting time after change, receive clothes
Business device returns to the message receipt for being directed to IM;Waiting time after change is greater than the waiting time of script, and message receipt is for notifying
Whether client IM sends success.
The third aspect, in order to improve the success rate of client Yu server instant messaging, as shown in figure 4, being applied to and clothes
The angle of the client of business device communication, a kind of immediate communication device provided in an embodiment of the present invention, comprising:
Judgment module 401, for judging whether current network environment is weak net environment;
Simplify module 402, if being weak net environment for current network environment, authentication package informatin simplified,
Authentication package informatin after being simplified;Authentication package informatin is coding and compressed authentication package informatin;
Weak net sending module 403, for sending instant messages IM and simplified authentication package informatin to server;IM and letter
The total amount of data of authentication package informatin after change is less than the data volume of the maximum transmission unit of network.
Optionally, weak net sending module is specifically used for:
Instant messages IM and simplified authentication package informatin are sent to the weak net port of server;Weak net port is server
The port of newly-increased and difference and non-weak net port.
A kind of immediate communication device that third aspect present invention embodiment provides further include:
Network connecting module, for establishing transmission control protocol TCP network connection with server.
Judgment module is specifically used for:
If sending the number of authentication package informatin failure to server under current network environment is more than frequency threshold value,
Determine that current network environment is weak net environment;
Alternatively, if not received in the given time after sending heartbeat package informatin to server under current network environment
The information returned to server then determines that current network environment is weak net environment.
Optionally, simplify module to be specifically used for:
If current network environment is weak net environment, deletes non-authentication identification information in authentication package informatin and reservation is recognized
Identification information is demonstrate,proved, using the authentication package informatin after deletion as simplified authentication package informatin;Identification information is authenticated to be used for and service
The unique identification that device is authenticated.
A kind of immediate communication device that third aspect present invention embodiment provides further include:
Encrypting module, for being encrypted to IM;
Weak net sending module, is specifically used for:
Encrypted IM and simplified authentication package informatin are sent to server.
A kind of immediate communication device that third aspect present invention embodiment provides further include:
Receipt receiving module, if being to change the waiting time under weak net environment for current network environment;According to change
Waiting time afterwards receives server and returns to the message receipt for being directed to IM;When waiting time after change is greater than the waiting of script
Between.
Fourth aspect, the embodiment of the invention provides a kind of immediate communication devices, applied to the service with client communication
Device, server include: that newly-increased the be used for port of reception information and non-weak net port, device under weak net environment include:
Receiving module, for receiving the instant messages IM and simplified authentication packet letter that client is sent by weak net port
Breath, wherein the total amount of data of IM and simplified authentication package informatin is less than the data volume of the maximum transmission unit of network;Or,
The authentication package informatin that client is sent is received by non-weak net port, is reflected based on the authentication package informatin received
Power verifying sends authentication verification to client as a result, receiving the instant messages IM that client is sent based on authentication verification result.
A kind of immediate communication device that fourth aspect present invention embodiment provides, further includes:
Network connecting module establishes transmission control protocol TCP network connection with client.
A kind of immediate communication device that fourth aspect present invention embodiment provides, further includes:
IM is decrypted in deciphering module.
5th aspect, in order to improve the success rate of client Yu server instant messaging, from the client with server communication
The angle at end, the embodiment of the invention provides a kind of terminal devices, as shown in figure 5, further terminal device can be mobile phone, electricity
Brain, intelligent mobile terminal equipment, wearable intelligent mobile terminal equipment etc., terminal device include processor 501, communication interface
502, memory 503 and communication bus 504, wherein processor 501, communication interface 502, memory 503 pass through communication bus
504 complete mutual communication,
Memory 503, for storing computer program;
Processor 501 when for executing the program stored on memory 503, realizes following steps:
Judge whether current network environment is weak net environment;
If current network environment is weak net environment, authentication package informatin is simplified, the authentication after being simplified
Package informatin;
Instant messages IM and simplified authentication package informatin are sent to server;IM and it is simplified authentication package informatin it is total
Data volume is less than the data volume of the maximum transmission unit of network.
6th aspect, in order to improve the success rate of client Yu server instant messaging, the embodiment of the invention provides one
Kind server, as shown in fig. 6, including processor 601, communication interface 602, memory 603 and communication bus 604, wherein described
Communication interface 602 includes at least: weak net port and non-weak net port, processor 601, communication interface 602, memory 603 pass through
Communication bus 604 completes mutual communication,
Memory 603, for storing computer program;
Processor 601 when for executing the program stored on memory 603, realizes following steps:
The instant messages IM and simplified authentication package informatin that client is sent are received by the weak net port, wherein
The total amount of data of the IM and the simplified authentication package informatin is less than the data volume of the maximum transmission unit of network;Or,
The authentication package informatin that the client is sent is received by the non-weak net port, based on the authentication packet letter received
Breath carries out authentication verification, and Xiang Suoshu client sends authentication verification as a result, receiving the client is based on the authentication verification knot
The instant messages IM that fruit sends.
Corresponding to method shown in first aspect or second aspect, computer-readable deposited the embodiment of the invention provides a kind of
Storage media is stored with computer program in the storage medium, and the computer program is realized above-mentioned when being executed by processor
A kind of the step of instant communicating method.
Corresponding to method shown in first aspect or second aspect, the embodiment of the invention provides a kind of meters comprising instruction
Calculation machine program product, when run on a computer, so that the step of computer executes a kind of above-mentioned instant communicating method.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program
Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or
It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter
Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium
In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or
Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or
It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with
It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk
Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device/
For electronic equipment/computer readable storage medium/computer program product embodiments/computer program, due to its basic phase
It is similar to embodiment of the method, so being described relatively simple, the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (19)
1. a kind of instant communicating method, which is characterized in that applied to the client with server communication, which comprises
Judge whether current network environment is weak net environment;
If current network environment is weak net environment, authentication package informatin is simplified, the authentication packet letter after being simplified
Breath;The authentication package informatin is coding and compressed authentication package informatin;
Instant messages IM and the simplified authentication package informatin are sent to the server;The IM and the simplified mirror
The total amount of data of power package informatin is less than the data volume of the maximum transmission unit of network.
2. the method according to claim 1, wherein described to server transmission instant messages IM and described
Simplified authentication package informatin, comprising:
Instant messages IM and the simplified authentication package informatin are sent to the weak net port of the server;The weak net port
It is the newly-increased port for the reception information under weak net environment of the server.
3. the method according to claim 1, wherein judge current network environment whether be weak net environment it
Before, the method also includes:
Transmission control protocol TCP network connection is established with the server.
4. judging whether current network environment is weak net ring the method according to claim 1, wherein described
Border, comprising:
If sending the number of authentication package informatin failure to the server under current network environment is more than frequency threshold value,
Determine that current network environment is weak net environment;
Alternatively, if not received in the given time after sending heartbeat package informatin to the server under current network environment
The information returned to the server then determines that current network environment is weak net environment.
5. the method according to claim 1, wherein if the current network environment is weak net environment,
Authentication package informatin is simplified, the authentication package informatin after being simplified, comprising:
If current network environment is weak net environment, deletes non-authentication identification information in authentication package informatin and retain certification mark
Information is known, using the authentication package informatin after deletion as simplified authentication package informatin;The certification identification information be used for it is described
The unique identification that server is authenticated.
6. according to the method described in claim 5, it is characterized in that, the non-authentication identification information includes: statistical information and wind
Control information;The certification identification information includes: user identifier and authentication information.
7. the method according to claim 1, wherein sending instant messages IM and the letter to the server
Before the step of authentication package informatin after change, the method also includes:
Instant messages IM is encrypted;
It is described to send instant messages IM and the simplified authentication package informatin to the server, comprising:
Encrypted IM and the simplified authentication package informatin are sent to the server.
8. method according to any one of claims 1 to 7, which is characterized in that if current network environment is weak net ring
Border, the method also includes:
Change the waiting time;
According to the waiting time after change, receives the server and return to the message receipt for being directed to the IM;After the change
Waiting time is greater than the waiting time of script.
9. a kind of immediate communication device, which is characterized in that applied to the client with server communication, described device includes:
Judgment module, for judging whether current network environment is weak net environment;
Simplify module, if being weak net environment for current network environment, authentication package informatin is simplified, is simplified
Authentication package informatin afterwards;
Weak net sending module, for sending instant messages IM and the simplified authentication package informatin to the server;It is described
The total amount of data of IM and the simplified authentication package informatin is less than the data volume of the maximum transmission unit of network.
10. device according to claim 9, which is characterized in that the weak net sending module is specifically used for:
Instant messages IM and the simplified authentication package informatin are sent to the weak net port of the server;The weak net port
It is the newly-increased server and difference and the non-weak port for netting port.
11. device according to claim 9, which is characterized in that described device further include:
Network connecting module, for establishing transmission control protocol TCP network connection with server.
12. device according to claim 9, which is characterized in that the judgment module is specifically used for:
If sending the number of authentication package informatin failure to the server under current network environment is more than frequency threshold value,
Determine that current network environment is weak net environment;
Alternatively, if not received in the given time after sending heartbeat package informatin to the server under current network environment
The information returned to the server then determines that current network environment is weak net environment.
13. device according to claim 9, which is characterized in that the simplified module is specifically used for:
If current network environment is weak net environment, deletes non-authentication identification information in authentication package informatin and retain certification mark
Information is known, using the authentication package informatin after deletion as simplified authentication package informatin;The certification identification information be used for it is described
The unique identification that server is authenticated.
14. device according to claim 9, which is characterized in that described device further include:
Encrypting module, for being encrypted to the IM;
The weak net sending module, is specifically used for:
Encrypted IM and the simplified authentication package informatin are sent to the server.
15. according to the described in any item devices of claim 9 to 14, which is characterized in that described device further include:
Receipt receiving module, if being to change the waiting time under weak net environment for current network environment;After change
Waiting time receives the server and returns to the message receipt for being directed to the IM;Waiting time after the change is greater than originally
Waiting time.
16. a kind of server, which is characterized in that including processor, communication interface, memory and communication bus, wherein described logical
Believe that interface at least includes: weak net port and non-weak net port;The processor, the communication interface, the memory pass through institute
It states communication bus and completes mutual communication;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes following method and steps:
The instant messages IM and simplified authentication package informatin that client is sent are received by the weak net port, wherein described
The total amount of data of IM and the simplified authentication package informatin is less than the data volume of the maximum transmission unit of network;Or,
Receive the authentication package informatin that the client is sent by the non-weak net port, based on the authentication package informatin received into
Row authentication verification, Xiang Suoshu client are sent authentication verification and are sent out as a result, receiving the client based on the authentication verification result
The instant messages IM sent.
17. server according to claim 16, which is characterized in that the processor is received by the weak net port
Before instant messages IM and simplified authentication package informatin that the client is sent, it is also used to:
Transmission control protocol TCP network connection is established with the client.
18. server according to claim 16, which is characterized in that if received IM is encrypted IM, institute
It states processor and the instant messages IM and simplified authentication package informatin that the client is sent is being received by the weak net port
Later, it is also used to:
The IM is decrypted.
19. a kind of terminal device, which is characterized in that including processor, communication interface, memory and communication bus, wherein described
Processor, the communication interface, the memory complete mutual communication by the communication bus;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes any side claim 1-8
Method step.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811541568.9A CN109729000B (en) | 2018-12-17 | 2018-12-17 | Instant messaging method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811541568.9A CN109729000B (en) | 2018-12-17 | 2018-12-17 | Instant messaging method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109729000A true CN109729000A (en) | 2019-05-07 |
CN109729000B CN109729000B (en) | 2021-07-09 |
Family
ID=66296154
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811541568.9A Active CN109729000B (en) | 2018-12-17 | 2018-12-17 | Instant messaging method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109729000B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110958064A (en) * | 2019-12-10 | 2020-04-03 | 英业达科技有限公司 | Method for regulating data transmission |
CN111314465A (en) * | 2020-02-17 | 2020-06-19 | 天津卓朗科技发展有限公司 | Weak network environment communication method and device and electronic equipment |
CN115022390A (en) * | 2022-05-27 | 2022-09-06 | 中国银行股份有限公司 | Weak network-based service processing method, device, storage medium and program product |
CN115021831A (en) * | 2022-06-22 | 2022-09-06 | 北京有竹居网络技术有限公司 | Weak network testing method, device, system, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100287244A1 (en) * | 2009-05-11 | 2010-11-11 | Navosha Corporation | Data communication using disposable contact information |
EP2479956A1 (en) * | 2011-01-17 | 2012-07-25 | Gemalto SA | Method of optimizing a text massage communication between a server and a secure element |
CN107147808A (en) * | 2017-06-28 | 2017-09-08 | 珠海市魅族科技有限公司 | A kind of message treatment method and device, computer installation and storage medium |
CN107426080A (en) * | 2017-03-20 | 2017-12-01 | 宇龙计算机通信科技(深圳)有限公司 | Information forwarding method and device, electronic equipment |
-
2018
- 2018-12-17 CN CN201811541568.9A patent/CN109729000B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100287244A1 (en) * | 2009-05-11 | 2010-11-11 | Navosha Corporation | Data communication using disposable contact information |
EP2479956A1 (en) * | 2011-01-17 | 2012-07-25 | Gemalto SA | Method of optimizing a text massage communication between a server and a secure element |
CN107426080A (en) * | 2017-03-20 | 2017-12-01 | 宇龙计算机通信科技(深圳)有限公司 | Information forwarding method and device, electronic equipment |
CN107147808A (en) * | 2017-06-28 | 2017-09-08 | 珠海市魅族科技有限公司 | A kind of message treatment method and device, computer installation and storage medium |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110958064A (en) * | 2019-12-10 | 2020-04-03 | 英业达科技有限公司 | Method for regulating data transmission |
CN111314465A (en) * | 2020-02-17 | 2020-06-19 | 天津卓朗科技发展有限公司 | Weak network environment communication method and device and electronic equipment |
CN111314465B (en) * | 2020-02-17 | 2023-04-07 | 天津卓朗科技发展有限公司 | Weak network environment communication method and device and electronic equipment |
CN115022390A (en) * | 2022-05-27 | 2022-09-06 | 中国银行股份有限公司 | Weak network-based service processing method, device, storage medium and program product |
CN115021831A (en) * | 2022-06-22 | 2022-09-06 | 北京有竹居网络技术有限公司 | Weak network testing method, device, system, equipment and storage medium |
CN115021831B (en) * | 2022-06-22 | 2024-03-12 | 北京有竹居网络技术有限公司 | Weak network test method, device, system, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109729000B (en) | 2021-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101361161B1 (en) | System and method for reinforcing authentication using context information for mobile cloud | |
CN109729000A (en) | A kind of instant communicating method and device | |
CN104967997B (en) | A kind of Wi-Fi cut-in method, Wi-Fi equipment, terminal device and system | |
CN105933888B (en) | A kind of eSIM card method for burn-recording and device based on NFC | |
CN109905312B (en) | Message pushing method, device and system | |
CN104144163B (en) | Auth method, apparatus and system | |
CN104320389B (en) | A kind of fusion identity protection system and method based on cloud computing | |
CN105530253B (en) | Wireless sensor network access authentication method under Restful framework based on CA certificate | |
CN104618315B (en) | A kind of method, apparatus and system of verification information push and Information Authentication | |
CN102761870B (en) | Terminal authentication and service authentication method, system and terminal | |
CN109815684A (en) | A kind of identity identifying method, system and server and storage medium | |
CN106101122A (en) | A kind of login method and device | |
JP2013097650A (en) | Authentication system, authentication method and authentication server | |
CN108990062A (en) | Intelligent and safe Wi-Fi management method and system | |
CN103747051A (en) | Service platform of vehicle-mounted terminal | |
CN204376941U (en) | Outer net middleware, Intranet middleware and middleware system | |
CN110392998A (en) | A kind of data packet method of calibration and equipment | |
CN106027249B (en) | Identity card card reading method and system | |
CN114760112B (en) | Wireless local area network-oriented intelligent home equipment networking method, system, equipment and storage medium | |
CN102769629A (en) | Client-side password storage method and service system | |
CN108337235A (en) | A kind of method and system executing safety operation using safety equipment | |
CN107819766A (en) | Safety certifying method, system and computer-readable recording medium | |
CN113543121A (en) | Protection method for updating terminal parameter and communication device | |
CN109495500A (en) | A kind of double factor authentication method based on smart phone | |
CN103595619A (en) | Method, device and system for adding friend |
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 |