CN106294414A - Data reordering method and device - Google Patents

Data reordering method and device Download PDF

Info

Publication number
CN106294414A
CN106294414A CN201510271682.4A CN201510271682A CN106294414A CN 106294414 A CN106294414 A CN 106294414A CN 201510271682 A CN201510271682 A CN 201510271682A CN 106294414 A CN106294414 A CN 106294414A
Authority
CN
China
Prior art keywords
time
parameter
calculated
data
difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510271682.4A
Other languages
Chinese (zh)
Other versions
CN106294414B (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.)
Yunnan Tengyun Information Industry Co ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201510271682.4A priority Critical patent/CN106294414B/en
Publication of CN106294414A publication Critical patent/CN106294414A/en
Application granted granted Critical
Publication of CN106294414B publication Critical patent/CN106294414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries

Abstract

The invention discloses a kind of data reordering method, including: obtain user current location and current time and the uploading position of pending data and uplink time;Generate the first parameter according to described current location and described uploading position, generate the second parameter according to described current time and described uplink time, and be calculated parameters sortnig according to described first parameter and described second parameter;The sequence of pending data is generated according to described parameters sortnig.Invention additionally discloses a kind of data sorting device.The present invention realizes binding time and geographical position obtains the sequence of data, ensures more reasonably data to be ranked up simultaneously.

Description

