CN106294414B - Data sorting method and device - Google Patents

Data sorting method and device Download PDF

Info

Publication number
CN106294414B
CN106294414B CN201510271682.4A CN201510271682A CN106294414B CN 106294414 B CN106294414 B CN 106294414B CN 201510271682 A CN201510271682 A CN 201510271682A CN 106294414 B CN106294414 B CN 106294414B
Authority
CN
China
Prior art keywords
time
parameter
data
calculating
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.)
Active
Application number
CN201510271682.4A
Other languages
Chinese (zh)
Other versions
CN106294414A (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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a data sorting method, which comprises the following steps: acquiring the current position and the current time of a user and the uploading position and the uploading time of data to be processed; generating a first parameter according to the current position and the uploading position, generating a second parameter according to the current time and the uploading time, and calculating according to the first parameter and the second parameter to obtain a sequencing parameter; and generating the sequence of the data to be processed according to the sequence parameters. The invention also discloses a data sorting device. The invention realizes the data sequencing by combining time and geographic position and simultaneously ensures more reasonable data sequencing.

Description

Data sorting method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data sorting method and apparatus.
Background
With the continuous development of internet technology, more and more internet applications are favored by people, for example, people use web pages or microblogs to send posts, and when a user browses posts on the web pages or the microblogs, the posts are sorted in a certain mode. The current ranking of posts includes:
scheme 1:
1) sorting all posts according to the distance and time with equal distance;
scheme 2:
1) all posts are preferably sorted according to time, and sorted according to distance and time with equal time;
scheme 3:
1) framing a range (e.g., 10km), and sorting all posts in the range from new to old in time;
2) after the user sees all the posts searched in the first step, the range is expanded (such as 20KM), and the posts newly contained are sorted from new to old, and so on;
the three schemes have defects, and the specific defects are as follows:
scheme 1: the essence is distance first, and if a user goes to a place where posts are dense (such as tourist attractions), all what is seen is various posts made by other users in a small range. The user cannot see data that is a little bit longer than the time it takes to swipe down. This solution does not satisfy time-sensitive users, i.e. posts cannot be updated in time.
Scheme 2: the essence is time first, the probability of posting at the same time is small, and all users always see the most recently posted posts made by users all over the world. This solution does not satisfy users who are sensitive to geographical location, i.e. posts cannot be detailed in time by location.
Scheme 3: this solution takes into account both the geographical location and the time. But the artificially set stepwise range leads to a very unreasonable ordering: a new post just outgoing at 11km can only be seen by the user after browsing all posts within 10 km.
In summary, the existing data sorting scheme cannot give consideration to both the geographical position and the time to obtain reasonable data sorting.
Disclosure of Invention
The embodiment of the invention provides a data sorting method and a data sorting device, and aims to solve the problem that reasonable data sorting cannot be obtained by considering geographical positions and time in the conventional data sorting scheme.
To achieve the above object, an embodiment of the present invention provides a data sorting method, including:
acquiring the current position and the current time of a user and the uploading position and the uploading time of data to be processed;
calculating to obtain a first parameter according to the current position and the uploading position, calculating to obtain a second parameter according to the current time and the uploading time, and calculating to obtain a sorting parameter according to the first parameter and the second parameter;
and generating the sequence of the data to be processed according to the sequence parameters.
In order to achieve the above object, an embodiment of the present invention further provides a data sorting apparatus, including:
the acquisition module is used for acquiring the current position and the current time of a user and the uploading position and the uploading time of the data to be processed;
the calculation module is used for calculating to obtain a first parameter according to the current position and the uploading position, calculating to obtain a second parameter according to the current time and the uploading time, and calculating to obtain a sequencing parameter according to the first parameter and the second parameter;
and the generating module is used for generating the sequence of the data to be processed according to the sequence parameters.
According to the invention, a comprehensive sequencing parameter is obtained by combining time and position, and sequencing of the data to be processed is obtained according to the comprehensive sequencing parameter. The time and the position are reasonably considered in the ordering of the data to be processed. The problem that the geographic position and the time cannot be considered to obtain reasonable data sequencing in the existing data sequencing scheme is effectively solved. The data sorting is realized by combining the time and the geographic position, and meanwhile, the data is guaranteed to be sorted more reasonably.
Drawings
FIG. 1 is a diagram illustrating a hardware architecture of a data sorting apparatus according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a data sorting method according to a first embodiment of the present invention;
fig. 3 is a schematic flow chart of an embodiment of the present invention, in which a first parameter is calculated according to the current position and the upload position, a second parameter is calculated according to the current time and the upload time, and a sorting parameter is calculated according to the first parameter and the second parameter;
fig. 4 is a schematic flow chart illustrating an embodiment of calculating a time difference between the current time and the upload time, and calculating a square of the time difference as a second parameter according to the present invention;
FIG. 5 is a flowchart illustrating a data sorting method according to a second embodiment of the present invention;
FIG. 6 is a flowchart illustrating another embodiment of calculating a first parameter according to the current location and the upload location, calculating a second parameter according to the current time and the upload time, and calculating a ranking parameter according to the first parameter and the second parameter according to the present invention
FIG. 7 is a functional block diagram of a data sorting apparatus according to a first embodiment of the present invention;
FIG. 8 is a block diagram illustrating a refinement function of one embodiment of the computing module of FIG. 7;
fig. 9 is a functional block diagram of a data sorting apparatus according to a second embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: acquiring the current position and the current time of a user and the uploading position and the uploading time of data to be processed; calculating to obtain a first parameter according to the current position and the uploading position, calculating to obtain a second parameter according to the current time and the uploading time, and calculating to obtain a sorting parameter according to the first parameter and the second parameter; and generating the sequence of the data to be processed according to the sequence parameters. And calculating to obtain a comprehensive sequencing parameter by combining the time and the position, and then obtaining the sequencing of the data to be processed according to the comprehensive sequencing parameter. The time and the position are reasonably considered in the ordering of the data to be processed. The problem that the geographic position and the time cannot be considered to obtain reasonable data sequencing in the existing data sequencing scheme is effectively solved. The data sorting is realized by combining the time and the geographic position, and meanwhile, the data is guaranteed to be sorted more reasonably.
The existing data sorting scheme has the problem that reasonable data sorting cannot be obtained by considering both the geographical position and the time.
The embodiment of the invention constructs the data sorting device, the data sorting device obtains a comprehensive sorting parameter by combining time and position and then obtains the sorting of the data to be processed according to the comprehensive sorting parameter, thereby effectively avoiding the problem that the prior data sorting scheme can not give consideration to the geographical position and the time to obtain reasonable data sorting. The data sorting is realized by combining the time and the geographic position, and meanwhile, the data is guaranteed to be sorted more reasonably.
The data sorting device can be carried on a PC (personal computer) end, and also can be carried on an electronic terminal such as a mobile phone and a tablet personal computer which can use network applications such as micro blogs and micro messages. The hardware architecture involved in the data sorting apparatus may be as shown in fig. 1.
Fig. 1 shows a hardware architecture related to a data sorting apparatus according to an embodiment of the present invention. As shown in fig. 1, the hardware involved in the data sorting apparatus includes: a processor 301, e.g. a CPU, a network interface 304, a user interface 303, a memory 305, a communication bus 302. The communication bus 302 is used for implementing connection communication between the components in the information push platform. The user interface 303 may include a Display (Display), a Keyboard (Keyboard), a mouse, and the like, and is configured to receive information input by a user and send the received information to the processor 305 for processing. The display screen can be an LCD display screen, an LED display screen or a touch screen, and is used for displaying data to be displayed by the data sorting device, such as an operation interface for displaying a data processing process, data sorting and the like. The optional user interface 303 may also include a standard wired interface, a wireless interface. The network interface 304 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). Memory 305 may be a high-speed RAM memory or may be a non-volatile memory, such as a disk memory. The memory 305 may alternatively be a storage device separate from the processor 301 described above. As shown in fig. 1, the memory 305, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a data sorting program.
In the hardware related to the data sorting apparatus shown in fig. 1, the network interface 304 is mainly used for connecting to an application platform and performing data communication with the application platform; the user interface 303 is mainly used for connecting a client, performing data communication with the client, and receiving information and instructions input by the client; and the processor 301 may be configured to invoke the data sorting program stored in the memory 305 and perform the following operations:
acquiring the current position and the current time of a user and the uploading position and the uploading time of data to be processed;
calculating to obtain a first parameter according to the current position and the uploading position, calculating to obtain a second parameter according to the current time and the uploading time, and calculating to obtain a sorting parameter according to the first parameter and the second parameter;
and generating the sequence of the data to be processed according to the sequence parameters.
Further, in one embodiment, the processor 301 invoking the data sorting program stored in the memory 305 may perform the following operations:
determining that the coordinate of the current position is a first coordinate and the coordinate of the uploading position is a second coordinate;
calculating to obtain a first square difference of a square difference of an abscissa and an ordinate of the first coordinate and a second square difference of a square difference of an abscissa and an ordinate of the second coordinate, and taking the sum of the first square difference and the second square difference as a first parameter;
calculating the time difference between the current time and the uploading time, and calculating to obtain the square of the time difference as a second parameter;
and summing the first parameter and the second parameter to obtain a summation value, and squaring the summation value to obtain a sorting parameter.
Further, in one embodiment, the processor 301 invoking the data sorting program stored in the memory 305 may perform the following operations:
calculating the time difference between the current time and the uploading time, and acquiring a time intensity coefficient;
and calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter.
Further, in one embodiment, the processor 301 invoking the data sorting program stored in the memory 305 may perform the following operations:
calculating a distance value between the current position and the uploading position according to the coordinates of the current position and the coordinates of the uploading position, and taking the square of the distance value as a first parameter;
calculating the time difference between the current time and the uploading time, and acquiring a time intensity coefficient;
calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter;
and summing the first parameter and the second parameter to obtain a summation value, and squaring the summation value to obtain a sorting parameter.
Further, in one embodiment, the processor 301 invoking the data sorting program stored in the memory 305 may perform the following operations:
and sequentially displaying the data to be processed on the terminal interface according to the generated sequence.
Further, in one embodiment, the processor 301 invoking the data sorting program stored in the memory 305 may perform the following operations:
receiving a setting instruction of a time intensity coefficient;
and updating the value of the intensity coefficient according to the setting instruction, wherein n is more than or equal to 0 and less than or equal to 19840000.
According to the scheme, the comprehensive sequencing parameter is obtained by combining the time and the position, and the sequencing of the data to be processed is obtained according to the comprehensive sequencing parameter. The time and the position are reasonably considered in the ordering of the data to be processed. The problem that the geographic position and the time cannot be considered to obtain reasonable data sequencing in the existing data sequencing scheme is effectively solved. The data sorting is realized by combining the time and the geographic position, and meanwhile, the data is guaranteed to be sorted more reasonably.
Based on the hardware architecture, the embodiment of the data sorting method is provided.
As shown in fig. 2, a first embodiment of a data sorting method according to the present invention is provided, where the data sorting method includes:
step S10, acquiring the current position and the current time of the user and the uploading position and the uploading time of the data to be processed;
in this embodiment, when a user browses a microblog, a friend circle of a WeChat, or the like through a webpage or an application, data on the microblog or the friend circle need to be displayed according to a certain rule, that is, the data need to be sorted, and the data are sequentially displayed according to the sorting. And acquiring the current position and the current time, and the uploading position and the uploading time of the data to be processed. The uploading position and the uploading time of the data to be processed are the uploading position and the uploading time of the data, for example, the uploading position and the uploading time are the position and the uploading time of a saying released by the user A in the WeChat friend circle or the position and the uploading time of a saying dynamically released by the user A in the QQ space. When the user releases the data to be processed, the position of the data to be processed uploaded by the user can be obtained by positioning through a GPS, the uploading time is obtained through a timer, and when the data to be processed is sent to a QQ space or a WeChat friend circle, the position and the uploading time of the data to be processed uploaded by the user are marked. When a user browses dynamic messages through a WeChat friend circle or a QQ space, the current position and the current time of the user are obtained through GPS positioning.
Step S20, calculating to obtain a first parameter according to the current position and the uploading position, calculating to obtain a second parameter according to the current time and the uploading time, and calculating to obtain a sorting parameter according to the first parameter and the second parameter;
after acquiring the current position and the current time of a user and the uploading position and the uploading time of data to be processed, calculating to obtain a first parameter according to the current position and the uploading position, wherein the first parameter is a position parameter, calculating to obtain a second parameter according to the current time and the uploading time, the second parameter is a time parameter, and calculating to obtain a sorting parameter according to the first parameter and the second parameter, namely calculating to obtain a sorting parameter according to the current position, the uploading position, the current time and the uploading time.
Specifically, referring to fig. 3, the process of obtaining a first parameter by calculation according to the current position and the upload position, obtaining a second parameter by calculation according to the current time and the upload time, and obtaining a ranking parameter by calculation according to the first parameter and the second parameter includes:
step S21, determining the coordinate of the current position as a first coordinate and the coordinate of the uploading position as a second coordinate;
step S22, calculating to obtain a first square difference of the abscissa and the ordinate of the first coordinate and a second square difference of the abscissa and the ordinate of the second coordinate, and taking the sum of the first square difference and the second square difference as a first parameter;
step S23, calculating the time difference between the current time and the uploading time, and calculating the square of the time difference to be used as a second parameter;
and step S24, summing the first parameter and the second parameter to obtain a summation value, and squaring the summation value to obtain a sorting parameter.
In this embodiment, the formula of the first parameter calculated according to the current position and the upload position is (X1-X2)2+(Y1-Y2)2The formula for calculating the second parameter according to the current time and the uploading time is as follows: (T1-T2)2And calculating a formula of the sequencing parameter according to the first parameter and the second parameter, wherein the formula is as follows:
Figure BDA0000723919430000071
wherein:
(X1, Y1) is the coordinates of the current position, (X2, Y2) is the coordinates of the position of the data to be processed, T1 is the current time, T2 is the upload time of the data to be processed, and L' is the sorting parameter.
Firstly, a distance calculation mode of two points on a plane is considered:
Figure BDA0000723919430000072
wherein:
(X1, Y1) is the coordinates of the current position, (X2, Y2) is the coordinates of the position of the data to be processed, (X1, Y1) and (X2, Y2) are two points on the plane, L is the distance between the two points, considering the time latitude into the formula, then:
Figure BDA0000723919430000073
where L' is a distance in consideration of time, and T1 and T2 are time stamps corresponding to (X1, Y1) and (X2, Y2), and the length unit is temporarily defined as meters and the time unit is defined as seconds. It can be known that the above calculation formula is actually equivalent to one meter per second, and the physical meaning is: in the user position before 10 secondsThe posted posts, and posts posted at times less than 10m, are the same in rank. In other embodiments of the present invention, in order to better combine time and location to obtain more reasonable data sorting, a time intensity coefficient is added in the process of obtaining the sorting mode.
Specifically, referring to fig. 4, the process of calculating the time difference between the current time and the upload time, and calculating the square of the time difference as the second parameter may be replaced with:
step S231, calculating the time difference between the current time and the uploading time, and acquiring a time intensity coefficient;
step S232, calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter.
It is not reasonable to artificially equate one second to one meter, adding a time intensity factor to the above formula, the formula becomes:
Figure BDA0000723919430000081
wherein:
(X1, Y1) are coordinates of the current position, (X2, Y2) are coordinates of the position of the data to be processed, T1 is the current time, T2 is the upload time of the data to be processed, n is the time intensity coefficient, and L' is the sorting parameter. The meaning of n is the conversion ratio of one second to one meter, and can also be called the sensitivity degree of a user to time, the larger n is, the more sensitive the user to time is, and under the condition that a final sorting mode is obtained by increasing a formula of a time intensity coefficient n, the data sorting is more reasonable, and the requirements of all users are met. Wherein the use of n comprises:
1. when n is 0, namely time is not considered completely, the sorting method only considers the distance, and in order to obtain more accurate and reasonable data sorting, half of n is not 0;
2. when n is infinite, namely the geographical position is not considered completely, the sorting method only considers time, and half of n is not infinite in order to obtain more accurate and reasonable data sorting;
considering that the human range of motion is within the earth, the farthest distance that two things happen is not more than a semicircle of the earth (about 19840 km), so this n does not need to be infinite, but is configured 19840000 to achieve a complete chronological ordering;
3. when n smoothly transitions from 0 to 19840000, the user may see a list of posts ordered by different time sensitivities. The setting of n can be controlled and set by a service side, and can be adjusted according to the product condition; a control bar can also be provided to be controlled by a user, and the user can set different n according to different requirements to control and set different sequencing in different positions/scenes. The specific process is as follows: receiving a setting instruction of a time intensity coefficient; updating the value of the intensity coefficient according to the setting instruction, wherein n is more than or equal to 0 and less than or equal to 19840000; the process of the service-side control setting is automatic setting, for example, setting habit setting according to the history of the user, and the like.
And step S30, generating the sequence of the data to be processed according to the sequence parameters.
After the sorting parameters of the data are generated according to the mode, the sorting of the data to be processed is generated according to the sorting parameters.
Specifically, referring to fig. 5, after step S30, the method further includes:
and step S40, sequentially displaying the data to be processed on the terminal interface according to the generated sequence.
That is, when the user browses the data to be processed, the data to be processed is sequentially displayed according to the sequencing, and not only are the data to be processed simply and sequentially displayed according to the time distance or the geographic position distance, the time and the geographic position are combined to display the data to be processed, and the time intensity coefficient is set according to the user requirement, so that the data sequencing is more reasonable, the data sequencing is closer to the user requirement, and the experience effect of the sequencing mode is improved.
In other embodiments of the present invention, since a plurality of background components may directly obtain the distance L according to two longitude and latitude coordinates, referring to fig. 6, the process of obtaining the first parameter by calculation according to the current position and the upload position, obtaining the second parameter by calculation according to the current time and the upload time, and obtaining the ranking parameter by calculation according to the first parameter and the second parameter may further include:
step S25, calculating a distance value between the current position and the uploading position according to the coordinates of the current position and the uploading position, and taking the square of the distance value as a first parameter;
step S26, calculating the time difference between the current time and the uploading time, and acquiring a time intensity coefficient;
step S27, calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter;
and step S28, summing the first parameter and the second parameter to obtain a summation value, and squaring the summation value to obtain a sorting parameter.
Specifically, the sorting parameter generating formula may also be:
Figure BDA0000723919430000091
wherein:
l is the distance value between the current position and the position of the data to be processed, T1 is the current time, T2 is the uploading time of the data to be processed, n is the time intensity coefficient, and L' is the sorting parameter. The geographic position may use three-dimensional coordinates, and at this time, only the calculation of the Z axis needs to be added, which is a distance calculation method known to those skilled in the art and will not be described herein again. The calculation of the ranking parameter may be done in one of two ways, for example, by the process of step S21 to step S24, or by the process of step S25 to step S28, according to user selection or system default settings, without limitation.
In the embodiment, a comprehensive sorting parameter is obtained by combining time and position, and then the sorting of the data to be processed is obtained according to the comprehensive sorting parameter. The time and the position are reasonably considered in the ordering of the data to be processed. The problem that the geographic position and the time cannot be considered to obtain reasonable data sequencing in the existing data sequencing scheme is effectively solved. The data sorting is realized by combining the time and the geographic position, and meanwhile, the data is guaranteed to be sorted more reasonably.
Correspondingly, a first embodiment of the data sorting apparatus of the present invention is proposed. Referring to fig. 7, the data sorting apparatus includes an obtaining module 10, a calculating module 20, a receiving module 30, a setting module 40, and a generating module 50.
The acquiring module 10 is configured to acquire a current position and a current time of a user and an uploading position and uploading time of to-be-processed data;
in this embodiment, when a user browses a microblog, a friend circle of a WeChat, or the like through a webpage or an application, data on the microblog or the friend circle need to be displayed according to a certain rule, that is, the data need to be sorted, and the data are sequentially displayed according to the sorting. And acquiring the current position and the current time, and the uploading position and the uploading time of the data to be processed. The uploading position and the uploading time of the data to be processed are the uploading position and the uploading time of the data, for example, the uploading position and the uploading time are the position and the uploading time of a saying released by the user A in the WeChat friend circle or the position and the uploading time of a saying dynamically released by the user A in the QQ space. When the user releases the data to be processed, the position of the data to be processed uploaded by the user can be obtained by positioning through a GPS, the uploading time is obtained through a timer, and when the data to be processed is sent to a QQ space or a WeChat friend circle, the position and the uploading time of the data to be processed uploaded by the user are marked. When a user browses dynamic messages through a WeChat friend circle or a QQ space, the current position and the current time of the user are obtained through GPS positioning.
The calculation module 20 is configured to calculate a first parameter according to the current position and the upload position, calculate a second parameter according to the current time and the upload time, and calculate a ranking parameter according to the first parameter and the second parameter;
after acquiring the current position and the current time of a user and the uploading position and the uploading time of data to be processed, calculating to obtain a first parameter according to the current position and the uploading position, wherein the first parameter is a position parameter, calculating to obtain a second parameter according to the current time and the uploading time, the second parameter is a time parameter, and calculating to obtain a sorting parameter according to the first parameter and the second parameter, namely calculating to obtain a sorting parameter according to the current position, the uploading position, the current time and the uploading time.
Specifically, referring to fig. 8, the calculation module 20 includes: a determination unit 21 and a calculation unit 22,
the determining unit 21 is configured to determine that the coordinate of the current position is a first coordinate and the coordinate of the uploading position is a second coordinate;
the calculating unit 22 is configured to calculate a first square difference between an abscissa and an ordinate of the first coordinate and a second square difference between an abscissa and an ordinate of the second coordinate, and use a sum of the first square difference and the second square difference as a first parameter; the time difference between the current time and the uploading time is calculated, and the square of the time difference is calculated and obtained as a second parameter; and the second parameter calculating unit is further configured to sum the first parameter and the second parameter to obtain a sum value, and square the sum value to obtain a sorting parameter.
In this embodiment, the formula of the first parameter calculated according to the current position and the upload position is (X1-X2)2+(Y1-Y2)2The formula for calculating the second parameter according to the current time and the uploading time is as follows: (T1-T2)2And calculating a formula of the sequencing parameter according to the first parameter and the second parameter, wherein the formula is as follows:
Figure BDA0000723919430000111
wherein:
(X1, Y1) is the coordinates of the current position, (X2, Y2) is the coordinates of the position of the data to be processed, T1 is the current time, T2 is the upload time of the data to be processed, and L' is the sorting parameter.
Firstly, a distance calculation mode of two points on a plane is considered:
Figure BDA0000723919430000112
wherein:
(X1, Y1) is the coordinates of the current position, (X2, Y2) is the coordinates of the position of the data to be processed, (X1, Y1) and (X2, Y2) are two points on the plane, L is the distance between the two points, considering the time latitude into the formula, then:
Figure BDA0000723919430000113
where L' is a distance in consideration of time, and T1 and T2 are time stamps corresponding to (X1, Y1) and (X2, Y2), and the length unit is temporarily defined as meters and the time unit is defined as seconds. It can be known that the above calculation formula is actually equivalent to one meter per second, and the physical meaning is: the posts that were posted 10 seconds ago at the user's location are ranked the same as the posts that were posted 10m away. In other embodiments of the present invention, in order to better combine time and location to obtain more reasonable data sorting, a time intensity coefficient is added in the process of obtaining the sorting mode.
Further, the calculating unit 22 is further configured to calculate a time difference between the current time and the uploading time, and obtain a time intensity coefficient; and the time difference calculating module is further used for calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter.
It is not reasonable to artificially equate one second to one meter, adding a time intensity factor to the above formula, the formula becomes:
Figure BDA0000723919430000121
wherein:
(X1, Y1) are coordinates of the current position, (X2, Y2) are coordinates of the position of the data to be processed, T1 is the current time, T2 is the upload time of the data to be processed, n is the time intensity coefficient, and L' is the sorting parameter. The meaning of n is the conversion ratio of one second to one meter, and can also be called the sensitivity degree of a user to time, the larger n is, the more sensitive the user to time is, and under the condition that a final sorting mode is obtained by increasing a formula of a time intensity coefficient n, the data sorting is more reasonable, and the requirements of all users are met. Wherein the use of n comprises:
1. when n is 0, namely time is not considered completely, the sorting method only considers the distance, and in order to obtain more accurate and reasonable data sorting, half of n is not 0;
2. when n is infinite, namely the geographical position is not considered completely, the sorting method only considers time, and half of n is not infinite in order to obtain more accurate and reasonable data sorting;
considering that the human range of motion is within the earth, the farthest distance that two things happen is not more than a semicircle of the earth (about 19840 km), so this n does not need to be infinite, but is configured 19840000 to achieve a complete chronological ordering;
3. when n smoothly transitions from 0 to 19840000, the user may see a list of posts ordered by different time sensitivities. The setting of n can be controlled and set by a service side, and can be adjusted according to the product condition; a control bar can also be provided to be controlled by a user, and the user can set different n according to different requirements to control and set different sequencing in different positions/scenes. The specific process is as follows: a receiving module 30, configured to receive a setting instruction of a time intensity coefficient; the setting module 40 is used for updating the value of the intensity coefficient according to the setting instruction, wherein n is more than or equal to 0 and less than or equal to 19840000; the process of the service-side control setting is automatic setting, for example, setting habit setting according to the history of the user, and the like.
The generating module 50 is configured to generate a ranking of the data to be processed according to the ranking parameter.
After the sorting parameters of the data are generated according to the mode, the sorting of the data to be processed is generated according to the sorting parameters.
Specifically, referring to fig. 9, the data sorting apparatus further includes: the display module (60) is provided with a display module,
and the display module 60 is configured to sequentially display each piece of data to be processed on the terminal interface according to the generated sequence.
That is, when the user browses the data to be processed, the data to be processed is sequentially displayed according to the sequencing, and not only are the data to be processed simply and sequentially displayed according to the time distance or the geographic position distance, the time and the geographic position are combined to display the data to be processed, and the time intensity coefficient is set according to the user requirement, so that the data sequencing is more reasonable, the data sequencing is closer to the user requirement, and the experience effect of the sequencing mode is improved.
In other embodiments of the present invention, since many background components can directly obtain the distance L according to two longitude and latitude coordinates, the calculating unit 22 is further configured to calculate a distance value between the current position and the upload position according to the coordinates of the current position and the coordinates of the upload position, and use a square of the distance value as a first parameter; the time difference between the current time and the uploading time is calculated, and a time intensity coefficient is obtained; the time difference and the time intensity coefficient are used for calculating to obtain a time comprehensive parameter, and the square of the time comprehensive parameter is calculated to be used as a second parameter; and the second parameter calculating unit is further configured to sum the first parameter and the second parameter to obtain a sum value, and square the sum value to obtain a sorting parameter.
Specifically, the sorting parameter generating formula may also be:
Figure BDA0000723919430000131
wherein:
l is the distance value between the current position and the position of the data to be processed, T1 is the current time, T2 is the uploading time of the data to be processed, n is the time intensity coefficient, and L' is the sorting parameter. The geographic position may use three-dimensional coordinates, and at this time, only the calculation of the Z axis needs to be added, which is a distance calculation method known to those skilled in the art and will not be described herein again.
In the embodiment, a comprehensive sorting parameter is obtained by combining time and position, and then the sorting of the data to be processed is obtained according to the comprehensive sorting parameter. The time and the position are reasonably considered in the ordering of the data to be processed. The problem that the geographic position and the time cannot be considered to obtain reasonable data sequencing in the existing data sequencing scheme is effectively solved. The data sorting is realized by combining the time and the geographic position, and meanwhile, the data is guaranteed to be sorted more reasonably.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.

