A kind of at group member's interactive approach
Technical field
The present invention relates to a kind of online interaction method, especially a kind of interactive approach group member.
Background technology
Online interaction software a kind ofly user can be allowed to carry out interactive social software by mobile phone or computer and other people.The use of current social software is very universal, and famous company is as domestic Tengxun qq, and the use of external picture twitter, facebook, MSN etc. is very popular and universal.But along with the fast development of the universal of smart mobile phone and mobile Internet, the social software based on mobile Internet is easily accepted by a user rapidly, the social software of now a large amount of smart phone user big city installations more or less.But current most social software is fewer for the interaction of group member, and for the message management also more complicated of group member.
Summary of the invention
The technical problem to be solved in the present invention is existing group member interactive message complex management.
In order to solve the problems of the technologies described above, the invention provides a kind of at group member's interactive approach, comprising the steps:
Step 1, group member is after a certain client logs in, server is that this group member distributes unique login identification code, and the information about firms of corresponding this group member of storage and this time log in distribution log in identification code, the identification code that logs in again this being logged in distribution sends to this group member this time to log in used client, what this logged in that used client receives that this group member this time logs in distribution logs in identification code, and timing logs in the online heartbeat signal of the login identification code of distribution with the information about firms of this group member and this to server transmission,
Step 2, server receives the online heartbeat signal that each client sends, and by the information about firms comprised in online heartbeat signal and the information about firms that logs in identification code and up-to-date storage with log in identification code and compare, if information about firms and to log in identification code inconsistent, then send illegal member's return code to the client sending inconsistent online heartbeat signal, client automatically exits after receiving illegal member's return code and this time logs in, if information about firms is with to log in identification code all consistent, then check in the message queue corresponding with this information about firms whether have unread message, if there is unread message, the return parameters of unread message is then returned to the client sending consistent online heartbeat signal, if there is no unread message, then return to the client sending consistent online heartbeat signal the return parameters not having unread message,
Step 3, client is after receiving the return parameters of unread message, if the group member that this client logs in sends the request instruction reading unread message to server, the unread message corresponding with the information about firms of the group member that this client logs in then is returned to this client by server, and delete by the unread message returned, if the group member that client logs in does not send the request instruction reading unread message to server, server does not initiatively return unread message to this client;
Step 4, group member is to logged in client input interactive message, interactive message with type information according to the type information of the every bar interactive message of interactive message curriculum offering, and is sent to server by client, and type information comprises chat messages and GC group command;
Step 5, server receives the interactive message with type information, and type of message is parsed from interactive message, the target complex ID that message content and message send, the target complex ID sent according to message again searches the group member in target complex, if type of message is chat messages, then be inserted in the message queue of server according to the principle of everyone chat messages of group member all in target complex, if type of message is GC group command, then first verify the validity of this GC group command, if this GC group command is effective, again according to GC group command amendment group activity state, if this GC group command is invalid, then do not revise.
Be adopted as every group member and distribute unique login identification code, and by the online heartbeat signal of client timed sending, thus effectively avoid same group member to log at two places simultaneously; Adopting in client is that every bar interactive message arranges type of message, chat messages and GC group command is distinguished, achieves the simple management to group member interaction.
As further restriction scheme of the present invention, log in the character string that identification code is 15.Adopting 15 character strings as logging in identification code, can meet completely for every group member distributes unique requirement logging in identification code.
Scheme as a further improvement on the present invention, server is that every group member is all provided with unread message identifier, if the unread message identifier that certain group member is corresponding is 1, then indicate unread message, if the unread message identifier that certain group member is corresponding is 0, then represent there is no unread message.Adopt unread message identifier that server can be made to grasp every group member at any time and whether have unread message.
As further restriction scheme of the present invention, the cycle of the online heartbeat signal of client timed sending is 10 ~ 30 seconds.Adopt the time of 10 ~ 30 seconds to send online heartbeat message, enable server grasp the presence of group member in real time.
Scheme as a further improvement on the present invention, the unread message quantity of server to every group member counts respectively, every many one of the unread message of group member in the message queue of server, to the unread message quantity of position group member adding 1, group member often reads a unread message from client, to the unread message quantity of position group member subtracting 1.Adopt and the unread message quantity of every group member is counted respectively, enable group member grasp the unread message number of oneself in real time by client.
As further restriction scheme of the present invention, group activity state is used for representing that group member is in idle or busy state.The real-time status of group member can be shown by group activity state, be used for preventing from being bothered by people, or represent that can receive others' invitation carries out interaction.
As further restriction scheme of the present invention, the content of server authentication GC group command validity comprises the group member whether qualified amendment group activity state of this GC group command of transmission and whether meets alteration ruler according to the group activity state that this GC group command is revised.The group activity state of non-this group of group members malicious modification can be prevented.
Beneficial effect of the present invention is: (1) with distributing unique login identification code for every group member, and passes through the online heartbeat signal of client timed sending, thus effectively avoids same group member to log at two places simultaneously; (2) adopting in client is that every bar interactive message arranges type of message, chat messages and GC group command is distinguished, achieves the simple management to group member interaction; (3) adopt unread message identifier that server can be made to grasp every group member at any time and whether have unread message; (4) employing counts respectively to the unread message quantity of every group member, enables group member grasp the unread message number of oneself in real time by client; (5) real-time status of group member can be shown by group activity state, be used for preventing from being bothered by people, or represent that can receive others' invitation carries out interaction.
Accompanying drawing explanation
Fig. 1 of the present inventionly logs in schematic flow sheet;
Fig. 2 is messaging interaction schematic flow sheet of the present invention.
Embodiment
Below in conjunction with accompanying drawing, technical solution of the present invention is described in detail, but protection scope of the present invention is not limited to described embodiment.
Embodiment 1:
As illustrated in fig. 1 and 2, of the present invention at group member's interactive approach, comprise the steps:
Step 1, group member is after a certain client logs in, server is that this group member distributes unique login identification code, log in the character string that identification code can be set to 15, can meet for every group member distributes unique requirement logging in identification code completely, and the information about firms of corresponding this group member of storage and this time log in distribution log in identification code, the identification code that logs in again this being logged in distribution sends to this group member this time to log in used client, what this logged in that used client receives that this group member this time logs in distribution logs in identification code, and timing logs in the online heartbeat signal of the login identification code of distribution with the information about firms of this group member and this to server transmission, the cycle of the online heartbeat signal of client timed sending can be set to 10 ~ 30 seconds,
Step 2, server receives the online heartbeat signal that each client sends, and by the information about firms comprised in online heartbeat signal and the information about firms that logs in identification code and up-to-date storage with log in identification code and compare, if information about firms and to log in identification code inconsistent, then send illegal member's return code to the client sending inconsistent online heartbeat signal, client automatically exits after receiving illegal member's return code and this time logs in, if information about firms is with to log in identification code all consistent, then check in the message queue corresponding with this information about firms whether have unread message, if there is unread message, the return parameters of unread message is then returned to the client sending consistent online heartbeat signal, if there is no unread message, then return to the client sending consistent online heartbeat signal the return parameters not having unread message,
Step 3, client is after receiving the return parameters of unread message, if the group member that this client logs in sends the request instruction reading unread message to server, the unread message corresponding with the information about firms of the group member that this client logs in then is returned to this client by server, and delete by the unread message returned, if the group member that client logs in does not send the request instruction reading unread message to server, server does not initiatively return unread message to this client;
Step 4, group member is to logged in client input interactive message, interactive message with type information according to the type information of the every bar interactive message of interactive message curriculum offering, and is sent to server by client, and type information comprises chat messages and GC group command;
Step 5, server receives the interactive message with type information, and type of message is parsed from interactive message, the target complex ID that message content and message send, the target complex ID sent according to message again searches the group member in target complex, if type of message is chat messages, then be inserted in the message queue of server according to the principle of everyone chat messages of group member all in target complex, if type of message is GC group command, then first verify the validity of this GC group command, the content of server authentication GC group command validity comprises the group member whether qualified amendment group activity state of this GC group command of transmission and whether meets alteration ruler according to the group activity state that this GC group command is revised, the group activity state of non-this group of group members malicious modification can be prevented, if this GC group command is effective, again according to GC group command amendment group activity state, group activity state is used for representing that group member is in idle or busy state, the real-time status of group member can be shown by group activity state, be used for preventing from being bothered by people, or represent that can receive others' invitation carries out interaction, if this GC group command is invalid, then do not revise.
Be adopted as every group member and distribute unique login identification code, and by the online heartbeat signal of client timed sending, thus effectively avoid same group member to log at two places simultaneously; Adopting in client is that every bar interactive message arranges type of message, chat messages and GC group command is distinguished, achieves the simple management to group member interaction.
Whether unread message is had in order to every group member can be grasped further in real time, server is also all provided with unread message identifier for every group member, if the unread message identifier that certain group member is corresponding is 1, then indicate unread message, if the unread message identifier that certain group member is corresponding is 0, then represent there is no unread message.
The unread message number of oneself is grasped in real time by client in order to group member can be enable, server also counts respectively to the unread message quantity of every group member, every many one of the unread message of group member in the message queue of server, to the unread message quantity of position group member adding 1, group member often reads a unread message from client, to the unread message quantity of position group member subtracting 1.
As mentioned above, although represented with reference to specific preferred embodiment and described the present invention, it shall not be construed as the restriction to the present invention self.Under the spirit and scope of the present invention prerequisite not departing from claims definition, various change can be made in the form and details to it.