Data reordering method and device
Technical field
The present invention relates to field of computer technology, be related specifically to data reordering method and device.
Background technology
Along with the development of Internet technology, increasing internet, applications is liked by people, example As, people utilize webpage or microblogging to post, user browses the model on webpage or microblogging when, Model can be ranked up in a certain way.The sortord of model includes at present:
Scheme 1:
1) by all models preferentially by distance sequence, equidistant according to time sequence;
Scheme 2:
1) say that all models are preferential according to time sequence, time equal sorting by distance;
Scheme 3:
1) confine a scope (such as 10km), all models in the range of this are arranged the most from the new to the old Sequence;
2), after user finishes watching all models that the first step searches, expanded scope (such as 20KM), being newly included into The model come is again by sorting from the new to the old, by that analogy;
Above three scheme all existing defects, concrete defect is as follows:
Scheme 1: essence is distance priority, if the place (such as tourist attractions) that user to model is intensive, Then see is all the various patches delivered in a little scope of other users.User is except constantly down brushing Outside, it is impossible to the data that the time of seeing is the most remote.The program cannot meet the user to time-sensitive, I.e. cannot be in time according to time more new posts.
Scheme 2: essence is time priority, the model probability that the same time delivers is less, all users Always see the up-to-date model delivered of whole world user.The program cannot meet the use to geographical position sensing Family, i.e. cannot be in time according to the thinner model in position.
Scheme 3: this schemes synthesis considers geographical position and time.But the artificial staged scope arranged Cause sorting the most unreasonable: one just in the new posts of 11km outgoing, user is only having browsed Just can see after having the model in 10km.
To sum up, the scheme of existing data sorting cannot take into account geographical position and the time is reasonably counted According to sequence.
Summary of the invention
The embodiment of the present invention provides a kind of data reordering method and device, it is intended to solve existing data sorting Scheme in cannot take into account geographical position and problem that the time obtains rational data sorting.
For achieving the above object, the embodiment of the present invention proposes a kind of data reordering method, including:
Obtain user current location and current time and the uploading position of pending data and uplink time;
Be calculated the first parameter according to described current location and described uploading position, according to described current time Between and described uplink time be calculated the second parameter, and according to described first parameter and described second parameter It is calculated parameters sortnig;
The sequence of pending data is generated according to described parameters sortnig.
To achieve these goals, the embodiment of the present invention it is further proposed that a kind of data sorting device, bag Include:
Acquisition module, for obtaining the upper open position of user current location and current time and pending data Put and uplink time;
Computing module, for being calculated the first parameter according to described current location and described uploading position, It is calculated the second parameter according to described current time and described uplink time, and according to described first parameter It is calculated parameters sortnig with described second parameter;
Generation module, for generating the sequence of pending data according to described parameters sortnig.
The present invention is calculated a comprehensive parameters sortnig by being combined time and position, then root The sequence of pending data is obtained according to comprehensive parameters sortnig.Reasonably consider to wait to locate by time and position In the sequence of reason data.It is prevented effectively from that cannot to take into account geographical position in the scheme of existing data sorting timely Between obtain the problem of rational data sorting.Realize binding time and geographical position obtain the sequence of data, Ensure more reasonably data to be ranked up simultaneously.
Accompanying drawing explanation
Fig. 1 is the hardware structure schematic diagram involved by embodiment of the present invention data sorting device;
Fig. 2 is the schematic flow sheet of the first embodiment of data reordering method of the present invention;
Fig. 3 is of the present invention to be calculated the first parameter according to described current location and described uploading position, It is calculated the second parameter according to described current time and described uplink time, and according to described first parameter With the schematic flow sheet that described second parameter is calculated parameters sortnig one embodiment;
Fig. 4 is that the present invention calculates described current time and the time difference of described uplink time, and is calculated institute State time difference square as the schematic flow sheet of the second parameter one embodiment;
Fig. 5 is the schematic flow sheet of the second embodiment of data reordering method of the present invention;
Fig. 6 is of the present invention to be calculated the first parameter according to described current location and described uploading position, It is calculated the second parameter according to described current time and described uplink time, and according to described first parameter With the schematic flow sheet that described second parameter is calculated another embodiment of parameters sortnig
Fig. 7 is the high-level schematic functional block diagram of the first embodiment of data sorting device of the present invention;
Fig. 8 is the refinement high-level schematic functional block diagram of computing module one embodiment in Fig. 7;
Fig. 9 is the high-level schematic functional block diagram of the second embodiment of data sorting device of the present invention.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, do referring to the drawings further Explanation.
Detailed description of the invention
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not used to limit Determine the present invention.
The primary solutions of the embodiment of the present invention is: obtains user current location and current time and treats Process uploading position and the uplink time of data;Calculate according to described current location and described uploading position To the first parameter, it is calculated the second parameter according to described current time and described uplink time, and according to Described first parameter and described second parameter are calculated parameters sortnig;Generate according to described parameters sortnig and treat Process the sequence of data.It is calculated a comprehensive parameters sortnig by being combined time and position, The sequence of pending data is obtained further according to comprehensive parameters sortnig.Reasonably time and position are considered In the sequence of pending data.It is prevented effectively from the scheme of existing data sorting and cannot take into account geographical position And the problem that the time obtains rational data sorting.Realize binding time and geographical position obtains the row of data Sequence, ensures more reasonably data to be ranked up simultaneously.
In the scheme of existing data sorting, existence cannot take into account geographical position and the time obtains rational data The problem of sequence.
Embodiment of the present invention framework one data sorting device, this data sorting device is by by time and position Combine and be calculated a comprehensive parameters sortnig, obtain pending further according to comprehensive parameters sortnig The sequence of data, is prevented effectively from the scheme of existing data sorting and cannot take into account geographical position and the time obtains Problem to rational data sorting.Realize binding time and geographical position obtains the sequence of data, simultaneously Ensure more reasonably data to be ranked up.
Wherein, the present embodiment data sorting device can be carried on PC end, it is also possible to is carried on mobile phone, puts down Plate computer etc. can use the electric terminal of the network application such as microblogging, wechat.Involved by this data sorting device And hardware structure can be as shown in Figure 1.
Fig. 1 shows the hardware structure involved by embodiment of the present invention data sorting device.As it is shown in figure 1, Hardware involved by described data sorting device includes: processor 301, such as CPU, network interface 304, User interface 303, memorizer 305, communication bus 302.Wherein, communication bus 302 is used for realizing this letter Breath pushes the connection communication in platform between each building block.User interface 303 can include display screen (Display), the assembly such as keyboard (Keyboard), mouse, for receiving the information of user's input, and The information transmission of reception is processed to processor 305.Display screen can be LCD display, LED show Display screen, it is also possible to for touch screen, need the data of display for video data collator, such as, show Data handling procedure, data sorting etc. operate interface.Optional user interface 303 can also include having of standard Line interface, wave point.Network interface 304 optionally can include the wireline interface of standard, wave point (such as WI-FI interface).Memorizer 305 can be high-speed RAM memorizer, it is also possible to be stable memorizer (non-volatile memory), such as disk memory.Memorizer 305 optionally can also is that independent of The storage device of aforementioned processor 301.As it is shown in figure 1, as the memorizer of a kind of computer-readable storage medium Operating system, network communication module, Subscriber Interface Module SIM and data sorting program can be included in 305.
In the hardware involved by the data sorting device shown in Fig. 1, network interface 304 is mainly used in even Connect application platform, carry out data communication with application platform;User interface 303 is mainly used in connecting client, Carry out data communication with client, receive information and the instruction of client input;And processor 301 is permissible For calling the data sorting program of storage in memorizer 305, and perform following operation:
Obtain user current location and current time and the uploading position of pending data and uplink time;
Be calculated the first parameter according to described current location and described uploading position, according to described current time Between and described uplink time be calculated the second parameter, and according to described first parameter and described second parameter It is calculated parameters sortnig;
The sequence of pending data is generated according to described parameters sortnig.
Further, in one embodiment, the data of storage during processor 301 calls memorizer 305 Collator can perform following operation:
The coordinate that coordinate is the first coordinate and described uploading position determining described current location is the second seat Mark;
The difference of two squares of the abscissa and vertical coordinate that are calculated described first coordinate is first difference of two squares and described The abscissa of the second coordinate and the difference of two squares second difference of two squares of vertical coordinate, by described first difference of two squares and described Second difference of two squares sum is as the first parameter;
Calculate described current time and the time difference of described uplink time, and be calculated described time difference Square as the second parameter;
Described first parameter and described second parameter summation are obtained summing value, and described summing value is opened flat Side obtains parameters sortnig.
Further, in one embodiment, the data of storage during processor 301 calls memorizer 305 Collator can perform following operation:
Calculate described current time and the time difference of described uplink time, and obtain time strength factor;
It is calculated time comprehensive parameters according to described time difference and described time strength factor, and calculates To described time comprehensive parameters square as the second parameter.
Further, in one embodiment, the data of storage during processor 301 calls memorizer 305 Collator can perform following operation:
Coordinate and the coordinate of described uploading position according to described current location are calculated current location with upper The distance value that open position is put, and using described distance value square as the first parameter;
Calculate described current time and the time difference of described uplink time, and obtain time strength factor;
It is calculated time comprehensive parameters according to described time difference and described time strength factor, and calculates To described time comprehensive parameters square as the second parameter;
Described first parameter and described second parameter summation are obtained summing value, and described summing value is opened flat Side obtains parameters sortnig.
Further, in one embodiment, the data of storage during processor 301 calls memorizer 305 Collator can perform following operation:
Each pending data are shown at terminal interface successively according to the sequence generated.
Further, in one embodiment, the data of storage during processor 301 calls memorizer 305 Collator can perform following operation:
Reception time strength factor instruction is set;
According to the described value arranging the instruction described strength factor of renewal, wherein, 0≤n≤19840000.
The present embodiment, according to such scheme, is calculated one comprehensively by being combined time and position Parameters sortnig, obtain the sequence of pending data further according to comprehensive parameters sortnig.Reasonably by the time With position in view of pending data sequence in.Being prevented effectively from cannot in the scheme of existing data sorting Take into account geographical position and problem that the time obtains rational data sorting.Realize binding time and geographical position Obtain the sequence of data, ensure more reasonably data to be ranked up simultaneously.
Based on above-mentioned hardware structure, data reordering method embodiment of the present invention is proposed.
As in figure 2 it is shown, propose the first embodiment of a kind of data reordering method of the present invention, described data are arranged Sequence method includes:
Step S10, obtains user current location and current time and the uploading position of pending data and upper The biography time;
In the present embodiment, user when browsing microblogging, wechat circle of friends etc. by webpage or application, Need on microblogging or the data of circle of friends show according to certain rule, i.e. need described data It is ranked up, shows described data successively according to sequence.Obtain current location and current time, and treat Process position and uplink time that data are uploaded.Uploading position and the uplink time of described pending data are Position that data are uploaded and the time uploaded, such as, say for one issued at wechat circle of friends for party A-subscriber Say or party A-subscriber's location and time when QQ Spatial distributions issue one is had a talk about.User treats in issue Process data to carry out positioning by GPS and obtain user and upload the position of pending data, and by counting Time device obtain uplink time, by described pending data send to QQ space or wechat circle of friends time, Mark user uploads position and the uplink time of pending data.User is by wechat circle of friends or QQ When space navigation is to dynamic message, obtain user current location and current time by GPS location.
Step S20, is calculated the first parameter according to described current location and described uploading position, according to institute State current time and described uplink time is calculated the second parameter, and according to described first parameter and described Second parameter is calculated parameters sortnig;
When getting the uploading position of user current location and current time and pending data and uploading After between, it is calculated the first parameter, described first parameter according to described current location and described uploading position For location parameter, and it is calculated the second parameter according to described current time and described uplink time, described Second parameter is time parameter, and is calculated sequence ginseng according to described first parameter and described second parameter Number, i.e. according to described current location, described uploading position, described current time and described uplink time meter Calculation obtains parameters sortnig.
Concrete, with reference to Fig. 3, described it is calculated first according to described current location and described uploading position Parameter, is calculated the second parameter according to described current time and described uplink time, and according to described The process that one parameter and described second parameter are calculated parameters sortnig includes:
Step S21, determines that the coordinate that coordinate is the first coordinate and described uploading position of described current location is Second coordinate;
Step S22, the difference of two squares of the abscissa and vertical coordinate that are calculated described first coordinate is first square The abscissa of poor and described second coordinate and the difference of two squares second difference of two squares of vertical coordinate, by described first square Difference and described second difference of two squares sum are as the first parameter;
Step S23, calculates described current time and the time difference of described uplink time, and is calculated described Time difference square as the second parameter;
Step S24, obtains summing value to described first parameter and described second parameter summation, and asks described Parameters sortnig is obtained with value extraction of square root.
In the present embodiment, described it is calculated the first parameter according to current location and described uploading position Formula is (X1-X2)2+(Y1-Y2)2, described calculate according to described current time and described uplink time The formula obtaining the second parameter is: (T1-T2)2, calculate according to described first parameter and described second parameter The formula obtaining parameters sortnig is:
L ′ = ( X 1 - X 2 ) 2 + ( Y 1 - Y 2 ) 2 + ( T 1 - T 2 ) 2 , Wherein:
(X1, Y1) is the coordinate of current location, and (X2, Y2) is the coordinate of the position of pending data, T1 is current time, and T2 is the uplink time of pending data, and L ' is parameters sortnig.
First the distance calculation of 2 in consideration plane:
L = ( X 1 - X 2 ) 2 + ( Y 1 - Y 2 ) 2 , Wherein:
(X1, Y1) is the coordinate of current location, and (X2, Y2) is the coordinate of the position of pending data, (X1, Y1) and (X2, Y2) is 2 points in plane, and L is just the distance between 2, by time Between latitude take into account formula, then be:
Wherein L ' is the distance considering the time, T1, T2, then be with (X1, And timestamp corresponding to (X2, Y2) Y1), temporarily long measure being defined as rice, unit of time defines For the second.It is known that above-mentioned computing formula is to be equivalent to one meter one second in fact, physical meaning i.e.: 10 The model sent out in user position before Miao, and the model this moment sent out outside 10m, be the same in sequence. In other embodiments of the present invention, more reasonably data are obtained for more preferable binding time and position Sequence, obtains increasing during sortord a time strength factor above-mentioned.
Concrete, reference Fig. 4, the described current time of described calculating and the time difference of described uplink time, and It is calculated square could alternatively be of described time difference as the process of the second parameter:
Step S231, calculates described current time and the time difference of described uplink time, and it is strong to obtain the time Degree coefficient;
Step S232, is calculated time comprehensive parameters according to described time difference and described time strength factor, And be calculated described time comprehensive parameters square as the second parameter.
It is irrational for being equivalent to one meter by one second artificially, increases a time intensity in above-mentioned formula Coefficient, then formula becomes:
L ′ = ( X 1 - X 2 ) 2 + ( Y 1 - Y 2 ) 2 + ( n ( T 1 - T 2 ) ) 2 , Wherein:
(X1, Y1) is the coordinate of current location, and (X2, Y2) is the coordinate of the position of pending data, T1 is current time, and T2 is the uplink time of pending data, and n is time strength factor, and L ' is sequence Parameter.The implication of this n is i.e. one second and the conversion proportion of a meter, it is possible to be referred to as quick to the time of user Sense degree, n is the biggest, and user is the most sensitive to the time, obtains finally at the formula increasing time strength factor n Under the mode of sequence so that data sorting is more reasonable, meets the demand of all users.The wherein use of n Way includes:
1, when n is 0, i.e. giving no thought to the time, sort method only considers distance, in order to be compared Accurately, rational data sorting, the half that arranges of n is not 0;
2, when n is infinitely great, i.e. giving no thought to geographical position, sort method only considers the time, for Obtaining data sorting more accurate, rational, n arranges half for infinity;
In being the earth in view of mankind's activity scope, the maximum distance that two pieces thing occurs is not over the earth Semicircle (about 19840 kilometers), so this n is not required to infinity, and be arranged to 19840000 Can realize being based entirely on time-sequencing;
3, be smoothly transitioned into 19840000 from 0 as n, then user is it can be seen that press different time sensitivity The model list of sequence.Arranging of n can service side control setting, is adjusted according to product situation;Also A control strip can be provided by user's control, and user, can be according to difference under different position/scenes Need to arrange different n to control to arrange different sequences.Concrete process is: receive time intensity system Count arranges instruction;According to described arrange instruction update described strength factor value, wherein, 0≤n≤ 19840000;The process that service side controls to arrange is automatically to arrange, and such as, arranges according to the history of user Custom is arranged.
Step S30, generates the sequence of pending data according to described parameters sortnig.
After the parameters sortnig generating data in the manner described above, generate pending according to described parameters sortnig The sequence of data.
Concrete, with reference to Fig. 5, after step S30, also include:
Step S40, shows each pending data at terminal interface successively according to the sequence generated.
That is, when user browses described pending data, show described pending successively according to above-mentioned sequence Data, and be not only simply according to the time is far and near or geographical position distance shows that each is pending successively Data, combine time and geographical position each pending data of display, and set according to user's request Put time strength factor so that data sorting is more reasonable, closer to user's request, improve sortord Experience effect.
In other embodiments of the present invention, it is can be straight according to two latitude and longitude coordinates because of a lot of back-end component Connect and draw distance L, with reference to Fig. 6, described be calculated according to described current location and described uploading position First parameter, is calculated the second parameter according to described current time and described uplink time, and according to institute State the first parameter and described second parameter be calculated the process of parameters sortnig and can also include:
Step S25, is calculated currently according to the coordinate of described current location and the coordinate of described uploading position The distance value of position and uploading position, and using described distance value square as the first parameter;
Step S26, calculates described current time and the time difference of described uplink time, and obtains time intensity Coefficient;
Step S27, is calculated time comprehensive parameters according to described time difference and described time strength factor, And be calculated described time comprehensive parameters square as the second parameter;
Step S28, obtains summing value to described first parameter and described second parameter summation, and asks described Parameters sortnig is obtained with value extraction of square root.
Concrete, parameters sortnig generate formula it may also is that
L ′ = L 2 + { n ( T 1 - T 2 ) } 2 , Wherein:
L is the distance value of current location and the position of pending data, and T1 is current time, and T2 is for waiting to locate The uplink time of reason data, n is time strength factor, and L ' is parameters sortnig.Geographical position may use three Dimension coordinate, as long as now increasing the calculating of Z axis, the distance noted for those skilled in the art calculates Mode, does not repeats them here.Can select according to user or system default is arranged, not limit at this, A kind of calculating completing parameters sortnig of two ways can be selected, such as, by step S21 to step The process of S24 completes the calculating of parameters sortnig, or is completed by the process of step S25 to step S28 The calculating of parameters sortnig.
The present embodiment is calculated a comprehensive parameters sortnig by being combined time and position, then The sequence of pending data is obtained according to comprehensive parameters sortnig.Reasonably consider to treat by time and position Process in the sequence of data.Be prevented effectively from the scheme of existing data sorting cannot take into account geographical position and The problem that time obtains rational data sorting.Realize binding time and geographical position obtain the sequence of data, Ensure more reasonably data to be ranked up simultaneously.
Accordingly, the first embodiment of data sorting device of the present invention is proposed.With reference to Fig. 7, described data are arranged Sequence device includes acquisition module 10, computing module 20, receiver module 30, arranges module 40 and generate mould Block 50.
Described acquisition module 10, for obtaining user current location and current time and pending data Uploading position and uplink time;
In the present embodiment, user when browsing microblogging, wechat circle of friends etc. by webpage or application, Need on microblogging or the data of circle of friends show according to certain rule, i.e. need described data It is ranked up, shows described data successively according to sequence.Obtain current location and current time, and treat Process position and uplink time that data are uploaded.Uploading position and the uplink time of described pending data are Position that data are uploaded and the time uploaded, such as, say for one issued at wechat circle of friends for party A-subscriber Say or party A-subscriber's location and time when QQ Spatial distributions issue one is had a talk about.User treats in issue Process data to carry out positioning by GPS and obtain user and upload the position of pending data, and by counting Time device obtain uplink time, by described pending data send to QQ space or wechat circle of friends time, Mark user uploads position and the uplink time of pending data.User is by wechat circle of friends or QQ When space navigation is to dynamic message, obtain user current location and current time by GPS location.
Described computing module 20, for being calculated first according to described current location and described uploading position Parameter, is calculated the second parameter according to described current time and described uplink time, and according to described One parameter and described second parameter are calculated parameters sortnig;
When getting the uploading position of user current location and current time and pending data and uploading After between, it is calculated the first parameter, described first parameter according to described current location and described uploading position For location parameter, and it is calculated the second parameter according to described current time and described uplink time, described Second parameter is time parameter, and is calculated sequence ginseng according to described first parameter and described second parameter Number, i.e. according to described current location, described uploading position, described current time and described uplink time meter Calculation obtains parameters sortnig.
Concrete, with reference to Fig. 8, described computing module 20 comprises determining that unit 21 and computing unit 22,
Described determine unit 21, for determine the coordinate of described current location be the first coordinate and described in upload The coordinate of position is the second coordinate;
Described computing unit 22, for be calculated the abscissa of described first coordinate and vertical coordinate square Difference is the difference of two squares second difference of two squares of first difference of two squares and the abscissa of described second coordinate and vertical coordinate, will Described first difference of two squares and described second difference of two squares sum are as the first parameter;Be additionally operable to calculate described currently Time and the time difference of described uplink time, and be calculated described time difference square as the second parameter; It is additionally operable to described first parameter and described second parameter summation are obtained summing value, and described summing value is opened Square obtain parameters sortnig.
In the present embodiment, described it is calculated the first parameter according to current location and described uploading position Formula is (X1-X2)2+(Y1-Y2)2, described calculate according to described current time and described uplink time The formula obtaining the second parameter is: (T1-T2)2, calculate according to described first parameter and described second parameter The formula obtaining parameters sortnig is:
L ′ = ( X 1 - X 2 ) 2 + ( Y 1 - Y 2 ) 2 + ( T 1 - T 2 ) 2 , Wherein:
(X1, Y1) is the coordinate of current location, and (X2, Y2) is the coordinate of the position of pending data, T1 is current time, and T2 is the uplink time of pending data, and L ' is parameters sortnig.
First the distance calculation of 2 in consideration plane:
L = ( X 1 - X 2 ) 2 + ( Y 1 - Y 2 ) 2 , Wherein:
(X1, Y1) is the coordinate of current location, and (X2, Y2) is the coordinate of the position of pending data, (X1, Y1) and (X2, Y2) is 2 points in plane, and L is just the distance between 2, by time Between latitude take into account formula, then be:
Wherein L ' is the distance considering the time, and T1, T2 are then The timestamp corresponding with (X1, Y1) and (X2, Y2), is temporarily defined as rice, time long measure Unit definition is the second.It is known that above-mentioned computing formula is to be equivalent to one meter one second in fact, physical meaning I.e.: the model sent out in user position before 10 seconds, and the model this moment sent out outside 10m, in sequence It is the same.In other embodiments of the present invention, obtain more for more preferable binding time and position Reasonably data sorting, above-mentioned obtain sortord during increase a time strength factor.
Further, described computing unit 22, it is additionally operable to calculate described current time and described uplink time Time difference, and obtain time strength factor;It is additionally operable to according to described time difference and described time intensity system Number is calculated time comprehensive parameters, and be calculated described time comprehensive parameters square as the second ginseng Number.
It is irrational for being equivalent to one meter by one second artificially, increases a time intensity in above-mentioned formula Coefficient, then formula becomes:
L ′ = ( X 1 - X 2 ) 2 + ( Y 1 - Y 2 ) 2 + ( n ( T 1 - T 2 ) ) 2 , Wherein:
(X1, Y1) is the coordinate of current location, and (X2, Y2) is the coordinate of the position of pending data, T1 is current time, and T2 is the uplink time of pending data, and n is time strength factor, and L ' is sequence Parameter.The implication of this n is i.e. one second and the conversion proportion of a meter, it is possible to be referred to as quick to the time of user Sense degree, n is the biggest, and user is the most sensitive to the time, obtains finally at the formula increasing time strength factor n Under the mode of sequence so that data sorting is more reasonable, meets the demand of all users.The wherein use of n Way includes:
1, when n is 0, i.e. giving no thought to the time, sort method only considers distance, in order to be compared Accurately, rational data sorting, the half that arranges of n is not 0;
2, when n is infinitely great, i.e. giving no thought to geographical position, sort method only considers the time, for Obtaining data sorting more accurate, rational, n arranges half for infinity;
In being the earth in view of mankind's activity scope, the maximum distance that two pieces thing occurs is not over the earth Semicircle (about 19840 kilometers), so this n is not required to infinity, and be arranged to 19840000 Can realize being based entirely on time-sequencing;
3, be smoothly transitioned into 19840000 from 0 as n, then user is it can be seen that press different time sensitivity The model list of sequence.Arranging of n can service side control setting, is adjusted according to product situation;Also A control strip can be provided by user's control, and user, can be according to difference under different position/scenes Need to arrange different n to control to arrange different sequences.Concrete process is: receiver module 30, uses In receive time strength factor instruction is set;Module 40 is set, for arranging instruction renewal according to described The value of described strength factor, wherein, 0≤n≤19840000;The process that service side controls to arrange is automatic Arrange, such as, custom is set according to the history of user and arranges.
Described generation module 50, for generating the sequence of pending data according to described parameters sortnig.
After the parameters sortnig generating data in the manner described above, generate pending according to described parameters sortnig The sequence of data.
Concrete, with reference to Fig. 9, described data sorting device also includes: display module 60,
At terminal interface, described display module 60, for showing that each is pending successively according to the sequence generated Data.
That is, when user browses described pending data, show described pending successively according to above-mentioned sequence Data, and be not only simply according to the time is far and near or geographical position distance shows that each is pending successively Data, combine time and geographical position each pending data of display, and set according to user's request Put time strength factor so that data sorting is more reasonable, closer to user's request, improve sortord Experience effect.
In other embodiments of the present invention, it is can be straight according to two latitude and longitude coordinates because of a lot of back-end component Connect and draw distance L, described computing unit 22, it is additionally operable to the coordinate according to described current location and described The coordinate of uploading position is calculated the distance value of current location and uploading position, and by described distance value Square as the first parameter;It is additionally operable to calculate described current time and the time difference of described uplink time, and Acquisition time strength factor;When being additionally operable to be calculated according to described time difference and described time strength factor Between comprehensive parameters, and be calculated described time comprehensive parameters square as the second parameter;It is right to be additionally operable to Described first parameter and described second parameter summation obtain summing value, and obtain described summing value extraction of square root Parameters sortnig.
Concrete, parameters sortnig generate formula it may also is that
L ′ = L 2 + { n ( T 1 - T 2 ) } 2 , Wherein:
L is the distance value of current location and the position of pending data, and T1 is current time, and T2 is for waiting to locate The uplink time of reason data, n is time strength factor, and L ' is parameters sortnig.Geographical position may use three Dimension coordinate, as long as now increasing the calculating of Z axis, the distance noted for those skilled in the art calculates Mode, does not repeats them here.
The present embodiment is calculated a comprehensive parameters sortnig by being combined time and position, then The sequence of pending data is obtained according to comprehensive parameters sortnig.Reasonably consider to treat by time and position Process in the sequence of data.Be prevented effectively from the scheme of existing data sorting cannot take into account geographical position and The problem that time obtains rational data sorting.Realize binding time and geographical position obtain the sequence of data, Ensure more reasonably data to be ranked up simultaneously.
It should be noted that in this article, term " include ", " comprising " or its any other variant Be intended to comprising of nonexcludability so that include the process of a series of key element, method, article or Person's device not only includes those key elements, but also includes other key elements being not expressly set out, or also Including the key element intrinsic for this process, method, article or device.In the feelings not having more restriction Under condition, statement " including ... " key element limited, it is not excluded that include this key element process, Method, article or device there is also other identical element.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art is it can be understood that arrive above-mentioned Embodiment method can add the mode of required general hardware platform by software and realize, naturally it is also possible to logical Cross hardware, but a lot of in the case of the former is more preferably embodiment.Based on such understanding, the present invention's The part that prior art is contributed by technical scheme the most in other words can be with the form body of software product Revealing to come, this computer software product is stored in a storage medium (such as ROM/RAM, magnetic disc, light Dish) in, including some instructions with so that a station terminal equipment (can be mobile phone, computer, service Device, or the network equipment etc.) perform the method described in each embodiment of the present invention.