Claims (12)

1. A method of data ordering, comprising:
acquiring the current position and the current time of a user and the uploading position and the uploading time of data to be processed;
calculating to obtain a first parameter according to a difference value between the coordinates of the current position of the user and the coordinates of the uploading position of the data to be processed, calculating to obtain a second parameter according to a difference value between the current time of the user and the uploading time of the data to be processed, summing the first parameter and the second parameter to obtain a sum value, and squaring the sum value to obtain a sorting parameter;
and generating the sequence of the data to be processed according to the sequence parameters.
2. The data sorting method according to claim 1, wherein the step of calculating a first parameter according to a difference between coordinates of the current position of the user and coordinates of the upload position of the data to be processed, calculating a second parameter according to a difference between the current time of the user and the upload time of the data to be processed, summing the first parameter and the second parameter to obtain a sum value, and squaring the sum value to obtain a sorting parameter comprises:
determining that the coordinate of the current position is a first coordinate and the coordinate of the uploading position is a second coordinate;
calculating to obtain a first square difference of a square difference of an abscissa and an ordinate of the first coordinate and a second square difference of a square difference of an abscissa and an ordinate of the second coordinate, and taking the sum of the first square difference and the second square difference as a first parameter;
and calculating the time difference between the current time and the uploading time, and calculating to obtain the square of the time difference as a second parameter.
3. The data sorting method according to claim 2, wherein the step of calculating the time difference between the current time and the upload time and calculating the square of the time difference as the second parameter is replaced with:
calculating the time difference between the current time and the uploading time, and acquiring a time intensity coefficient;
and calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter.
4. The data sorting method according to claim 1, wherein the step of calculating a first parameter according to a difference between coordinates of the current position of the user and coordinates of the upload position of the data to be processed, calculating a second parameter according to a difference between the current time of the user and the upload time of the data to be processed, summing the first parameter and the second parameter to obtain a sum value, and squaring the sum value to obtain a sorting parameter comprises:
calculating a distance value between the current position and the uploading position according to the coordinates of the current position and the coordinates of the uploading position, and taking the square of the distance value as a first parameter;
calculating the time difference between the current time and the uploading time, and acquiring a time intensity coefficient;
and calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter.
5. The data sorting method according to any one of claims 1 to 4, wherein after the step of generating the sort of the data to be processed according to the sort parameter, further comprising:
and sequentially displaying the data to be processed on the terminal interface according to the generated sequence.
6. The data sorting method of any one of claims 2 to 4, wherein the method further comprises:
receiving a setting instruction of a time intensity coefficient;
and updating the value of the intensity coefficient according to the setting instruction, wherein n is more than or equal to 0 and less than or equal to 19840000.
7. A data sorting apparatus, comprising:
the acquisition module is used for acquiring the current position and the current time of a user and the uploading position and the uploading time of the data to be processed;
a calculating module, configured to calculate a first parameter according to a difference between a coordinate of the current location of the user and a coordinate of the uploading location of the to-be-processed data, calculate a second parameter according to a difference between the current time of the user and the uploading time of the to-be-processed data, and calculate a sorting parameter according to the first parameter and the second parameter, where the calculating module includes: the calculation unit is used for summing the first parameter and the second parameter to obtain a summation value, and squaring the summation value to obtain a sorting parameter;
and the generating module is used for generating the sequence of the data to be processed according to the sequence parameters.
8. The data sorting apparatus of claim 7, wherein the calculation module comprises:
the determining unit is used for determining that the coordinate of the current position is a first coordinate and the coordinate of the uploading position is a second coordinate;
the calculation unit is used for calculating to obtain a first square difference which is the square difference of the abscissa and the ordinate of the first coordinate and a second square difference which is the square difference of the abscissa and the ordinate of the second coordinate, and taking the sum of the first square difference and the second square difference as a first parameter;
the calculation unit is further configured to calculate a time difference between the current time and the upload time, and calculate a square of the time difference as a second parameter.
9. The data sorting device according to claim 8, wherein the calculating unit is further configured to calculate a time difference between the current time and the upload time, and obtain a time intensity coefficient; and the time difference calculating module is further used for calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter.
10. The data sorting device according to claim 8, wherein the calculating unit is further configured to calculate a distance value between the current position and the upload position according to the coordinates of the current position and the coordinates of the upload position, and use a square of the distance value as a first parameter; the time difference between the current time and the uploading time is calculated, and a time intensity coefficient is obtained; and the time difference calculating module is further used for calculating to obtain a time comprehensive parameter according to the time difference and the time intensity coefficient, and calculating to obtain the square of the time comprehensive parameter as a second parameter.
11. The data sorting apparatus of any one of claims 7 to 10, wherein the data sorting apparatus further comprises: and the display module is used for sequentially displaying the data to be processed on the terminal interface according to the generated sequence.
12. The data sorting apparatus of any one of claims 8 to 10, wherein the data sorting apparatus further comprises:
the receiving module is used for receiving a setting instruction of the time intensity coefficient;
and the setting module is used for updating the value of the intensity coefficient according to the setting instruction, wherein n is more than or equal to 0 and less than or equal to 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 CN106294414A (en) 2017-01-04
CN106294414B true 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)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932261B (en) * 2017-05-25 2023-08-15 株式会社日立制作所 Method and device for updating business data processing information table of knowledge base
CN109460210B (en) * 2018-10-22 2020-11-03 重庆中科云从科技有限公司 Sorting 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 (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100522029B1 (en) * 2005-07-27 2005-10-18 엔에이치엔(주) Method and system for detecting in real-time search terms whose popularity increase rapidly
CN104537059B (en) * 2014-12-27 2018-06-19 小米科技有限责任公司 object ranking method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN106294414A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
US10652311B2 (en) Computerized system and method for determining and communicating media content to a user based on a physical location of the user
US9356901B1 (en) Determining message prominence
US20190102798A1 (en) Systems and methods to create a geographic heatmap
JP5276746B1 (en) Information sharing system using maps
US8775420B2 (en) Text display of geo-referenced information based on relative distance to a user location
Gill et al. Getting virtual 3D landscapes out of the lab
US9363634B1 (en) Providing context-relevant information to users
CN108141702B (en) Context-aware location sharing service
US20170344552A1 (en) Computerized system and method for optimizing the display of electronic content card information when providing users digital content
JP5413170B2 (en) Annotation display system, method and server apparatus
CN114730329A (en) Computerized system and method for generating and dynamically updating control panels for multiple processes and operations across platforms
JP7119124B2 (en) Action indicator for search behavior output element
EP2883160A1 (en) Generating queries based upon data points in a spreadsheet application
US11599571B2 (en) Generic card feature extraction based on card rendering as an image
JP7167229B2 (en) Fusion relationship network construction method, fusion relationship network construction device, electronic device, storage medium, and program
CN103473253A (en) Geocoded data detection and user interfaces for same
CN106294414B (en) Data sorting method and device
US20180197109A1 (en) Methods and Systems for Ranking Comments on a Post in an Online Service
US20200117759A1 (en) Automatic analysis of digital messaging content method and apparatus
US10891303B2 (en) System and method for editing dynamically aggregated data
US10204167B2 (en) Two-dimension indexed carousels for in situ media browsing on mobile devices
JP5425174B2 (en) Information processing apparatus and method
CN112732652A (en) Information display method and device and electronic equipment
CN104133845A (en) Multimedia information display method and multimedia information display processing equipment
Pannevis et al. Using web-sources for location based systems on mobile phones

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