Summary of the invention
The object of this invention is to provide a kind of user's statistical method and system of the public chat system based on car-mounted terminal, quick and precisely add up user's distribution condition in current chat group and online user's quantity to enable server.
User's statistical method of the public chat system based on car-mounted terminal provided by the invention, comprising:
The chat group information that server is safeguarded is sent to public chat system, and described chat group information comprises chat group ID;
The car-mounted terminal sending public chat request is dispensed to chat group by server, and corresponding chat group ID is sent to described car-mounted terminal;
When described car-mounted terminal is by described public chat system group chat in the chat group corresponding to this chat group ID, the entering group, move back group records of described server monitoring car-mounted terminal;
Based on described monitoring record, add up the number of users of each chat group in described public chat system.
Wherein, described based on monitoring record, in public chat system described in real-time statistics, the online user of each chat group comprises:
Described car-mounted terminal has user ID, and when car-mounted terminal enters chat group, server receives and enters group records from car-mounted terminal, corresponding user ID is associated with chat group ID; When user exits chat group, server receives and moves back group records from car-mounted terminal, removes associating of corresponding user ID and chat group ID.
Based on the incidence relation of above-mentioned user ID and chat group ID, the user ID number that server real-time statistics is associated with chat group ID, obtains the online user number in corresponding chat group.
Described chat group ID and user ID are and uniquely do not repeat.
When chat group is cancelled, server removes associating of corresponding chat group ID and user ID.
Optionally, described method also comprises: server sets up record sheet based on monitoring record, safeguards and upgrade record sheet.Server carries out historical statistics or the cumulative statistics of user based on described record sheet.
The server of public chat system provided by the invention, comprising:
Information maintenance unit, for storing and safeguarding chat group information, described chat group information comprises chat group ID;
Group allocation unit, receives and responds the public chat request from car-mounted terminal, car-mounted terminal being dispensed to chat group, corresponding chat group ID is sent to described car-mounted terminal;
Monitoring unit, receives entering group, move back group records from car-mounted terminal;
Statistic unit, based on the monitoring record of monitoring unit, adds up the number of users of each chat group in described public chat system.
Wherein, described group allocation unit comprises: request process subelement, responds the public chat request from car-mounted terminal, select the chat group matched with car-mounted terminal; Distribute subelement, corresponding chat group ID is sent to the car-mounted terminal of initiating public chat request.
Described statistic unit comprises: association subelement, and car-mounted terminal ID associates or disassociation with chat group ID based on monitoring record by described association subelement; Statistics subelement, adds up the car-mounted terminal ID be associated with chat group ID, obtains the number of users in corresponding chat group.
Described association subelement carries out associating based on monitoring record or disassociation comprises: when receiving car-mounted terminal and entering group records, corresponding user ID be associated with chat group ID; When receiving car-mounted terminal and moving back group records, remove associating of corresponding user ID and chat group ID.A user ID is only associated with single chat group ID by described associative cell.Also comprise when chat group is cancelled, association subelement releasing corresponding chat group ID associates with user ID.
Optionally, described statistic unit also comprises record sheet subelement, sets up record sheet, and safeguard record sheet and upgrade based on the monitoring record received.
Compared with prior art, the invention has the beneficial effects as follows: chat group ID is dispensed to car-mounted terminal, monitor entering group and moving back group records of car-mounted terminal in real time, thus accurate statistics is carried out to the online user's quantity in chat group.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage become apparent more, are described in detail the specific embodiment of the present invention below in conjunction with accompanying drawing.
Set forth a lot of detail in the following description so that fully understand the present invention, but the present invention can also adopt other to be different from alternate manner described here to implement, therefore the present invention is not by the restriction of following public specific embodiment.
Fig. 3 shows the schematic flow sheet of user's statistical method of the public chat system based on car-mounted terminal of the present invention, and basic step comprises:
The chat group information that step S101, server are safeguarded is sent to public chat system, and described chat group information comprises chat group ID;
Concrete, the common feature that the user usually chatted according to chat theme or participation has, public chat system comprises diversified chat group.Public chat system is the above-mentioned chat group of difference, and need to each chat group setting label, therefore each chat group all has unique and unduplicated chat group ID.Described chat group information comprises above-mentioned chat group ID.Described chat group ID can be random or regular numeral or alphabetical sequence, and wherein regular numeral or alphabetical sequence can characterize type, the information such as chat group authority and settling time of this chat group.
Step S102, car-mounted terminal send public chat request to public chat system, and server response described request, is dispensed to chat group by car-mounted terminal, corresponding chat group ID is sent to described car-mounted terminal simultaneously;
Public chat system, in order to distinguish user, needs to set label to user, and therefore each car-mounted terminal all has unique and unduplicated user ID.Equally, described user ID can be according to user profile generate regular numeral or alphabetical sequence.And when user be random account or anonymous login time, server then distributes the user ID of random sequence to this user, but needs to ensure that the user ID of above-mentioned random sequence does not exist repetition.
After the public chat request of server response car-mounted terminal, according to the chat group that certain rules selection mates with car-mounted terminal, and car-mounted terminal is dispensed to this chat group, corresponding chat group ID is sent to described car-mounted terminal, so that car-mounted terminal confirms to add simultaneously.
Step S103, described car-mounted terminal by described public chat system group chat in the chat group corresponding to this chat group ID, the entering group, move back group records of described server monitoring car-mounted terminal;
Concrete, after car-mounted terminal confirms to add chat group, will public chat system group chat in the chat group corresponding to this chat group ID be passed through.Car-mounted terminal all when entering group or to move back group can send into group to server and move back group congruences, so that server monitoring.
Step S104, server, based on described monitoring record, add up the number of users of each chat group in described public chat system.
Concrete, server is receiving entering group and after moving back group records, all corresponding user ID and chat group ID being associated or disassociation, comprise of car-mounted terminal:
When car-mounted terminal enters chat group, corresponding user ID is associated with chat group ID by server;
Because same user can only participate in a chat group, therefore after user enters specific chat group, its user and this chat group just constitute mapping relations one by one, and a user ID only can associate with a chat group ID.But a chat group usually has multiple user and participates, and therefore above-mentioned mapping relations should be many-to-one mapping relations, a chat group ID can associate with multiple user ID.
When car-mounted terminal exits chat group, server removes associating of corresponding user ID and chat group ID.In addition, when chat group is cancelled, server also can remove associating of corresponding chat group ID and user ID, so that when car-mounted terminal enters other chat group again, its user ID is again associated with other chat group ID.
After the associating of chat group ID and user ID, server just based on above-mentioned related information, can carry out the real-time statistics of the number of users in chat group.Owing between user and chat group being many-to-one mapping relations, therefore by means of only the user ID that statistics chat group ID is associated, the number of users in this chat group just can be obtained.
In addition, server can also set up record sheet based on monitoring record, and safeguards record sheet and upgrade.Described record sheet have recorded in a period of time, car-mounted terminal enters group and moves back the information of group, and according to above-mentioned information, server can carry out cumulative statistics or the historical statistics of number of users.Such as add up the accumulative participating user of certain chat group or the online user number of a certain specific time period.
From above-mentioned user's statistical method, the present invention is by being dispensed to car-mounted terminal by chat group ID, the entering group and move back group records of real-time monitoring car-mounted terminal, and set up associating of chat group ID and user ID according to above-mentioned monitoring record, thus the online user number of chat group can be added up in real time accurately.
For realizing above-mentioned user's statistical method, present invention also offers a kind of server of public chat system.Fig. 4 shows the module diagram of the server of the public chat system based on car-mounted terminal of the present invention.The basic module of described statistical system comprises:
Information maintenance unit 101, for storing and safeguarding chat group information, described chat group information comprises chat group ID;
Group allocation unit 102, receives and responds the public chat request from car-mounted terminal, car-mounted terminal being dispensed to chat group, corresponding chat group ID is sent to described car-mounted terminal;
Concrete, described group allocation unit 102 comprises request process subelement, responds the public chat request from car-mounted terminal, selects the chat group matched with car-mounted terminal; Distribute subelement, corresponding chat group ID is sent to the car-mounted terminal of initiating public chat request.
Monitoring unit 103, receives entering group, move back group records from car-mounted terminal;
Statistic unit 104, based on the monitoring record of monitoring unit, adds up the number of users of each chat group in described public chat system.
Described statistic unit 104 comprises: association subelement, and car-mounted terminal ID associates or disassociation with chat group ID based on monitoring record by described association subelement; Specifically comprise: when receiving car-mounted terminal and entering group records, corresponding user ID is associated with chat group ID; When receiving car-mounted terminal and moving back group records, remove associating of corresponding user ID and chat group ID; When chat group is cancelled, association subelement releasing corresponding chat group ID associates with user ID.
Described statistic unit 104 also comprises record sheet subelement, sets up record sheet, and safeguard record sheet and upgrade based on the monitoring record received.
Statistics subelement 105, adds up the car-mounted terminal ID be associated with chat group ID, obtains the number of users in corresponding chat group.
Below in conjunction with specific embodiment, user's statistical method of public chat system of the present invention and statistical system are described in detail.In the present embodiment, with referring to car-mounted terminal per family.
Shown in composition graphs 3 and Fig. 4, first in public chat system, may comprise one or more chat group, each chat group has its feature, the region, place, chat theme etc. of such as participating user.Each chat group has its unique and unduplicated chat group ID, for mutual differentiation.Concrete, described chat group ID comprises Q-character and sequence number position, wherein Q-character is with the authority of characteristic letter or this chat group of digital representation or type, first bit digital of such as chat group ID represents the kinds of properties of chat group, 0 represents that this chat group is the interim chat group set up, and will automatically cancel if there is not user to participate in this chat group; Whether 1 represents that this chat group is permanent chat group, no matter have user to participate in all can not cancelling in chat group.In the information maintenance unit 101 of server, for storing and safeguarding the information of each chat group, namely described chat group information comprise above-mentioned chat group ID.
When there being user to initiate public chat request to public chat system, group allocation unit 102, receive and respond described public chat request, concrete, its request process subelement, the chat group matched according to certain rules selection and user, such as this user wishes to add the chat group inquiring into transport information, described request process subelement just chooses the chat group relevant to transport information from public chat system, user is dispensed to this chat group; And distribute subelement, then the chat group information stored in recalls information maintenance unit 101, corresponding chat group ID is sent to the user initiating public chat request, so that its confirmation adds.
In addition public chat system is in order to distinguish user, and usual described user has its unique and unduplicated user ID.Identical with chat group ID, described user ID also can comprise Q-character and sequence number position, wherein Q-character is equally with numeral or alphabetical characterizing user information, such as: first letter representation login user type of user ID, A represents that this user is anonymous login user, and B represents that this user is for registration login user.
After user receives chat group ID, confirm to add chat group, just can by described public chat system group chat in the chat group corresponding to this chat group ID.User, when entering chat group, will send into group records to server.Equally, user, when exiting chat group, also can send and move back group records to server.The monitoring unit 103 of server, then receive the above-mentioned group of entering and move back group records.
The statistic unit 104 be connected with monitoring unit 103, just can carry out the statistics of user based on above-mentioned monitoring record.
Concrete, in the present embodiment, after user enters chat group, the association subelement in statistic unit 104, is associated corresponding user ID with chat group ID; Otherwise when user exits chat group, or when chat group is cancelled, association subelement then removes corresponding user ID and associating between chat group ID.
Statistics subelement, according to above-mentioned related information, is added up the user in chat group.Such as, add up the user ID associated by a certain particular chat group ID, obtain the now interior online user number participating in chat of corresponding chat group.Just the real-time statistics of online user can be realized.
Although the present invention discloses as above with preferred embodiment, the present invention is not defined in this.Any those skilled in the art, without departing from the spirit and scope of the present invention, all can make various changes or modifications, and therefore protection scope of the present invention should be as the criterion with claim limited range.