Claims (12)

1. a data reordering method, it is characterised in that including:
Obtain user current location and current time and the uploading position of pending data and uplink time;
Be calculated the first parameter according to described current location and described uploading position, according to described current time Between and described uplink time be calculated the second parameter, and according to described first parameter and described second parameter It is calculated parameters sortnig;
The sequence of pending data is generated according to described parameters sortnig.
2. data reordering method as claimed in claim 1, it is characterised in that work as described in described basis Front position and described uploading position are calculated the first parameter, according to described current time and described in upload time Between be calculated the second parameter, and be calculated sequence ginseng according to described first parameter and described second parameter The step of number includes:
The coordinate that coordinate is the first coordinate and described uploading position determining described current location is the second seat Mark;
The difference of two squares of the abscissa and vertical coordinate that are calculated described first coordinate is first difference of two squares and described The abscissa of the second coordinate and the difference of two squares second difference of two squares of vertical coordinate, by described first difference of two squares and described Second difference of two squares sum is as the first parameter;
Calculate described current time and the time difference of described uplink time, and be calculated described time difference Square as the second parameter;
Described first parameter and described second parameter summation are obtained summing value, and described summing value is opened flat Side obtains parameters sortnig.
3. data reordering method as claimed in claim 2, it is characterised in that work as described in described calculating Front time and the time difference of described uplink time, and be calculated described time difference square as second ginseng The step of number replaces with:
Calculate described current time and the time difference of described uplink time, and obtain time strength factor;
It is calculated time comprehensive parameters according to described time difference and described time strength factor, and calculates To described time comprehensive parameters square as the second parameter.
4. data reordering method as claimed in claim 1, it is characterised in that described according to described currently Position and described uploading position are calculated the first parameter, according to described current time and described uplink time It is calculated the second parameter, and is calculated parameters sortnig according to described first parameter and described second parameter Step include:
Coordinate and the coordinate of described uploading position according to described current location are calculated current location with upper The distance value that open position is put, and using described distance value square as the first parameter;
Calculate described current time and the time difference of described uplink time, and obtain time strength factor;
It is calculated time comprehensive parameters according to described time difference and described time strength factor, and calculates To described time comprehensive parameters square as the second parameter;
Described first parameter and described second parameter summation are obtained summing value, and described summing value is opened flat Side obtains parameters sortnig.
5. the data reordering method as described in any one of Claims 1-4, it is characterised in that described After the step of the sequence generating pending data according to described parameters sortnig, also include:
Each pending data are shown at terminal interface successively according to the sequence generated.
6. the data reordering method as described in any one of claim 2 to 4, it is characterised in that described side Method also includes:
Reception time strength factor instruction is set;
According to the described value arranging the instruction described strength factor of renewal, wherein, 0≤n≤19840000.
7. a data sorting device, it is characterised in that including:
Acquisition module, for obtaining the upper open position of user current location and current time and pending data Put and uplink time;
Computing module, for being calculated the first parameter according to described current location and described uploading position, It is calculated the second parameter according to described current time and described uplink time, and according to described first parameter It is calculated parameters sortnig with described second parameter;
Generation module, for generating the sequence of pending data according to described parameters sortnig.
8. data sorting device as claimed in claim 7, it is characterised in that described computing module bag Include:
Determine unit, be the first coordinate and described uploading position for determining the coordinate of described current location Coordinate is the second coordinate;
Computing unit, the difference of two squares for the abscissa and vertical coordinate that are calculated described first coordinate is the The difference of two squares second difference of two squares of one difference of two squares and the abscissa of described second coordinate and vertical coordinate, by described One difference of two squares and described second difference of two squares sum are as the first parameter;
Described computing unit, is additionally operable to calculate described current time and the time difference of described uplink time, and Be calculated described time difference square as the second parameter;It is additionally operable to described first parameter and described Two parameter summations obtain summing value, and described summing value extraction of square root is obtained parameters sortnig.
9. data sorting device as claimed in claim 8, it is characterised in that described computing unit, It is additionally operable to calculate described current time and the time difference of described uplink time, and obtains time strength factor; It is additionally operable to be calculated time comprehensive parameters according to described time difference and described time strength factor, and calculates Obtain described time comprehensive parameters square as the second parameter.
10. data sorting device as claimed in claim 8, it is characterised in that described computing unit, Be additionally operable to the coordinate of the coordinate according to described current location and described uploading position be calculated current location with The distance value of uploading position, and using described distance value square as the first parameter;It is additionally operable to calculating described Current time and the time difference of described uplink time, and obtain time strength factor;It is additionally operable to according to described Time difference and described time strength factor are calculated time comprehensive parameters, and it is comprehensive to be calculated the described time Close parameter square as the second parameter;It is additionally operable to described first parameter and described second parameter are sued for peace To summing value, and described summing value extraction of square root is obtained parameters sortnig.
The 11. data sorting devices as described in any one of claim 7 to 10, it is characterised in that institute State data sorting device also to include: display module, for showing at terminal interface successively according to the sequence generated Show each pending data.
The 12. data sorting devices as described in any one of claim 8 to 10, it is characterised in that described Data sorting device also includes:
Receiver module, arranges instruction for receive time strength factor;
Module is set, for according to the described value arranging the instruction described strength factor of renewal, wherein, 0≤n ≤19840000。
CN201510271682.4A 2015-05-25 2015-05-25 Data sorting method and device Active CN106294414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510271682.4A CN106294414B (en) 2015-05-25 2015-05-25 Data sorting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510271682.4A CN106294414B (en) 2015-05-25 2015-05-25 Data sorting method and device

