CN104010069B - A kind of method of real-time matching communication terminal and server - Google Patents

A kind of method of real-time matching communication terminal and server Download PDF

Info

Publication number
CN104010069B
CN104010069B CN201310059734.2A CN201310059734A CN104010069B CN 104010069 B CN104010069 B CN 104010069B CN 201310059734 A CN201310059734 A CN 201310059734A CN 104010069 B CN104010069 B CN 104010069B
Authority
CN
China
Prior art keywords
time
terminal
request
server
matching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310059734.2A
Other languages
Chinese (zh)
Other versions
CN104010069A (en
Inventor
宋晓锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
BEIJING KAIXINREN INFORMATION TECHNOLOGY Co Ltd
Original Assignee
BEIJING KAIXINREN INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by BEIJING KAIXINREN INFORMATION TECHNOLOGY Co Ltd filed Critical BEIJING KAIXINREN INFORMATION TECHNOLOGY Co Ltd
Priority to CN201310059734.2A priority Critical patent/CN104010069B/en
Publication of CN104010069A publication Critical patent/CN104010069A/en
Application granted granted Critical
Publication of CN104010069B publication Critical patent/CN104010069B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a kind of method and server of real-time matching communication terminal, by obtaining in advance each terminal network time delay of mating, obtain the matching request information of each terminal and record the system time that gets this information, according to system time and network-induced delay, calculate respectively the time that each terminal request is sent, each terminal is mated according to this request time of sending. Thereby the time reduction of coupling both sides collision is normalized at the same time and mated on axle, make between the friend of acquaintance, the mode that can collide by mobile phone is face-to-face sent matching request information simultaneously, thereby matches accurately the other side rapidly.

Description

A kind of method of real-time matching communication terminal and server
Technical field
The present invention relates to moving communicating field, particularly a kind of method of real-time matching communication terminal and server.
Background technology
Along with the development of mobile Internet and popularizing of smart mobile phone, the value-added service type of mobile Internet is more and more polynaryChange. Micro-letter of company of Tengxun exploitation, is to utilize network to send fast voice SMS, video, picture and word, and support is manyThe mobile phone chats software of people's group chat. What user can be undertaken more enriching by micro-letter and good friend in form is similar to note, coloured silkThe contact of the modes such as letter.
" shaking " function in micro-letter, the random application of making friends that micro-letter is released, by the machine of shaking the hand or button click mouldPlan is shaken, and can match the same period to trigger micro-credit household of this function, thereby it is sticky to increase interaction and micro-letter between userDegree. But in view of the location of " shaking " function is random friend-making, between stranger mutually understanding, thereby its time andMatching range on space is very large, also can match even if differ the several seconds, on the contrary, because its matching range is large and randomProperty, even if two people's machines of shaking the hand face-to-face are but difficult to match simultaneously, its objective is in order to provide more chance to go to userMeet stranger by chance, very low to the degree of accuracy and success rate requirement, there is very large randomness.
But, when the people of two understanding wishes by thisly rocking mobile phone, beats mobile phone or collision mobile phone mates rapidly the other sideTime, the success rate of prior art is just very low.
Summary of the invention
Main purpose of the present invention is to solve in prior art aspectant exchanges data problem between friend, provides a kind of realTime mate method and the server of communication terminal, calculate that by system time the time that matching request occurs mates, largeImprove greatly the accuracy of mating in prior art.
The object of the invention is to be achieved by following technical proposals:
A method for real-time matching communication terminal, comprises the following steps:
Obtain in advance network-induced delay the record of each terminal of mating;
Obtain the matching request information of first terminal, and record gets the system time of the matching request information of this first terminalServer_time_1;
According to the network-induced delay of this system time Server_time_1 and this first terminal of obtaining in advanceOffset_time_1 calculates the first request time Ask_time_1;
The matching request information of obtaining the second terminal also records the system time of the matching request information that gets this second terminal Server_time_2;
According to the network-induced delay of described system time Server_time_2 and described the second terminal of obtaining in advanceOffset_time_2 calculates the second request time Ask_time_2 of this second terminal;
Judge the absolute value of described the second request time and described the first request time difference | Ask_time_2-Ask_time_1|Whether be greater than predetermined threshold value, if not, mate described first terminal and the second terminal, if so, notify described first terminalIt fails to match with the second terminal.
The present invention provides a kind of server of real-time matching communication terminal in addition, comprises with lower unit:
Time delay acquiring unit, for obtaining in advance network-induced delay the record of each terminal of mating;
The first solicited message acquiring unit, for obtaining the matching request information of first terminal, and record gets this first endThe system time Server_time_1 of the matching request information of end;
The first request time computing unit, for according to this system time Server_time_1 and obtain in advance this first eventuallyThe network-induced delay Offset_time_1 of end calculates the first request time Ask_time_1;
The second solicited message acquiring unit, gets this second terminal for the matching request information the record that obtain the second terminalThe system time Server_time_2 of matching request information;
The second request time computing unit, for according to described system time Server_time_2 and obtain in advance this secondThe network-induced delay Offset_time_2 of terminal calculates the second request time Ask_time_2;
Matching unit, for judging the absolute value of described the second request time and described the first request time difference| whether Ask_time_2-Ask_time_1| is greater than predetermined threshold value, if not, mates described first terminal and the second terminal,If so, it fails to match to notify described first terminal and the second terminal.
By the embodiment of the present invention, between the friend of acquaintance, it is right that the mode that can collide by mobile phone face-to-face matches rapidlyJust, made up the blank of prior art.
Brief description of the drawings
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms the application's a part, does not formLimitation of the invention. In the accompanying drawings:
Fig. 1 is a kind of flow chart of method of real-time matching communication terminal;
Fig. 2 is the embodiment of the present invention one, a kind of flow chart of method of real-time matching communication terminal;
Fig. 3 obtains the each terminal network method schematic diagram of time delay in advance;
Fig. 4 is the embodiment of the present invention two, a kind of flow chart of method of real-time matching communication terminal;
Fig. 5 is according to the flow chart of the method in region, GPS data separation reflexless terminal;
Fig. 6 is the flow chart of distinguishing the method in region, reflexless terminal according to IP address information.
Fig. 7 is the embodiment of the present invention three, a kind of structure chart of server of real-time matching communication terminal;
Fig. 8 is the embodiment of the present invention four, a kind of structure chart of server of real-time matching communication terminal;
Fig. 9 is the structure chart that mates subelement in embodiment tetra-;
Figure 10 is the structure chart that mates subelement in embodiment tetra-.
Detailed description of the invention
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with embodiment and accompanying drawing, to thisInvention is described in further details. At this, exemplary embodiment of the present invention and explanation thereof are used for explaining the present invention, but alsoNot as a limitation of the invention.
For existing problem in aforementioned prior art, the present invention, by calculating sending the time of mobile phone matched signal, realizesExact matching, thereby realized aspectant two people by mobile phone collide, matching request is while sending simultaneously, can be rapidMatch. As shown in Figure 1, comprising:
Step 101, obtains network-induced delay the record of each terminal of mating in advance;
Step 102, obtains the matching request information of first terminal, and records the matching request information that gets this first terminalSystem time Server_time_1;
Step 103, according to the network-induced delay of this system time Server_time_1 and this first terminal of obtaining in advanceOffset_time_1 calculates the first request time Ask_time_1;
Step 104, obtains the matching request information of the second terminal record and gets the matching request information of this second terminalSystem time Server_time_2;
Step 105, according to the network delay of described system time Server_time_2 and described the second terminal of obtaining in advanceTime Offset_time_2 calculates the second request time Ask_time_2 of this second terminal;
Step 106, judges the absolute value of described the second request time and described the first request time difference| whether Ask_time_2-Ask_time_1| is greater than predetermined threshold value, if not, mates described first terminal and the second terminal,If so, it fails to match to notify described first terminal and the second terminal.
In step 104, from described system time Server_time_1, in window time tw, obtain second eventuallyThe matching request information of end, wherein, the maximum in the time delay that this window time tw is system log (SYSLOG)Value: tw=MAX[Offset_time];
If do not get the matching request information of the second terminal in described window time tw, notify first terminal coupling to loseLose, again obtain the solicited message of first terminal.
If get the solicited message of N terminal in described window time tw simultaneously, record gets this N respectivelyThe system time of terminal; According to the network-induced delay of the system time of this N terminal and this N terminal of getting in advanceCalculate respectively the request time Ask_time_x of this N terminal; Relatively request time and the first terminal of this N terminal one by oneThe absolute value of request time difference | whether Ask_time_x-Ask_time_1| is greater than predetermined threshold value; If not, judging shouldTerminal meets time match condition; Mate described first terminal and the terminal that meets time match condition; If this N terminalThe difference of request time and the first request time is all greater than predetermined threshold value, and it fails to match to notify first terminal, and again obtainThe solicited message of first terminal.
Wherein, before mating first terminal and meeting the terminal of time match condition, also comprise: obtain and meet time match barThe GPS information of the terminal of part and the GPS information of first terminal; According to the GPS letter of the described terminal that meets time match conditionBreath and the GPS information of first terminal, by with described first terminal not at terminal end of the time match condition that meets of the same areaOnly coupling.
The network-induced delay that obtains in advance each terminal of mating described in step 101 is specially, and described each terminal is to clothesBusiness device carries out poll, records initial time t_start and the termination time t_end of the each poll of described each terminal, and shouldInitial time and termination time send to server in the time of upper once poll;
The computational methods of network-induced delay Offset_time are:
Offset_time={ ∑ [(t_end-t_start)/2] }/n, wherein n is initial time and the termination that server is recordedThe number of time.
In above-mentioned steps, the method for computation requests time is: Ask_time=Server_time-Offset_time. Wherein,Ask_time is request time; Server_time is system time; Offset_time is time delay.
For example:
User terminal A starts poll from local zone time 12:00:00:00, and server receives the system time of polling messageFor 12:00:00:58, be 12:00:01:00 and user terminal A receives the time of server return information, like this, thisJust be (12:00:01:00-12:00:00:00)/2=00:00:00:30 the time delay of inferior poll, calculates n pollTime delay, then average.
Describe below by specific embodiment:
Embodiment mono-
As shown in Figure 2, be the flow chart of the method for a kind of real-time matching communication terminal of the present embodiment.
Hand over the application scenarios of the present embodiment at this:
The first and second two users hold respectively mobile terminal A and B, wish to mate rapidly the other side by this programme. Realize this programmeWhole process time very short, thereby two users can not move on a large scale in this process, that is, residing networkEnvironment is constant.
Concrete, A can collide with B together with mobile terminal separately, and like this, two terminals just can be sent coupling simultaneouslySolicited message.
Step 201 obtains network-induced delay the record of A and B in advance.
First, the first and second two people will open " real-time matching " application in mobile terminal A and B. After opening, two endsEnd start with server ask to carry out poll by Http, this poll until " real-time matching " generation just finish. Same therewithTime, the gravity sensor of client device starts the crash-active of monitor user '.
For saving the communication resource, in clients poll process, only send heartbeat data packets to server, when terminal gets clothesWhen servertime that business device returns, can calculate this poll according to the time and the servertime that send heartbeat data packetsNetwork-induced delay.
After end of polling(EOP), system can, according to the network-induced delay calculating mean value obtaining at every turn, be carried out record by this mean value,The network-induced delay Off_time obtaining in advance as system, carries out subsequent calculations.
As shown in Figure 3, be the schematic diagram of client and server interaction, as shown in the figure, vertical direction is time shaft, eachIndividual triangle represents the once request of client and server and replys. Schematic diagram from InitailingState state,Until mating, both sides confirm successfully. Each request and response are polls, in each poll, do not transmit large data,Very little heartbeat data, each polling server to the system time of major general's server (servertime, unit is second,Value, for the floating number of double type, is accurate at most 2 significant digits) take back, if server has new data to needPass a client, along being taken back.
Bump_time is the collision moment, this is a key parameter of server coupling, and server need to be known two sending outBump_time, as figure shows:
Bump_time=t_server–Offset_time
But server does not also know Offset_time is how many, therefore server needs to pass and to come according to poll aboveMaxoffset and minoffset remove to estimate Offset_time.
The estimation of this parameter, very large to the influential effect of coupling, accurately as much as possible must be estimated to real value, necessaryRemain on certain precision inherent this, following three schemes are provided:
Scheme one: use the value of the maxoffset of server the last time to be Offset_time.
Scheme two: use the mean value of maxoffset,
Offset_time=1/n*(maxoffset1+maxoffset2+…+maxoffsetN)。
Scheme three: the evaluation method on probability of use, as maximal possibility estimation.
Wherein, the accuracy of scheme one is minimum, and the maximal possibility estimation in scheme three needs server that a large amount of poll numbers is providedAccording to. Thereby the present embodiment is preferred, take the estimation algorithm method of scheme two as this programme.
For example:
Mobile terminal A starts poll from local zone time 12:00:00:00, and server receives the system time of polling messageFor 12:00:00:58, be 12:00:01:00 and user terminal A receives the time of server return information, like this, thisJust be (12:00:01:00-12:00:00:00)/2=00:00:00:30 the time delay of inferior poll, calculates n pollTime delay, then average. Be 28 milliseconds the time delay of the mobile terminal A calculating, in like manner calculatesTime delay of mobile terminal B be 30 milliseconds.
Step 202, obtains the matching request information of A, and records the system time that gets this solicited messageServer_time_A。
Wherein, due to network-induced delay difference, the time of user A and B matching request arrival server can be definitely not identical,The terminal that solicited message is first arrived to server is as first terminal.
In the present embodiment, suppose first to receive the matching request information of A.
After gravity sensor detects the crash-active of equipment, triggering terminal sends matching request letter to server immediatelyBreath, because this request is by the action triggers of collision, thereby theoretically, two terminals are sent the time of requestIt is the same time. These are different from the trigger action of " shaking " in micro-letter, and it is " same that " shaking " cannot realize coupling both sidesOne time " send match information, thereby also cannot realize aspectant coupling.
Step 203, according to Server_time_A and the network-induced delay Offset_time_A of the A obtaining in advance calculateThe request time Ask_time_A of A.
The method of computation requests time is: Ask_time=Server_time-Offset_time.
According to the method, Ask_time_A=Server_time_A-Offset_time_A.
Because two residing network environments of terminal are identical, from poll, until collision end, all in identical network ringsBorder, thereby the request time calculating by said method approaches actual collision time of origin very much.
While supposing that the first and second two people collide mobile terminal A and B, the local zone time of mobile terminal A is 12:00:10:00,The system time that server receives the matching request of A is 12:00:10:58, and the request time calculating is:
Ask_time_A=12:00:10:58-00:00:00:28=12:00:10:30。
Step 204, the solicited message that receives A starts, and obtains matching request information the record of B in window time twSystem time Server_time_B.
Wherein, the A that this window time tw is system log (SYSLOG) and larger value in the time delay of B:tw=MAX[Offset_time]。
Suppose that A and B collide at one time, server is first received the collision information of A, but because network speed is inconsistent,In more late a period of time of collision information of possible B, just can come, A waits for coming of B at least will to chance of B so,The long window time tw that is of time of this wait.
The size of tw at least should be greater than the network delay maxoffset_b of B, but server do not know whose be usedMaxoffset, so in order to ensure have a chance to carry out and other people coupling to all people, server can use works asFront known maximum maxoffset, that is: tw=MAX[Offset_time].
Here, the value of tw is specially 30 milliseconds.
Step 205, the request time of calculating B.
Ask_time_B=Server_time_B-Offset_time_B;
Suppose that server receives that the system time of the solicited message of B is 12:00:10:59, calculates the request time of BFor: Ask_time_B=12:00:10:59-00:00:00:30=12:00:10:29.
Step 206, the relatively absolute value of A and B request time difference | it is default whether Ask_time_B-Ask_time_A| is greater thanThreshold value, if not, mates A and B, and it fails to match if so, to notify A and B.
In the present embodiment, | the value of Ask_time_B-Ask_time_A| is 1 millisecond.
Predetermined threshold value is according to the predefined value of the result of test of many times, is generally not more than tw, no longer than 50 milliseconds,0.5 second. The present embodiment is preferred, is less than minimum network delay value, specific to the present embodiment, is less than exactly 28 milliseconds.
For example, predetermined threshold value is 20 milliseconds, and clearly, 1 millisecond is less than 20 milliseconds, coupling A and B.
Embodiment bis-
As shown in Figure 4, be the flow chart of the method for a kind of real-time matching communication terminal of the present embodiment.
Suppose, in the time that A and B collide, to also have C, D, E, tetra-users of F, also will collide, samePeriod has been opened matching feature, and wherein, A and B, C and D are in Haidian District, Beijing City, and E and F are in Xi'an City, Shanxi Province.
Step 401, obtains network-induced delay the record of A, B, C, D, E, F in advance;
Within the same period, system can get the poll of A, B, C, D, E, six users' of F terminal, and collision occursTime, calculate respectively network-induced delay corresponding to each terminal.
Step 402, obtains the matching request information of first terminal, and records the matching request information that gets this first terminalSystem time Server_time_1;
Here, the terminal of supposing party A-subscriber is first terminal, that is, system is subject to the matching request letter that party A-subscriber sends at firstBreath.
Step 403, according to the network-induced delay of this system time Server_time_1 and this first terminal of obtaining in advanceOffset_time_1 calculates the first request time Ask_time_1;
Step 404 from this system time Server_time_1, is obtained N-1 terminal of residue in window time twMatching request information record get the system time Server_time_x of this solicited message;
In the present embodiment, N is 6,, within the window time, gets altogether the matching request information of 5 terminals.
Wherein, tw is the maximum in end delay time of A, B, C, D, E, six users of F.
In the present embodiment, N is 6, suppose topic establish residue 5 users solicited message plenary session appear within the window time,Get altogether the matching request information of 5 terminals.
Certainly, also have other user G, H, I etc., solicited message there will not be in the window time of A tw.
Step 405, divides according to the network-induced delay of the system time of these 5 terminals and these 5 terminals of getting in advanceDo not calculate the request time Ask_time_x of these 5 terminals;
Step 406, the one by one absolute value of the request time difference of the request time of these 5 terminals and first terminal relatively| whether Ask_time_x-Ask_time_1| is greater than predetermined threshold value;
The present invention is preferred, and predetermined threshold value is set as to 0.2 second. Certainly can also be shorter, no longer than 0.5 second.
Suppose that the request time of C and D and the request time absolute difference of A are greater than 0.5 second, exceed predetermined threshold value:
Step 407, coupling A and B, E, F.
If the request time difference of B, C, D, E, six user's request times of F and A is all greater than 0.5 second, not at default thresholdIn value, it fails to match to notify first terminal A.
Again receive the matching request information of first end.
As shown in Figure 5, before above-mentioned steps 407, also comprise:
Step 501, obtains the GPS information of the terminal that meets time match condition and the GPS information of first terminal;
That is, obtain the GPS information of B, C, D, E, six user's requests of F, and the party A-subscriber's who obtains in advance GPS comparison,Find that E and F and A be not in a geographic area, thereby, in step 407, only need to mate A and B.
Step 502, according to the GPS information of the GPS information of the described terminal that meets time match condition and first terminal, willDo not stop mating in the terminal of the time match condition that meets of the same area with described first terminal.
Or, as shown in Figure 6,
Step 601, obtains the IP address information of the terminal that meets time match condition and the IP address information of first terminal;
Step 602, does not stop the IP address of IP address and first terminal to mate at a regional terminal.
By above-described embodiment, the present invention can make aspectant two people or multiple people's mobile terminal with the side of collisionFormula, realizes rapid coupling each other.
Embodiment tri-
As shown in Figure 7, be the present embodiment three, a kind of structure chart of server of real-time matching communication terminal.
Comprise:
Time delay acquiring unit 701, for obtaining in advance network-induced delay the record of each terminal of mating;
This, acquiring unit comprised time delay:
Poll subelement 7011, for receiving the polling data bag of described each terminal, this packet comprises described each terminal noteInitial time t_start and the termination time t_end of the last poll of record;
Network-induced delay computation subunit 7012, for computing network Offset_time time delay:
Offset_time={ ∑ [(t_end-t_start)/2] }/n, wherein n is initial time and the termination that server is recordedThe number of time.
The first solicited message acquiring unit 702, for obtaining the matching request information of first terminal, and record get thisThe system time Server_time_1 of the matching request information of one terminal;
The first request time computing unit 703, for according to this system time Server_time_1 and obtain in advance thisThe network-induced delay Offset_time_1 of one terminal calculates the first request time Ask_time_1;
The window time is obtained subelement 704, for the maximum of time delay of obtaining system log (SYSLOG) as the window time:tw=MAX[Offset_time]。
The second solicited message acquiring unit 705, for obtain the second terminal matching request information and record get this secondThe system time Server_time_2 of the matching request information of terminal;
This second solicited message acquiring unit 705 comprises:
The second solicited message is obtained subelement 7051, for from described system time Server_time_1, in the time of windowBetween obtain the matching request information of the second terminal in tw;
Initialize subelement 7052, in the time not getting the matching request information of the second terminal in described window time tw,It fails to match for notice first terminal, and again obtain the solicited message of first terminal.
The second request time computing unit 706, for according to described system time Server_time_2 and obtain in advance shouldThe network-induced delay Offset_time_2 of the second terminal calculates the second request time Ask_time_2;
Matching unit 707, for judging the absolute value of described the second request time and described the first request time difference| whether Ask_time_2-Ask_time_1| is greater than predetermined threshold value, if not, mates described first terminal and the second terminal,If so, it fails to match to notify described first terminal and the second terminal.
In above-mentioned 703 and 706, for the method for computation requests time be:Ask_time=Server_time-Offset_time。
Wherein, Ask_time is request time; Server_time is system time; Offset_time is time delay
Embodiment tetra-
As shown in Figure 8, be the structure chart of the server of a kind of real-time matching communication terminal of the present embodiment.
Time delay acquiring unit 801, for obtaining in advance network-induced delay the record of each terminal of mating;
The first solicited message acquiring unit 802, for obtaining the matching request information of first terminal, and record get thisThe system time Server_time_1 of the matching request information of one terminal;
The first request time computing unit 803, for according to this system time Server_time_1 and obtain in advance thisThe network-induced delay Offset_time_1 of one terminal calculates the first request time Ask_time_1;
The window time is obtained subelement 804, for the maximum of time delay of obtaining system log (SYSLOG) as the window time:tw=MAX[Offset_time]。
System time obtains subelement 805, for get the solicited message of N terminal in described window time tw simultaneouslyTime, record gets the system time of this N terminal respectively;
Request time computation subunit 806, for according to the system time of this N terminal and get in advance this N eventuallyThe network-induced delay of end calculates respectively the request time Ask_time_x of this N terminal, 1 < x < N;
Matching judgment subelement 807, for relatively the request time of this N terminal and the request time of first terminal are poor one by oneThe absolute value of value | whether Ask_time_x-Ask_time_1| is greater than predetermined threshold value;
Coupling subelement 808, in the time that described absolute value is not more than described predetermined threshold value, judges that this terminal meets the timeJoin condition, and mate described first terminal and the terminal that meets time match condition;
In specific implementation process, if search is less than GPS information, can also come judging area according to the IP of terminal.
Initialize subelement 809, be all greater than default for working as the request time of this N terminal and the difference of the first request timeWhen threshold value, it fails to match for notice first terminal, and again obtain the solicited message of first terminal.
As shown in Figure 9, in above-mentioned coupling subelement 808, also comprise:
GPS information acquisition unit 901, for obtaining the GPS information of the terminal that meets time match condition and first terminalGPS information;
Location matches unit 902, for meeting the GPS information of terminal of time match condition and first terminal described in basisGPS information, will not stop mating in the terminal of the time match condition that meets of the same area with described first terminal.
Or, as shown in figure 10,
IP address information acquiring unit 1001, for obtaining the IP address information and first of the terminal that meets time match conditionThe IP address information of terminal;
Location matches unit 1002, for not stopping the IP address of IP address and first terminal at a regional terminalJoin.
By above-described embodiment, the present invention can make aspectant two people or multiple people's mobile terminal with the side of collisionFormula, realizes rapid coupling each other.
Persons skilled in the art any not creative transformation of doing under this design philosophy, all should be considered as at thisWithin the protection domain of invention.

Claims (14)

1. a method for real-time matching communication terminal, is characterized in that, comprises the following steps:
Obtain in advance network-induced delay the record of each terminal of mating;
Obtain the matching request information of first terminal, and record gets the system time of the matching request information of this first terminalServer_time_1;
According to the network-induced delay of this system time Server_time_1 and this first terminal of obtaining in advanceOffset_time_1 calculates the first request time Ask_time_1;
The matching request information of obtaining the second terminal also records the system time of the matching request information that gets this second terminalServer_time_2;
According to the network-induced delay of described system time Server_time_2 and this second terminal of obtaining in advanceOffset_time_2 calculates the second request time Ask_time_2;
Judge the absolute value of described the second request time and described the first request time difference | Ask_time_2-Ask_time_1|Whether be greater than predetermined threshold value, if not, mate described first terminal and the second terminal, if so, notify described first terminalIt fails to match with the second terminal.
2. the method for real-time matching communication terminal as claimed in claim 1, is characterized in that, described in obtain the second terminalMatching request information is specially:
From described system time Server_time_1, in window time tw, obtain the matching request letter of the second terminalBreath, wherein, the network-induced delay Offset_time_1 and second of the first terminal that this window time tw is system log (SYSLOG)Maximum in the network-induced delay Offset_time_2 of terminal, tw=Offset_time=MAX[Offset_time_1,Offset_time_2];
If do not get the matching request information of the second terminal in described window time tw, notify first terminal coupling to loseLose, again obtain the solicited message of first terminal.
3. the method for real-time matching communication terminal as claimed in claim 2, is characterized in that:
If get the solicited message of N terminal in described window time tw simultaneously, record gets this N respectivelyThe system time of terminal;
Calculate respectively this N according to the network-induced delay of the system time of this N terminal and this N terminal of getting in advanceThe request time Ask_time_x of individual terminal;
The absolute value of the request time of this N terminal and the request time difference of first terminal relatively one by one| whether Ask_time_x-Ask_time_1| is greater than predetermined threshold value;
If not, judge that this terminal meets time match condition; Mate described first terminal and the end that meets time match conditionEnd;
If the request time of this N terminal and the difference of the first request time are all greater than predetermined threshold value, notify first terminalJoin unsuccessfully, and again obtain the solicited message of first terminal.
4. the method for real-time matching communication terminal as claimed in claim 3, is characterized in that, described coupling described first eventuallyEnd and meet the terminal of time match condition before, also comprise:
Obtain the GPS information of the terminal that meets time match condition and the GPS information of first terminal;
According to the GPS information of the GPS information of the described terminal that meets time match condition and first terminal, will be with described firstTerminal does not stop coupling in the terminal of the time match condition that meets of the same area.
5. the method for real-time matching communication terminal as claimed in claim 3, is characterized in that, described coupling described first eventuallyEnd and meet the terminal of time match condition before, also comprise:
Obtain the IP address information of the terminal that meets time match condition and the IP address information of first terminal;
The IP address of IP address and first terminal is not stopped mating at a regional terminal.
6. the method for real-time matching communication terminal as claimed in claim 1, is characterized in that, described obtaining in advance carried outThe network-induced delay of each terminal of joining is specially:
Described each terminal is carried out poll to server, records initial time t_start and the termination of the each poll of described each terminalTime t_end, and this initial time and termination time are sent to server when the upper once poll;
The computational methods of network-induced delay Offset_time are:
Offset_time={ ∑ [(t_end-t_start)/2] }/n, the wrap count that wherein n is terminal.
7. the method for real-time matching communication terminal as claimed in claim 1, is characterized in that the method for computation requests timeFor: Ask_time=Server_time-Offset_time;
Wherein, Ask_time is request time; Server_time is system time; Offset_time is time delay.
8. a server for real-time matching communication terminal, is characterized in that, comprises with lower unit:
Time delay acquiring unit, for obtaining in advance network-induced delay the record of each terminal of mating;
The first solicited message acquiring unit, for obtaining the matching request information of first terminal, and record gets this first endThe system time Server_time_1 of the matching request information of end;
The first request time computing unit, for according to this system time Server_time_1 and obtain in advance this first eventuallyThe network-induced delay Offset_time_1 of end calculates the first request time Ask_time_1;
The second solicited message acquiring unit, gets this second terminal for the matching request information the record that obtain the second terminalThe system time Server_time_2 of matching request information;
The second request time computing unit, for according to described system time Server_time_2 and obtain in advance this secondThe network-induced delay Offset_time_2 of terminal calculates the second request time Ask_time_2;
Matching unit, for judging the absolute value of described the second request time and described the first request time difference| whether Ask_time_2-Ask_time_1| is greater than predetermined threshold value, if not, mates described first terminal and the second terminal,If so, it fails to match to notify described first terminal and the second terminal.
9. the server of real-time matching communication terminal as claimed in claim 8, is characterized in that:
Also comprise: the window time is obtained subelement, for obtaining the network-induced delay of first terminal of system log (SYSLOG)Maximum in the network-induced delay Offset_time_2 of Offset_time_1 and the second terminal is as window time tw,tw=Offset_time=MAX[Offset_time_1,Offset_time_2];
Described the second solicited message acquiring unit comprises:
The second solicited message is obtained subelement, for from described system time Server_time_1, at window time twInside obtain the matching request information of the second terminal;
Initialize subelement, in the time not getting the matching request information of the second terminal in described window time tw, logicalIt fails to match to know first terminal, and again obtain the solicited message of first terminal.
10. the server of real-time matching communication terminal as claimed in claim 9, is characterized in that, also comprises:
System time obtains subelement, for get the solicited message of N terminal in described window time tw time simultaneously,Record gets the system time of this N terminal respectively;
Request time computation subunit, for according to the system time of this N terminal and this N terminal of getting in advanceNetwork-induced delay calculates respectively the request time Ask_time_x of this N terminal, 1 < x < N;
Matching judgment subelement, for the relatively request time of this N terminal and the request time difference of first terminal one by oneAbsolute value | whether Ask_time_x-Ask_time_1| is greater than predetermined threshold value;
Coupling subelement, in the time that described absolute value is not more than described predetermined threshold value, judges that this terminal meets time match barPart, and mate described first terminal and the terminal that meets time match condition;
Initialize subelement, be all greater than predetermined threshold value for working as the request time of this N terminal and the difference of the first request timeTime, it fails to match for notice first terminal, and again obtain the solicited message of first terminal.
11. servers of real-time matching communication terminal as claimed in claim 10, is characterized in that, also comprise:
GPS information acquisition unit, for obtaining the GPS information of the terminal that meets time match condition and the GPS of first terminalInformation;
Location matches unit, for meeting the GPS information of terminal of time match condition and the GPS of first terminal described in basisInformation, will not stop mating in the terminal of the time match condition that meets of the same area with described first terminal.
12. servers of real-time matching communication terminal as claimed in claim 10, is characterized in that, also comprise:
IP address information acquiring unit, for obtaining IP address information and the first terminal of the terminal that meets time match conditionIP address information;
Location matches unit, for not stopping the IP address of IP address and first terminal to mate at a regional terminal.
13. servers of real-time matching communication terminal as claimed in claim 8, is characterized in that, obtain described time delayUnit comprises:
Poll subelement, for receiving the polling data bag of described each terminal, this packet comprises what described each terminal recordedInitial time t_start and the termination time t_end of last poll;
Network-induced delay computation subunit, for computing network Offset_time time delay:
Offset_time={ ∑ [(t_end-t_start)/2] }/n, the wrap count that wherein n is terminal.
14. servers of real-time matching communication terminal as claimed in claim 8, is characterized in that described the first request timeIn computing unit and the second request time computing unit, for the method for computation requests time be:Ask_time=Server_time-Offset_time;
Wherein, Ask_time is request time; Server_time is system time; Offset_time is time delay.
CN201310059734.2A 2013-02-26 2013-02-26 A kind of method of real-time matching communication terminal and server Active CN104010069B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310059734.2A CN104010069B (en) 2013-02-26 2013-02-26 A kind of method of real-time matching communication terminal and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310059734.2A CN104010069B (en) 2013-02-26 2013-02-26 A kind of method of real-time matching communication terminal and server

Publications (2)

Publication Number Publication Date
CN104010069A CN104010069A (en) 2014-08-27
CN104010069B true CN104010069B (en) 2016-05-25

Family

ID=51370560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310059734.2A Active CN104010069B (en) 2013-02-26 2013-02-26 A kind of method of real-time matching communication terminal and server

Country Status (1)

Country Link
CN (1) CN104010069B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302610A (en) * 2015-06-08 2017-01-04 博雅网络游戏开发(深圳)有限公司 User interaction method based on geographical position and device
CN107800612B (en) * 2017-07-24 2020-09-22 深圳壹账通智能科技有限公司 User matching method and device, storage medium and computer equipment
CN109857927A (en) * 2018-12-24 2019-06-07 深圳市珍爱捷云信息技术有限公司 User's recommended method, device, computer equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1583294A2 (en) * 2004-03-31 2005-10-05 Fujitsu Limited Paying transaction in a peer-to-peer radio communication
CN102427378A (en) * 2011-07-29 2012-04-25 上海合合信息科技发展有限公司 Data transmission method using bluetooth technology and acceleration sensing technology and system thereof
CN102710858A (en) * 2012-05-24 2012-10-03 上海合合信息科技发展有限公司 Pairing method and system between mobile devices

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1583294A2 (en) * 2004-03-31 2005-10-05 Fujitsu Limited Paying transaction in a peer-to-peer radio communication
CN102427378A (en) * 2011-07-29 2012-04-25 上海合合信息科技发展有限公司 Data transmission method using bluetooth technology and acceleration sensing technology and system thereof
CN102710858A (en) * 2012-05-24 2012-10-03 上海合合信息科技发展有限公司 Pairing method and system between mobile devices

Also Published As

Publication number Publication date
CN104010069A (en) 2014-08-27

Similar Documents

Publication Publication Date Title
US20170041254A1 (en) Contextual content sharing using conversation medium
US5943478A (en) System for immediate popup messaging across the internet
KR101979535B1 (en) Voice chat mode self adaptation method and device
CN109962833A (en) The creation method and device of session on instant communication client
KR20140059824A (en) Method and device for prompting dynamic information about contact person
CN104010069B (en) A kind of method of real-time matching communication terminal and server
CN111277483B (en) Multi-terminal message synchronization method, server and storage medium
WO2010037327A1 (en) Notifying method and equipment for e-mail arrival
CN104980899B (en) Communication means, system, mobile terminal and the server of mobile terminal
CN106789566A (en) Different IM application messages sharing methods and system based on mobile phone operating system
CN104935496B (en) Instant communicating method, system, device and instant communication terminal
CN108965359B (en) Communication method, communication device, readable medium, and electronic apparatus
CN105577504A (en) Method and device for establishing communication channels
KR100702704B1 (en) Notification System and Method Using Messenger
CN106961377A (en) Message synchronization method and message synchronization system
CN101247363A (en) Method, client terminal and system for implementing instant communication message reminding
CN111600808A (en) Information processing method and device for instant messaging
CN102025730B (en) Data transmission device based on HTTP protocol and implementation method thereof
CN110224924A (en) State updating method and device, storage medium and electronic device
WO2014172921A1 (en) Method, im client and cloud server for saving chat record
US7487220B1 (en) Delivering instant messages to the intended user
US20120197969A1 (en) Methods and systems for managing chat-room communications
WO2019023972A1 (en) Multi-terminal message synchronization method and system, server and computer processing device
CN110198264B (en) Processing method and device and electronic equipment
CN110233744B (en) Conference state display method, conference state updating method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant