CN108052309A - A kind of object order method and device - Google Patents
A kind of object order method and device Download PDFInfo
- Publication number
- CN108052309A CN108052309A CN201711429718.2A CN201711429718A CN108052309A CN 108052309 A CN108052309 A CN 108052309A CN 201711429718 A CN201711429718 A CN 201711429718A CN 108052309 A CN108052309 A CN 108052309A
- Authority
- CN
- China
- Prior art keywords
- array
- value
- length
- array element
- index sequence
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/76—Arrangements for rearranging, permuting or selecting data according to predetermined rules, independently of the content of the data
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides a kind of object order method, which is characterized in that the described method includes:It determines to treat ranked object;Target signature is obtained from the characteristic set treated ranked object and possessed;Obtain the corresponding characteristic value of the target signature;According to default conversion function, the corresponding characteristic value of the target signature of the acquisition is converted into index sequence value;Treat that ranked object is ranked up to described according to the index sequence value of the conversion.
Description
Technical field
This application involves computer application field more particularly to a kind of object order method and devices.
Background technology
In computer application field, frequently refer to be ranked up object according to the feature of a certain class object, with
Just the processing of next step is carried out.Such as on certain shopping platform, for a certain group of commodity on sale, such as tealeaves, buyer can root
Commodity are ranked up according to the price feature or sales volume feature of commodity, to determine the commodity given priority to purchasing.It currently exists
Substantial amounts of sort algorithm, such as insertion sort, selected and sorted, quicksort.Existing sort algorithm is in time complexity and sky
Between respectively have quality in complexity, its time complexity and space complexity are often into contravariant relation, it is impossible to while take into account the time and answer
Miscellaneous degree and space complexity, time complexity and space complexity cannot be optimal simultaneously, therefore under different scenes, institute
The sort algorithm of use also differs.Such as in some scenes, Installed System Memory is less, the requirement of real-time for program is not
It is too high, then it can select the algorithm that time complexity is higher and space complexity is relatively low;It, whereas if will to the real-time of program
It asks very high and Installed System Memory is sufficient, then select the highest algorithm of time complexity as far as possible.There is an urgent need to a kind of sequences now to calculate
Method, its time complexity and space complexity are attained by relatively low effect.
The content of the invention
In view of this, the application provides a kind of object order method and device.
Specifically, the application is achieved by the following technical solution:
A kind of object order method, the described method includes:
It determines to treat ranked object;
Target signature is obtained from the characteristic set treated ranked object and possessed;
Obtain the corresponding characteristic value of the target signature;
According to default conversion function, the corresponding characteristic value of the target signature of the acquisition is converted into index sequence
Value;
Treat that ranked object is ranked up to described according to the index sequence value of the conversion.
A kind of object order device, which is characterized in that described device includes:
Object determination unit, for determining to treat ranked object;
Target signature acquiring unit, for obtaining target signature from the characteristic set treated ranked object and possessed;
Characteristic value acquiring unit, for obtaining the corresponding characteristic value of the target signature;
Scaling unit, for according to default conversion function, by the corresponding characteristic value of the target signature of the acquisition
It is converted into index sequence value;
Sequencing unit treats that ranked object is ranked up for the index sequence value according to the conversion to described.
By the technical solution of the application, when being ranked up to object, time complexity and sky can be taken into account simultaneously
Between complexity, time complexity is O (n) and space complexity is O (N+n), the characteristic value number that wherein n is included for the group, N
It is characterized the number that value is converted into index sequence value value by default conversion function.
Description of the drawings
It is required attached in being described below to embodiment in order to illustrate more clearly of the technical solution of the embodiment of the present application
Figure is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments described in the application, for
For those of ordinary skill in the art, other attached drawings are can also be obtained according to these attached drawings.
Fig. 1 is a kind of implementing procedure figure of the object order method shown in one exemplary embodiment of the application;
Fig. 2 is the list-head arrays of the foundation shown in one exemplary embodiment of the application and the schematic diagram of temp arrays;
Fig. 3 is the schematic diagram of the existing data arrays shown in one exemplary embodiment of the application;
Fig. 4 to Figure 13 is adding temp array elements when traveling through data arrays shown in one exemplary embodiment of the application
Enter the pilot process of each array element chained list of list-head arrays;
Figure 14 is a kind of structure diagram of the object order device shown in one exemplary embodiment of the application.
Specific embodiment
Here exemplary embodiment will be illustrated in detail, example is illustrated in the accompanying drawings.Following description is related to
During attached drawing, unless otherwise indicated, the same numbers in different attached drawings represent the same or similar element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended
The example of the consistent apparatus and method of some aspects be described in detail in claims, the application.
It is only merely for the purpose of description specific embodiment in term used in this application, and is not intended to be limiting the application.
It is also intended in the application and " one kind " of singulative used in the attached claims, " described " and "the" including majority
Form, unless context clearly shows that other meanings.It is also understood that term "and/or" used herein refers to and wraps
Containing one or more associated list items purposes, any or all may be combined.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application
A little information should not necessarily be limited by these terms.These terms are only used for same type of information being distinguished from each other out.For example, it is not departing from
In the case of the application scope, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as
One information.Depending on linguistic context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determining ".
A kind of object order method provided by the embodiments of the present application is illustrated first, this method can include following step
Suddenly:
It determines to treat ranked object;
Target signature is obtained from the characteristic set treated ranked object and possessed;
Obtain the corresponding characteristic value of the target signature;
According to default conversion function, the corresponding characteristic value of the target signature of the acquisition is converted into index sequence
Value;
Treat that ranked object is ranked up to described according to the index sequence value of the conversion.
It is stated in the background, in computer application field, frequently refer to the feature pair according to a certain class object
Object is ranked up, to be further processed.Such as on certain shopping platform, for a certain group of commodity on sale, such as tealeaves,
Buyer can be ranked up commodity according to the price feature or sales volume feature of commodity, to determine the commodity given priority to purchasing.
Since existing sort algorithm respectively has quality on time complexity and space complexity, this application provides a kind of new
Sort algorithm, its time complexity and space complexity are attained by relatively low effect.
Specifically during object order, determine to treat ranked object, it is described to treat that ranked object be certain class commodity,
Can also be examined in some school, Entrance Examination;It is special that target is obtained from the characteristic set treated ranked object and possessed
Sign, the target signature can be the price feature of certain commodity on sale or sales volume feature or favorable comment degree feature;Obtain the target
The corresponding characteristic value of feature, such as above-mentioned described sales volume feature can obtain the specific sales volume of each commodity;According to default
The corresponding characteristic value of the target signature of the acquisition is converted into index sequence value by conversion function, for participating in sequence
One group objects, the corresponding characteristic value of target signature should can carry out " finite sequence ", i.e., according to certain conversion function
The corresponding characteristic value of the target signature be possible to value can be correspondingly converted by certain conversion function it is limited
Nonnegative integer (sequential value) in section, and magnitude relationship is constant, one-to-one corresponding means that different property values is bound to convert
Into different integers, if magnitude relationship, which remains unchanged, means that characteristic value A is more than characteristic value B, corresponding index sequence value a
Also centainly it is more than b;Treat that ranked object is ranked up to described according to the index sequence value of the conversion.In order to the application into one
Step explanation, provides the following example and the application is illustrated:
As shown in Figure 1, being a kind of implementing procedure figure of the application object order method, it can specifically include following step
Suddenly:
S101 determines to treat ranked object;
In one embodiment, as mentioned in the background art, in computer application field, frequently refer to a kind of according to certain
The feature of object is ranked up object, such as stated in the background, on certain shopping platform, on sale for a certain group
Commodity, such as tealeaves, buyer can be ranked up commodity according to the price feature or sales volume feature of commodity, excellent to determine
The commodity first bought.Therefore it needs to be determined that object to be sorted on for example above-mentioned shopping platform, wherein object to be sorted can
To be fruit, daily necessities etc..
S102 obtains target signature from the characteristic set treated ranked object and possessed;
In one embodiment, it is described to treat that ranked object generally possesses many features, such as above-mentioned described tealeaves, possess
The features such as price feature, sales volume feature, favorable comment degree.It is special that target is obtained in the characteristic set treated ranked object and possessed
Sign, such as above-mentioned described price feature, sales volume feature, favorable comment degree feature are obtained, such as ranked object is treated as certain Middle School Students,
Can obtain student height feature, weight feature etc., to assess the growth and development situation of student.
S103 obtains the corresponding characteristic value of the target signature;
In one embodiment, the corresponding characteristic value of the target signature, such as above-mentioned described sales volume feature are obtained, is obtained
Different sellers are 1000 to the sales volume of the different sales volumes of fruit, such as 1 fruit of seller, and the sales volume of 2 fruit of seller is 15000, is sold
3 fruit of family are sales volume 8000 ..., obtain the corresponding specific sales volume value of above-mentioned sales volume feature.
The corresponding characteristic value of the target signature of the acquisition according to default conversion function, is converted into rope by S104
Draw sequential value;
In one embodiment, for the object of one group of participation sequence, current k represents the characteristic value of subject object feature,
" finite sequence " should can be carried out according to certain conversion function, i.e. this feature is possible to value and can be changed by certain
Function, the nonnegative integer being converted into correspondingly in finite interval are calculated, and magnitude relationship remains unchanged.One-to-one corresponding means
Different property values is bound to be converted into different integers, and finite interval means that the value range of characteristic value k is not too greatly (no
Even if being that the too big data for being meant that all values all exist, can also all be listed in the calculator memory of restriction), greatly
Small relation, which remains unchanged, means that if characteristic value A is more than characteristic value B, corresponding scaling results a and is also centainly more than b.
Wherein k can be integer or decimal or character string or other data that can be arbitrarily compared, but
The value range for being acquiescence k in the application is limited.Such as k is integer, and its value range is -10000~10000, then
It has 20001 possible values.
According to default conversion function, the corresponding characteristic value k of the target signature of the acquisition is converted into index sequence
Train value, wherein representing sequence index value here with k-index.After characteristic value k is got, it is thus necessary to determine that the number of k, such as
N k is got, number is 0,1,2 respectively ... ..., n-1, and respectively with k [0], k [1] ... ..., k [n-1] are represented, then incite somebody to action this
N k of secondary acquisition is converted into an one-to-one k-index according to default conversion function, the magnitude relationship of k with it is corresponding
K-index magnitude relationships are identical, i.e., the conversion function can be understood as k-index=f (k), and wherein conversion function f is a letter
Strict increase function of the number not higher than 1 for several times, and k-index is nonnegative integer.Function number is smaller, and k-index value ranges are got over
Small, then algorithm is more excellent (space complexity for making entire sort algorithm is lower).Such as wherein default conversion function can be
K-index=k-k (min), k (min) represent the minimum possible value of k, and k is integer and its value range is -10000~10000,
Then N=20001, the N are the number of k-index values, and k values -10000 correspond to k-index values 0, and k values -9999 correspond to k-
Index values 1 ... ..., k values 10000 correspond to k-index values 20000.
For specific sort algorithm using which kind of conversion function depend on treat ranked object target signature or
All features that computer system treats ranked object are analyzed, and determine that some is characterized as default feature, are given tacit consent to the spy
It levies corresponding conversion function characteristic value k is converted into k-index and be ranked up, such as in certain shopping platform, user, which determines, to be needed
After certain that be bought class commodity, user oneself can select its feature to be ranked up, the target that internal system is chosen according to user
Characteristic value k is converted into k-index and is ranked up by the corresponding conversion function of feature, and certain user can not also use and select some
Feature, internal system acquiescence is ranked up with some feature, such as is given tacit consent to and be ranked up with price feature.
S105 treats that ranked object is ranked up according to the index sequence value of the conversion to described.
In one embodiment, two empty arrays that length is n and N are created, wherein what the empty array of two created occupied
Memory headroom is contiguous memory space, and n is the number for the characteristic value for participating in sequence, and N is characterized value and passes through default conversion letter
Number is converted into index sequence value, the number of sequence index value value.As illustrated in fig. 2, it is assumed that now with one group of data totally 10, i.e.,
There are 10 k values, the wherein value range of the corresponding k-index of k values is 0~20, totally 21, then above-mentioned described establishment length
For two empty arrays of n and N, it is meant that create two arrays, array element is respectively 10 and 21, wherein array element
Temp arrays are named into for the time being for the arrays of 10, and array element is that the array of 21 names into list-head arrays for the time being, often
Lattice represent a data, are that sky represents array element as invalid value in lattice, and array index is represented as above lattice.
Travel through the index sequence value corresponding to i-th of array element for obtaining the characteristic value array successively from the beginning to the end,
According to the index sequence value corresponding to i-th of array element, i-th of array element of the array that the length is n is added
In the chained list for entering j-th of array element of the array that the length is N, wherein the j-1 and i-th of array element institute are right
The index sequence value answered is equal, and the i values are in 1,2,3 ... ..., n, and the j values are in 1,2,3 ... ..., N.As shown in Figure 3
Value array is characterized, names into data arrays for the time being, it includes 10 array elements, array index is represented as above lattice, wherein
The k-index that data representative is converted into according to k values in per lattice, wherein the number of temp arrays and list-head arrays at the beginning
Constituent element element is all sky, its subscript value is set to invalid index value, such as be set to -1, the array element number that data arrays include and
The array element number that temp arrays include is consistent, and array element and array element in temp arrays one are a pair of in data arrays
It answers, such as data [0] corresponding with temp [0].Wherein the application is illustrated exemplified by being sequentially ranked up from small to large.Now
Start to travel through the corresponding kindex of data array array elements to the end from tail to fill temp arrays and list-head arrays.From
Head obtains the corresponding k-index of data array array elements to tail traversal, obtains the corresponding k-index of data [9], that is, obtains
The 10th corresponding k-index of array element of data arrays, i.e., above-mentioned described i is 10 at this time, according to its k value according to default
Conversion function converses k-index as 3, such as the data " 3 " stored in the 10th grid of data arrays, according to the k-index
Value for 3, by the tenth element of the temp arrays, i.e. temp [9] is added to list-head [3], that is, list-
4th array element of head arrays and above-mentioned described j are 4 at this time, it is meant that list-head [3] is directed toward temp at this time
[9], as shown in Figure 4;The corresponding k-index of data [8] are obtained, it is 5 to converse k-index according to its k value, this season list-
Head [5] is directed toward temp [8], as shown in Figure 5;The corresponding k-index of data [7] are obtained, k-index is conversed according to its k value
For 6, this season list [6] is directed toward temp [7], as shown in Figure 6;The corresponding k-index of data [6] are obtained, are converted according to k values are gone
It is 5 to go out k-index, at this time since list-head [5] has been directed to temp [8], therefore temp [6] is made to be directed toward temp [8], then made
List-head [5] is directed toward temp [6], as shown in Figure 7;The corresponding k-index of data [5] are obtained, k- is conversed according to k values
Index is 17, this season list-head [17] is directed toward temp [5], as shown in Figure 8;The corresponding k-index of data [4] are obtained,
It is 5 to converse k-index according to its k value, at this time since list-head [5] has been directed to temp [6], therefore temp [4] is made to be directed toward
Temp [6], then list-head [5] is made to be directed toward temp [4], as shown in Figure 9;The corresponding k-index of data [3] are obtained, according to it
K values converse k-index as 1, this season list-head [1] direction temp [3], as shown in Figure 10;It is corresponding to obtain data [2]
K-index, k-index is conversed as 0 according to its k value, this season list-head [0] direction temp [2], as shown in figure 11;
The corresponding k-index of data [1] are obtained, it is 7 to converse k-index according to its k value, this season list-head [7] is directed toward temp
[1], as shown in figure 12;Obtain data [0] corresponding k-index, it is 3 to converse k-index according to its k value, at this time due to
List-head [3] has been directed to temp [9], therefore temp [0] is made to be directed toward temp [9], then list-head [3] is made to be directed toward temp
[0], as shown in figure 13.It is temp for what is deposited in above list-head arrays and each array element of temp arrays
The subscript value of array, for example, list-head [0] deposit be temp arrays subscript value 2.It has stepped through at this time and has obtained data
The corresponding k-index of each array element of array as shown in Figure 13, exists for temp [0], the temp [9] in temp arrays
On the chained list of the same array element list-head [3] of list-head arrays, wherein temp [0], temp [9] are in list-head
[3] sequencing of the sequencing with data [0], data [9] in data arrays on chained list is consistent, i.e., for list-
In the chained list of each array element of head arrays, the corresponding temp array elements of a plurality of data of identical k values can hang over list-head
In array on the chained list of same array element, the node on same chained list is more forward in temp arrays, is more leaned in the chained list
Before, so as to ensure that the sort algorithm is stable sort algorithm.
Stable sort and unstable sequence are wherein briefly descended herein.If the equal data of the first two that sorts its in sequence
The tandem of row is identical with the tandem of both after sequence, then this sequence becomes stable sort, on the contrary then be not
Stable sort.The meaning of stable sort is, when one group of data is repeatedly sorted according to various features, can guarantee that first sequence (is pressed
According to feature A sort) result next minor sort (according to feature B sort) after, data identical characteristic value B are still according to characteristic value
The result of A sorts, such as one group of commodity on sale, first sorts by its price feature, then by its sales volume feature ordering, if pressing
Stable sort algorithm is used during sales volume feature ordering, then the identical multiple commodity of sales volume will still sort according to price height.
After the corresponding sequence index value of each array element of characteristic value array has been traveled through, the length is traveled through successively as N
Array each array element, to the chained list of each of which array element, read the length on this chained list from the beginning to the end one by one
The array element of the array for n is spent, according to the array element ident value for the array that the length of reading is n, from characteristic value number
Group obtains individual features value and is stored in from the beginning to the end in target array successively.It is corresponded to having traveled through each array element of characteristic value array
Sequence index value after, begin stepping through list-head arrays as stated above, so as into target array replicate data arrays
Element, specifically, each array element in above-mentioned described list-head arrays is traveled through successively, to each of which array element
Chained list, the array elements of the temp arrays on this chained list is read from the beginning to the end one by one, according to the temp arrays of reading
Array element ident value obtains individual features value from characteristic value array and is stored in from the beginning to the end in target array successively.Such as
The chained list of list-head [0], first judges whether list-head [0] is directed toward sky, and judgement, which is learnt, is not pointed towards sky, i.e. list-
There are temp [2] array element in head [0] chained list, temp [2] can be got, so as to which the k values of data [2] are copied to mesh
The dest [0] of array is marked, then judges whether temp [2] is directed toward sky, it is next that judgement learns that temp [2] direction skies then continue to judge
The chained list of array element list-head [1], judges whether list-head [1] is directed toward sky;Judgement, which is learnt, is not pointed towards sky, exists
Temp [3] so as to which data [3] is copied to target array dest [1], and then judges whether temp [3] is directed toward sky, judges
It is empty to know that temp [3] is directed toward, then continues to judge the chained list of next array element list-head [2], whether judges list-head [2]
It is directed toward empty;It is empty that judgement learns that list-head [2] is directed toward, then continues to judge the chained list of list-head [3], judge list-head
[3] whether it is directed toward sky;Judgement is learnt on the chained list of list-head [3] there are temp [0], obtains temp [0], so as to by data
[0] target array dest [2] is copied to, judges whether temp [0] is directed toward sky, judgement learns that temp [0] is directed toward temp [9], from
And data [9] is copied into dest [3], judge whether temp [9] is directed toward sky, judge that temp [9] is directed toward sky and then continues to judge
The chained list of list-head [4], judges whether list-head [4] is directed toward sky ..., judges list-head arrays per number successively
Whether each node of constituent element element chained list is directed toward sky, and until list-head arrays traversal finishes, so far target array is all filled out
Enter the data in data arrays, and sort from small to large according to k values size, be stable sort.
Further, when only being gathered around when ranked object, there are one during feature, need to only create the array that the length is N, traversal
The corresponding index sequence value of each array element in the characteristic value array is obtained, makes the corresponding number of array that the length is N
Constituent element element plus 1, wherein the length is every in the ident value of the corresponding array element of array of N and the index sequence value array
The corresponding index sequence value of a array element is equal, travels through the array that the length is N, uses the default conversion function
The array that the length is N, the ident value of wherein array element non-zero in array element are converted into characteristic value by inverse function, according to
It is secondary to be stored in target array from the beginning to the end.Such as treat that ranked object is one group of cell-phone number, one group of cell-phone number is ranked up, easy
Know that cell-phone number only represents one group of numerical value in itself, each cell-phone number can be regarded as an integer as k values and be ranked up, then this calculation
Method will further optimize, and be specially:List-head is changed to an integer array, and subscript still represents k-index, but each array
The value of element represents that k-index is equal to the number of the data array elements of this array element subscript, it is no longer necessary to temp arrays, phase
If the ranking results answered will be backfilling into data arrays, it is not required that auxiliary space.When initial, list-head arrays are each
Array element is sky;Data arrays (at this moment stable sort is nonsensical) from first to last or from tail to head are traveled through, for each
Array element, is converted into k-index, then makes list-head [k-index] plus 1, such as above-mentioned described list-
Value in head [3] is 2 after data arrays have been traveled through;List-head arrays (sorting from small to large) are from first to last traveled through, are made
With the inverse function of conversion function, value is not converted into k values as k-index and successively fills target for the subscript of 0 array element
In array dest, for each array element in list-head arrays, value therein is just continuously filled in be several in target array
Several k values after having traveled through list-head arrays, are treated that ranked object is also ranked up according to order from small to large and are finished.
If during N > n, creating array of indexes, the array of indexes is used to be non-empty or non-in the array of N to the length
0 array element is indexed.If can be seen that N > n from above-mentioned described example, the process of list-head arrays is traveled through
In, it will have at least N-n array element and be directed toward sky.When N is far longer than n, the chained list for being largely directed toward sky check aobvious
So reduce time efficiency.For this purpose, can further it optimize:One array of indexes of reallocation, is named as index arrays for the time being,
The length of n, for filling in the subscript of non-empty array element in list-head arrays, each array element is sky when initial.
It is empty whenever being directed toward for one when temp array elements are added to the chained list of list-head array elements in traversal data arrays
List-head array element assignment, the subscript of the array element is just successively filled in index arrays first as empty number
(from above-mentioned it is known that is stored in index arrays is that the subscript of list-head non-empty array elements is successively in constituent element element
0、1、3、5、6、7、17).Traversal list-head is changed so that the data of data arrays to be stored in the process of target array dest in order
Into traversal index arrays to directly acquire list-head non-empty array elements, so as to directly skip list-head array middle fingers
To empty array element, the efficiency for traveling through list-head is further promoted.If N is far longer than n, index numbers can also be used
The optimization method of non-zero array element in group index list-head arrays.
By above step, technical scheme travels through one time in data arrays, is traveled through one time in list-head,
There is no the subalgorithm that usage time complexity exceeds O (n) or O (N), the time complexity of this algorithm is O (n+N), when N is no more than
N or no more than it is too many when, O (n+N) is equivalent to O (n);Otherwise using (non-zero) number of non-empty in index array indexings list-head
The optimization method of constituent element element, the time complexity of traversal index arrays is O (n), indexes non-empty (non-zero) in list-had accordingly
The time complexity of array element is also O (n), therefore the time complexity of technical scheme is O (n).Present techniques
Scheme needs to distribute two arrays, and each array element needs to occupy C byte of memory, then the memory that technical scheme needs
For (N+n) × C bytes, therefore the space complexity of this algorithm is O (N+n).
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through
The relevant hardware of program instruction is completed, and foregoing program can be stored in computer read/write memory medium, which exists
During execution, execution the step of including above method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or CD
Etc. the various media that can store program code.
It is corresponding with the embodiment of aforementioned object sort method, present invention also provides the embodiment of object order device,
As shown in figure 14, including object determination unit 200, target signature acquiring unit 210, characteristic value acquiring unit 220, scaling unit
230th, sequencing unit 240.
The object determination unit 200, for determining to treat ranked object;
The target signature acquiring unit 210, for obtaining mesh from the characteristic set treated ranked object and possessed
Mark feature;
The characteristic value acquiring unit 220, for obtaining the corresponding characteristic value of the target signature;
The scaling unit 230, it is for according to default conversion function, the target signature of the acquisition is corresponding
Characteristic value is converted into index sequence value;
The sequencing unit 240 treats that ranked object is ranked up for the index sequence value according to the conversion to described.
In a kind of specific embodiment of the application, the scaling unit 230 is specifically used for:
According to default conversion function, the corresponding characteristic value of the target signature of the acquisition is converted into one and its
One-to-one index sequence value, and the index sequence value is nonnegative integer.
In a kind of specific embodiment of the application, the sequencing unit 240 specifically includes:Array creates subelement
241st, the first traversal subelement 242, second travels through subelement 243
The array creates subelement 241, for creating two empty arrays that length is n and N, wherein two created
The memory headroom that empty array occupies is contiguous memory space, and n is the number for the characteristic value for participating in sequence, and N is characterized value process
Default conversion function is converted into index sequence value, the number of sequence index value value;
The first traversal subelement 242, it is corresponding for traveling through each array element in acquisition characteristic value array successively
Sequence index value, according to the corresponding index sequence value of each array element that the traversal obtains, by the array that the length is n
Array element be added to the length be N array array element chained list in;
The second traversal subelement 243, for having obtained the corresponding sequence of each array element of characteristic value array in traversal
After column index value, each array element chained list for the array that the length is N is traveled through, according to the every of the array that the length is N
The length added on a array element chained list is the array element of the array of n, and individual features value is obtained from characteristic value array
It is stored in from the beginning to the end in target array successively.
In a kind of specific embodiment of the application, the first traversal subelement 242 is specifically used for:
Travel through the index sequence value corresponding to i-th of array element for obtaining the characteristic value array successively from the beginning to the end,
According to the index sequence value corresponding to i-th of array element, i-th of array element of the array that the length is n is added
In the chained list for entering j-th of array element of the array that the length is N, wherein the j-1 and i-th of array element institute are right
The index sequence value answered is equal, and the i values are in 1,2,3 ... ..., n, and the j values are in 1,2,3 ... ..., N.
In a kind of specific embodiment of the application, the second traversal subelement 243 is specifically used for:
Traversal obtained the corresponding sequence index value of each array element of characteristic value array after, successively from the beginning to the end or from
Tail travels through each array element for the array that the length is N to the end, to the chained list of each of which array element, one by one from the beginning to the end
The array element for the array that the length on this chained list is n is read, according to the array member for the array that the length of reading is n
Plain ident value obtains individual features value from characteristic value array and is stored in from the beginning to the end in target array successively.
In a kind of specific embodiment of the application, the array creates subelement 241 and further includes:Array of indexes creates
Subelement 241a
The array of indexes creates subelement 241a, if during for N > n, creating array of indexes, the array of indexes is used
Non-empty or non-zero array element are indexed in the length for the array of N.
The effect realization process of unit specifically refers to the realization process that step is corresponded in the above method in above system,
Details are not described herein.
For system embodiment, since it corresponds essentially to embodiment of the method, so related part is real referring to method
Apply the part explanation of example.System embodiment described above is only schematical, wherein described be used as separating component
The unit of explanation may or may not be physically separate, and the component shown as unit can be or can also
It is not physical location, you can be located at a place or can also be distributed in multiple network element.It can be according to reality
It needs that some or all of module therein is selected to realize the purpose of application scheme.Those of ordinary skill in the art are not paying
In the case of going out creative work, you can to understand and implement.
The present invention can be described in the general context of calculated value executable instruction performed by computer, such as program
Module.Usually, program module includes routines performing specific tasks or implementing specific abstract data types, program, object, group
Part, data structure etc..The present invention can also be put into practice in a distributed computing environment, in these distributed computing environment, by
Task is performed and connected remote processing devices by communication network.In a distributed computing environment, program module can be with
In the local and remote computer storage media including storage device.
The above is only the specific embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should
It is considered as protection scope of the present invention.
Claims (10)
- A kind of 1. object order method, which is characterized in that the described method includes:It determines to treat ranked object;Target signature is obtained from the characteristic set treated ranked object and possessed;Obtain the corresponding characteristic value of the target signature;According to default conversion function, the corresponding characteristic value of the target signature of the acquisition is converted into index sequence value;Treat that ranked object is ranked up to described according to the index sequence value of the conversion.
- 2. according to the method described in claim 1, it is characterized in that, described according to default conversion function, by the acquisition The corresponding characteristic value of the target signature is converted into index sequence value, including:According to default conversion function, the corresponding characteristic value of the target signature of the acquisition is converted into one with it one by one Corresponding index sequence value, and the index sequence value is nonnegative integer.
- 3. according to claim 1 to 2 any one of them method, which is characterized in that the index sequence according to the conversion Value treats that ranked object is ranked up to described, including:Two empty arrays that length is n and N are created, wherein the memory headroom that the empty array of two created occupies is in continuous Space is deposited, n is the number for the characteristic value for participating in sequence, and N is characterized value and is converted into index sequence value by default conversion function, The number of sequence index value value;Traversal obtains the corresponding index sequence value of each array element in characteristic value array successively, is obtained according to the traversal every The corresponding index sequence value of a array element, the number that the length is N is added to by the array element for the array that the length is n In the chained list of the array element of group;After traversal has obtained the corresponding index sequence value of each array element of characteristic value array, the number that the length is N is traveled through Each array element chained list of group, according to the length added on each array element chained list for the array that the length is N For the array element of the array of n, obtain individual features value from characteristic value array and be stored in from the beginning to the end in target array successively.
- 4. according to the method described in claim 3, it is characterized in that, the traversal successively obtains each array in characteristic value array The corresponding index sequence value of element, according to the corresponding index sequence value of each array element that the traversal obtains, by the length In the chained list for the array element that the array element for spending the array for n is added to the array that the length is N, including:Travel through the index sequence value corresponding to i-th of array element for obtaining the characteristic value array successively from the beginning to the end, according to The length is added in institute by the index sequence value corresponding to i-th of array element for i-th of array element of the array of n In the chained list for stating j-th of array element of the array that length is N, wherein i-th of array element that the length is the array of n adds Enter the head of the chained list of j-th of array element of the array that the length is N, the j-1 and i-th of array element institute are right The index sequence value answered is equal, and the i values are in 1,2,3 ... ..., n, and the j values are in 1,2,3 ... ..., N.
- 5. according to the method described in claim 4, it is characterized in that, described obtained each array member of characteristic value array in traversal After the corresponding index sequence value of element, each array element chained list for the array that the length is N is traveled through, is N according to the length Array each array element chained list on the length that adds in be n array array element, obtained from characteristic value array Individual features value is stored in target array from the beginning to the end successively, including:Traversal obtained the corresponding index sequence value of each array element of characteristic value array after, successively from the beginning to the end or from tail to Head travels through each array element for the array that the length is N, to the chained list of each of which array element, reads from the beginning to the end one by one The array element for the array that the length on this chained list is n, according to the array element mark for the array that the length of reading is n Knowledge value obtains individual features value from characteristic value array and is stored in from the beginning to the end in target array successively.
- 6. according to claim 3 to 5 any one of them method, which is characterized in that the method further includes:It is only gathered around when ranked object there are one during feature, need to only create the array that the length is N, traversal obtains the characteristic value The corresponding index sequence value of each array element in array, the corresponding array element of array that the length is made to be N add 1, wherein The length is that the ident value of the corresponding array element of array of N is corresponding with each array element in the index sequence value array Index sequence value it is equal, in traversal obtains the characteristic value array after the corresponding index sequence value of each array element, time Go through the length be N array, using the default conversion function inverse function by the length be N array, wrapped The ident value of non-zero array element is converted into characteristic value in the array element contained, is stored in target array from the beginning to the end successively.
- 7. according to the method described in claim 6, it is characterized in that, the method further includes:If during N > n, creating array of indexes, the array of indexes is used to be non-empty or non-zero number in the array of N to the length Constituent element element is indexed.
- 8. a kind of object order device, which is characterized in that described device includes:Object determination unit, for determining to treat ranked object;Target signature acquiring unit, for obtaining target signature from the characteristic set treated ranked object and possessed;Characteristic value acquiring unit, for obtaining the corresponding characteristic value of the target signature;Scaling unit, for according to default conversion function, the corresponding characteristic value of the target signature of the acquisition to be converted Into index sequence value;Sequencing unit treats that ranked object is ranked up for the index sequence value according to the conversion to described.
- 9. device according to claim 8, which is characterized in that the scaling unit is specifically used for:According to default conversion function, the corresponding characteristic value of the target signature of the acquisition is converted into one with it one by one Corresponding index sequence value, and the index sequence value is nonnegative integer.
- 10. according to claim 8 to 9 any one of them device, which is characterized in that the sequencing unit specifically includes:Array Create subelement, the first traversal subelement, the second traversal subelementThe array creates subelement, for creating two empty arrays that length is n and N, wherein the empty array of two created The memory headroom of occupancy is contiguous memory space, and n is the number for the characteristic value for participating in sequence, and N is characterized value by default Conversion function is converted into index sequence value, the number of sequence index value value;The first traversal subelement obtains the corresponding index sequence of each array element in characteristic value array for traveling through successively Value, it is according to the corresponding index sequence value of each array element that the traversal obtains, the array for the array that the length is n is first Element is added in the chained list of the array element for the array that the length is N;The second traversal subelement, for having obtained the corresponding index sequence value of each array element of characteristic value array in traversal Afterwards, each array element chained list for the array that the length is N is traveled through, according to each array member for the array that the length is N The length added on plain chained list is the array element of the array of n, and individual features value is obtained successively from the beginning from characteristic value array It is stored in tail in target array.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711429718.2A CN108052309A (en) | 2017-12-26 | 2017-12-26 | A kind of object order method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711429718.2A CN108052309A (en) | 2017-12-26 | 2017-12-26 | A kind of object order method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN108052309A true CN108052309A (en) | 2018-05-18 |
Family
ID=62131870
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711429718.2A Pending CN108052309A (en) | 2017-12-26 | 2017-12-26 | A kind of object order method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108052309A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110580675A (en) * | 2019-09-11 | 2019-12-17 | 北京华大九天软件有限公司 | Matrix storage and calculation method suitable for GPU hardware |
| CN114637745A (en) * | 2022-02-25 | 2022-06-17 | 上海云轴信息科技有限公司 | A data sorting method and device for sorting parameters |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040193839A1 (en) * | 2003-03-27 | 2004-09-30 | Graham Kirsch | Data reordering processor and method for use in an active memory device |
| CN1612100A (en) * | 2003-10-27 | 2005-05-04 | 陈启星 | Hierarchical positioning ordering and hierarchical positioning searching dynamic search table algorithm |
| CN101133414B (en) * | 2005-05-24 | 2011-05-04 | 特博数据实验室公司 | Multiprocessor system and its information processing method |
-
2017
- 2017-12-26 CN CN201711429718.2A patent/CN108052309A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20040193839A1 (en) * | 2003-03-27 | 2004-09-30 | Graham Kirsch | Data reordering processor and method for use in an active memory device |
| CN1612100A (en) * | 2003-10-27 | 2005-05-04 | 陈启星 | Hierarchical positioning ordering and hierarchical positioning searching dynamic search table algorithm |
| CN101133414B (en) * | 2005-05-24 | 2011-05-04 | 特博数据实验室公司 | Multiprocessor system and its information processing method |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110580675A (en) * | 2019-09-11 | 2019-12-17 | 北京华大九天软件有限公司 | Matrix storage and calculation method suitable for GPU hardware |
| CN114637745A (en) * | 2022-02-25 | 2022-06-17 | 上海云轴信息科技有限公司 | A data sorting method and device for sorting parameters |
| CN114637745B (en) * | 2022-02-25 | 2025-06-24 | 上海云轴科技股份有限公司 | A data sorting method and device for sorting parameters |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Benjamini et al. | The mixing time of the giant component of a random graph | |
| Cherven | Mastering Gephi network visualization | |
| US10936950B1 (en) | Processing sequential interaction data | |
| CN110008399A (en) | A kind of training method and device, a kind of recommended method and device of recommended models | |
| Lovelace et al. | Evaluating the performance of iterative proportional fitting for spatial microsimulation: new tests for an established technique | |
| Cheng et al. | Air traffic control using genetic search techniques | |
| Eklöf et al. | Secondary extinctions in food webs: a Bayesian network approach | |
| CN105264488B (en) | For using array to merging the method and system of ordered list | |
| CN106023015A (en) | Course learning path recommending method and device | |
| Zheng et al. | Improving the efficiency of multi-objective evolutionary algorithms through decomposition: An application to water distribution network design | |
| CN112800236B (en) | Method, device and storage medium for generating learning path based on knowledge graph | |
| CN118427370B (en) | Large language model-based text generation method and device, storage medium and computer equipment | |
| Caramia et al. | Coloring graphs by iterated local search traversing feasible and infeasible solutions | |
| CN107193467A (en) | Method and apparatus for showing smart pen written contents | |
| Griffiths et al. | Evolutionary heritage shapes tree distributions along an Amazon‐to‐Andes elevation gradient | |
| CN112579876A (en) | Information pushing method, device and system based on user interest and storage medium | |
| CN106874955A (en) | A kind of 3D shape sorting technique based on depth convolutional neural networks | |
| CN110674178A (en) | Method and system for constructing user portrait label | |
| CN108052309A (en) | A kind of object order method and device | |
| CN116932488B (en) | Courseware generation method, device and system based on knowledge graph and storage medium | |
| CN107247753A (en) | A kind of similar users choosing method and device | |
| Perez-Lamarque et al. | Distinguishing cophylogenetic signal from phylogenetic congruence clarifies the interplay between evolutionary history and species interactions | |
| Tubb et al. | The divergent interface: Supporting creative exploration of parameter spaces | |
| CN111444076A (en) | Method and device for recommending test case steps based on machine learning model | |
| Chambal et al. | A practical procedure for customizable one-way sensitivity analysis in additive value models |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180518 |
|
| RJ01 | Rejection of invention patent application after publication |