Publications (2)

Publication Number Publication Date
CN106294414A true CN106294414A (en) 2017-01-04
CN106294414B CN106294414B (en) 2020-12-01

Family

ID=57635320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510271682.4A Active CN106294414B (en) 2015-05-25 2015-05-25 Data sorting method and device

Country Status (1)

Country Link
CN (1) CN106294414B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932261A (en) * 2017-05-25 2018-12-04 株式会社日立制作所 The method and apparatus that the business data processing information table of knowledge base is updated
CN109460210A (en) * 2018-10-22 2019-03-12 重庆中科云丛科技有限公司 Ordering system and data processing method
WO2022165629A1 (en) * 2021-02-02 2022-08-11 上海二三四五网络科技有限公司 Control method and apparatus for determining reverse order list data on basis of forward order list

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090049029A1 (en) * 2005-07-27 2009-02-19 Jaekeol Choi Method and system of detecting keyword whose input number is rapidly increased in real time
CN103108083A (en) * 2013-01-24 2013-05-15 广东欧珀移动通信有限公司 Method and system of ranking file lists of mobile terminal
CN104077354A (en) * 2014-05-29 2014-10-01 小米科技有限责任公司 Forum post heat determining method and related device thereof
CN104348892A (en) * 2013-08-09 2015-02-11 阿里巴巴集团控股有限公司 Information display method and device
CN104537059A (en) * 2014-12-27 2015-04-22 小米科技有限责任公司 Object ranking method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090049029A1 (en) * 2005-07-27 2009-02-19 Jaekeol Choi Method and system of detecting keyword whose input number is rapidly increased in real time
CN103108083A (en) * 2013-01-24 2013-05-15 广东欧珀移动通信有限公司 Method and system of ranking file lists of mobile terminal
CN104348892A (en) * 2013-08-09 2015-02-11 阿里巴巴集团控股有限公司 Information display method and device
CN104077354A (en) * 2014-05-29 2014-10-01 小米科技有限责任公司 Forum post heat determining method and related device thereof
CN104537059A (en) * 2014-12-27 2015-04-22 小米科技有限责任公司 Object ranking method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932261A (en) * 2017-05-25 2018-12-04 株式会社日立制作所 The method and apparatus that the business data processing information table of knowledge base is updated
CN108932261B (en) * 2017-05-25 2023-08-15 株式会社日立制作所 Method and device for updating business data processing information table of knowledge base
CN109460210A (en) * 2018-10-22 2019-03-12 重庆中科云丛科技有限公司 Ordering system and data processing method
WO2022165629A1 (en) * 2021-02-02 2022-08-11 上海二三四五网络科技有限公司 Control method and apparatus for determining reverse order list data on basis of forward order list

Also Published As

Publication number Publication date
CN106294414B (en) 2020-12-01

Similar Documents

Publication Publication Date Title
Zhang et al. On reliable task assignment for spatial crowdsourcing
CN104793938B (en) Informing message display method and system
WO2021219054A1 (en) Transverse federated learning system optimization method, apparatus and device, and readable storage medium
WO2017185664A1 (en) Method for positioning terminal, and network device
CN104427589B (en) Selection method for quickly obtaining hotspot information
CN107509175A (en) Bluetooth indoor orientation method, system, storage medium and terminal
CN108141702B (en) Context-aware location sharing service
US20150324704A1 (en) Method and apparatus for participatory sensing data collection
US20180343549A1 (en) Location-oriented services
CN104113870B (en) Network test method and mobile terminal
CN105335526A (en) Image loading method and device
CN106294414A (en) Data reordering method and device
CN104185195B (en) A kind of measuring method of mobile network property, device and system
CN104955055A (en) Methods and apparatus for determining and planning wireless network demployment sufficiency when utilizing vehicle-based relay nodes
TW201005317A (en) Method, apparatus, and computer program product for location sharing
CN113365305A (en) Network coverage data processing method, device, medium and electronic equipment
CN103188763B (en) A kind of method of registering based on space and device, electronic equipment
CN103002458B (en) Base station selection method and device
CN104809526A (en) Redundant data utility maximization method
CN111798251A (en) Verification method and device of house source data and electronic equipment
CN103383461A (en) Position obtaining method for tourist group
WO2017003628A1 (en) Network selection based on user feedback
CN111191143A (en) Application recommendation method and device
CN107113550A (en) Methods, devices and systems
WO2018107603A1 (en) Method and terminal for connecting to access point

Legal Events

Date Code Title Description
C06 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
TR01 Transfer of patent right

Effective date of registration: 20211223

Address after: 16F, Kungang science and technology building, 777 Huancheng South Road, Xishan District, Kunming, Yunnan 650100

Patentee after: Yunnan Tengyun Information Industry Co.,Ltd.

Address before: 2, 518000, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right