CN110362297A - A kind of element sort method and device - Google Patents

A kind of element sort method and device Download PDF

Info

Publication number
CN110362297A
CN110362297A CN201810251552.8A CN201810251552A CN110362297A CN 110362297 A CN110362297 A CN 110362297A CN 201810251552 A CN201810251552 A CN 201810251552A CN 110362297 A CN110362297 A CN 110362297A
Authority
CN
China
Prior art keywords
weight
station location
location marker
current location
identity
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
Application number
CN201810251552.8A
Other languages
Chinese (zh)
Inventor
马盼盼
魏大安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810251552.8A priority Critical patent/CN110362297A/en
Publication of CN110362297A publication Critical patent/CN110362297A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Abstract

The invention discloses a kind of element sort method and devices, are related to field of computer technology.One specific embodiment of this method includes: to obtain the current location identity of object element when detecting that stopping carries out drag operation to the object element of user interface;The weight that corresponding element is identified according to the weight of the corresponding element of current location identity and its adjacent position, updates the weight of object element;It is ranked up according to all elements of the updated weight to user interface.The embodiment is by being arranged weight and station location marker in advance for the element of user interface, when user stops the drag operation to object element, the weight of corresponding element is identified according to current location identity and its adjacent position, the weight of object element is updated, so that element sequence, efficient quick and the position without the mobile other elements influenced by sequence can be realized in the weight that the application only updates object element.

Description

A kind of element sort method and device
Technical field
The present invention relates to computer field more particularly to a kind of element sort methods and device.
Background technique
In some displaying lists of application program, allow user's each element in custom lists by way of dragging Sequence.For example, there are six elements of A, B, C, D, E, F in list, and it is shown in the order described above, user can be by dragging It drags element E to put it between elements A and element B, the displaying sequence of list has reformed into A, E, B, C, D, F.
As shown in Figure 1, the prior art is when realizing element position as described above change, it need in advance be each Elemental partition The number of one order of representation, it is assumed that elements A to the corresponding number of element F is 1 to 6, if by the element E of the 5th position It is moved to second position, then needs the sequence of tri- elements of B, C, D successively to move one backward, then by element E from original Beginning position is deleted, then its sequence is revised as 2.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery: needing target element All elements between the home position and target position of element are moved, and then modify the position of object element again.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of element sort method and device, by being in advance user interface Weight and station location marker is arranged in element, when user stops the drag operation to object element, according to current location identity and its Adjacent position identifies the weight of corresponding element, is updated to the weight of object element, so that the application only updates target element Element sequence, efficient quick and the position without the mobile other elements influenced by sequence can be realized in the weight of element.
Realize that above-mentioned purpose provides a kind of element sort method according to an aspect of an embodiment of the present invention.
A kind of element sort method of the embodiment of the present invention, comprising: stop when detecting to the object element of user interface When carrying out drag operation, the current location identity of the object element is obtained;Wherein, each element setting of the user interface The station location marker for having weight and being arranged according to the weight size;According to the weight of the corresponding element of the current location identity and Its adjacent position identifies the weight of corresponding element, updates the weight of the object element;According to updated weight to described The all elements of user interface are ranked up.
Optionally, before the step of current location identity for obtaining the object element, further includes: be the user Unique weight is respectively set in each element at interface, is ranked up according to the size of the weight to all elements;Root It is that the station location marker is respectively set in each element according to weight sequencing result.
Optionally, the weight according to the corresponding element of the current location identity and its adjacent position mark are corresponding The weight of element updates the weight of the object element, comprising: if the current location identity be less than the station location marker and First station location marker, then obtain element corresponding to the current location identity weight and the current location identity Previous station location marker corresponding to element weight;If the current location identity is greater than the station location marker and is not The last one station location marker, then obtain element corresponding to the current location identity weight and the current location identity The weight of element corresponding to the latter station location marker;The half of the sum of two weights that will acquire is as the object element New weight, to update the weight of the object element.
Optionally, described the step of being ranked up according to all elements of the updated weight to the user interface it Before, further includes: judge whether the current location identity is first station location marker or the last one described position mark Know;If the current location identity is first station location marker, the corresponding member of first station location marker is obtained The weight of element, new weight of the half for the weight that will acquire as the object element, to update the object element Weight;If the current location identity is the last one described station location marker, the last one described station location marker pair is obtained The weight for the element answered, new weight of the sum of the weight and preset step-length that will acquire as the object element, to update The weight of the object element.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of element collator is provided.
A kind of element collator of the embodiment of the present invention, comprising: obtain module, detect stopping to user circle for working as When the object element in face carries out drag operation, the current location identity of the object element is obtained;Wherein, the user interface The station location marker that each element is provided with weight and is arranged according to the weight size;Update module, for according to described current The weight of the corresponding element of station location marker and its adjacent position identify the weight of corresponding element, update the power of the object element Weight;Sorting module, for being ranked up according to all elements of the updated weight to the user interface.
Optionally, described device further include: setup module, for being respectively set only for each element of the user interface One weight, is ranked up all elements according to the size of the weight;It and according to weight sequencing result is each The station location marker is respectively set in element.
Optionally, the update module, is also used to: if the current location identity is less than the station location marker and is not First station location marker, then before the weight and the current location identity that obtain element corresponding to the current location identity The weight of element corresponding to one station location marker;If the current location identity is greater than the station location marker and is not last One station location marker, then obtain element corresponding to the current location identity weight and the current location identity it is latter The weight of element corresponding to a station location marker;And the half of the sum of two weights that will acquire is as the object element New weight, to update the weight of the object element.
Optionally, described device further include: update module is judged, for judging whether the current location identity is described First station location marker or the last one described station location marker;If the current location identity is first position mark Know, then obtains the weight of the corresponding element of first station location marker, the half for the weight that will acquire is as the mesh The new weight of element is marked, to update the weight of the object element;And if the current location identity be it is described last A station location marker, then obtain the weight of the corresponding element of the last one station location marker, the weight that will acquire and default New weight of the sum of step-length as the object element, to update the weight of the object element.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment.
The a kind of electronic equipment of the embodiment of the present invention, comprising: one or more processors;Storage device, for storing one A or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more A processor realizes a kind of element sort method of the embodiment of the present invention.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed A kind of element sort method of the embodiment of the present invention is realized when device executes.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that by being in advance the element of user interface Weight and station location marker are set, it is adjacent with its according to current location identity when user stops the drag operation to object element The weight of the corresponding element of station location marker, is updated the weight of object element, so that the application only updates object element Element sequence, efficient quick and the position without the mobile other elements influenced by sequence can be realized in weight;By being in advance Element setting weight and station location marker, subsequent convenience are updated the weight of object element, with the element weight to user interface Newly it is ranked up;After drag operation, the half of the sum of weight of former and later two elements of object element region position is made For new weight, the harmony of data break ensure that.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic illustration of element sort method in the prior art;
Fig. 2 is the schematic diagram of the key step of element sort method according to an embodiment of the present invention;
Fig. 3 is the main flow schematic diagram of element sort method according to an embodiment of the present invention;
Fig. 4 is the weight sequencing result schematic diagram of element sort method according to an embodiment of the present invention;
Fig. 5 is that the weight of element sort method according to an embodiment of the present invention updates schematic diagram;
Fig. 6 is the ranking results schematic diagram of element sort method according to an embodiment of the present invention;
Fig. 7 is the schematic diagram of the main modular of element collator according to an embodiment of the present invention;
Fig. 8 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 9 is the structural schematic diagram for being suitable for the computer installation of the electronic equipment to realize the embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 2 is the schematic diagram of the key step of element sort method according to an embodiment of the present invention.As shown in Fig. 2, this hair The element sort method of bright embodiment, mainly includes the following steps:
Step S201: when detecting that stopping carries out drag operation to the object element of user interface, the target is obtained The current location identity of element;Wherein, each element of the user interface is provided with weight and sets according to the weight size The station location marker set.Some element at user to user interface carries out drag operation, and the element such as can be client Desktop icons, the item for showing list etc..Station location marker is set for each element of user interface in advance, is used to each member of unique identification The current sequence of element.If client detects that user stops carrying out drag operation to object element, obtains the object element and work as The station location marker of the corresponding original element of preceding locating regional location, is marked the station location marker as the current location of object element Know.
Step S202: corresponding member is identified according to the weight of the corresponding element of the current location identity and its adjacent position The weight of element, updates the weight of the object element.It is in advance the unique weight of each element setting of user interface, and according to Weight size is ranked up all elements, and the result of weight sequencing is the current sequence of each element.If object element is worked as Front position mark is less than its station location marker, then illustrates that the object element needs to be ordered into before its home position;If target The current location identity of element is greater than its station location marker, then after illustrating that the object element needs to be ordered into its home position Face;Using the half of the sum of weight of former and later two elements of the object element after dragging as the new weight of the object element.
Step S203: it is ranked up according to all elements of the updated weight to the user interface.This step and step The rule being ranked up according to weight size to all elements in rapid S202 is identical, i.e., ascending or by big according to weight It is ranked up to small sequence, the function of pull to the element of user interface sequence can be realized by the above process.
Fig. 3 is the main flow schematic diagram of element sort method according to an embodiment of the present invention.As shown in figure 3, of the invention The element sort method of embodiment is realized by element collator, is mainly comprised the steps that
Step S301: unique weight is respectively set for each element of user interface, according to the size pair of the weight All elements are ranked up.The attribute of a weight is added for each element of user interface, can identify by weight should Attribute.A step-length (step) is preset in embodiment, the frequency that the value of step-length is sorted by user according to element is customized, row The frequency of sequence is relatively high, then can be by the larger of step-length design, and the frequency of sequence is relatively low, then can design step-length small It is some.When weight is arranged for element, it is assumed that the weight of setting element 1 is 10, step-length 10, then the weight of element 2 is element 1 Weight+step-length (i.e. 10+10=20), the weight of element 3 is weight+step-length (i.e. 20+10=30) of element 2, and so on. When being ranked up to element, it can be ranked up according to descending or ascending sequence.
Fig. 4 is the weight sequencing result schematic diagram of element sort method according to an embodiment of the present invention.As shown in figure 4, working as 6 elements, respectively element 1 to element 6 are shared in preceding user interface, the weight of each element is 10,20,30,40,50 and respectively 60, it is ranked up (i.e. weight is bigger, and sequence is more rearward) according to weight is ascending, obtained order of elements is element 1, element 2, element 3, element 4, element 5 and element 6.
Step S302: being that station location marker is respectively set in each element according to weight sequencing result.The 1st will be come in embodiment The station location marker of a element (i.e. element 1) is set as 1, sets the station location marker for the element (i.e. element 2) for coming the 2nd to 2, and so on.
Step S303: it when detecting that user carries out drag operation to object element, obtains and pulls track and according to described It pulls track and drags the object element.When user carries out drag operation to some element, client detects that the dragging is dynamic After work, the element is dragged according to the dragging track of acquisition.
Step S304: when detecting that user stops carrying out drag operation to the object element, the target element is obtained The current location identity of element.Each element in user interface occupies a regional location, obtain when stopping drag operation described in Regional location where object element, using the station location marker of element original on the regional location working as the object element Front position mark.In a preferred embodiment, it is assumed that need for the element 6 in present user interface to be moved to the 3rd region Position, the i.e. position of element 3.When client detects that element 6 is dragged to the regional location at 3 place of element, then by element 3 Current location identity of the station location marker 3 as element 6.
Step S305: the current location identity is compared with the station location marker of setting, if described current Station location marker is less than the station location marker, thens follow the steps S306;If the current location identity is greater than the station location marker, Then follow the steps S309.The purpose of this step judges that the element is ordered into before home position or back, if sequence It is then dragging sequence forward to before home position;It is dragging sequence backward if being ordered into behind home position.? In one preferred embodiment, it is assumed that need for element 6 to be moved to the 3rd regional location (i.e. dragging sequence forward), the position of element 6 It sets and is identified as 6, current location identity 3 executes step S306 since 3 less than 6;Assuming that needing for element 1 to be moved to the 4th Regional location (i.e. dragging sequence backward), the station location marker of element 1 is 1, current location identity 4, since 4 are greater than 1, executes step Rapid S309.
Step S306: judging whether the current location identity is first station location marker, if the current location is marked Knowing is first station location marker, thens follow the steps S307;If the current location identity is different from first position Mark is set, S308 is thened follow the steps.1st station location marker is 1, in a preferred embodiment, it is assumed that need element 6 It is moved to the 1st regional location, thens follow the steps S307;Assuming that its for needing to be moved to element 6 in addition to the 1st regional location His regional location, thens follow the steps S308.
Step S307: the weight of the corresponding element of acquisition first station location marker, the one of the weight that will acquire The half new weight as the object element executes step S312 to update the weight of the object element.If it is according to power The station location marker (i.e. the small station location marker of weight is small, and the big station location marker of weight is big) of the ascending sequence setting of weight, then originally The new weight of object element can be any positive number smaller than the weight of first station location marker corresponding element in step, but by It might have new element in subsequent and need to be ordered into before the object element, in order to keep the harmony of data break to take this New weight of the half of element weights as object element.In a preferred embodiment, the weight of element 1 is 10, element 6 Weight is 60, the new weight 5 that directly element 6 can be obtained divided by 2 in the weight 10 of element 1, later by the weight of element 6 by 60 It is updated to 5.
In an additional preferred embodiment, if in step S302 being the position according to the descending sequence setting of weight It identifies (i.e. the big station location marker of weight is small, and the small station location marker of weight is big), then the new weight of object element can be in this step It is the weight of first station location marker corresponding element and the sum of preset step-length.
Step S308: obtain the corresponding element of the current location identity weight and the current location identity it is previous The weight of the corresponding element of a station location marker, new power of the half of the sum of two weights that will acquire as the object element Weight executes step S312 to update the weight of the object element.The new weight of object element can in this step and step S311 Be above-mentioned acquisition two weights between any positive number, but might have new element needs due to subsequent and be ordered into this Between object element and its former and later two element, in order to which the half for keeping the harmony of data break to take the sum of the two weights is made For the new weight of object element.In a preferred embodiment, it is assumed that need for element 6 to be moved to the 3rd regional location, the 3rd The original element of a regional location is element 3, weight 30, and the element of the 2nd regional location is element 2, weight 20, Then the new weight of element 6 is (20+30)/2=25, and the weight of element 6 is updated to 25 by 60 later.
Fig. 5 is that the weight of element sort method according to an embodiment of the present invention updates schematic diagram.As shown in figure 5, by element 6 3rd regional location is moved to by the last one regional location, then the new weight of element 6 is (20+30)/2=25.
Step S309: judge whether the current location identity is the last one station location marker, if the current location It is identified as the last one described station location marker, thens follow the steps S310;If the current location identity is different from described last One station location marker, thens follow the steps S311.In a preferred embodiment, it is assumed that 6 elements are shared in present user interface, If necessary to which element 1 is moved to the 6th regional location, S310 is thened follow the steps;If necessary to be moved to element 1 except the 6th Other regional locations outside a regional location, then follow the steps S311.
Step S310: obtaining the weight of the corresponding element of the last one station location marker, the weight that will acquire with New weight of the sum of preset step-length as the object element executes step S312 to update the weight of the object element.Such as Fruit be according to weight it is ascending sequence setting station location marker (i.e. the small station location marker of weight is small, weight it is big position mark Know big), then the new weight of object element can be bigger than the weight of the last one station location marker corresponding element appoint in this step It anticipates positive number, but might have new element due to subsequent and need to be ordered into behind the object element, in order to keep between data Every harmony take the weight of the element and new weight of the sum as object element of step-length.In a preferred embodiment, first The weight of element 6 is 60, and step-length 10, then the new weight of element 1 is 60+10=70, is later updated to the weight of element 1 by 10 70。
In an additional preferred embodiment, if in step S302 being the position according to the descending sequence setting of weight It identifies (i.e. the big station location marker of weight is small, and the small station location marker of weight is big), then the new weight of object element can be in this step It is the half of the weight of the last one station location marker corresponding element.
Step S311: obtain the corresponding element of the current location identity weight and the current location identity it is latter The weight of the corresponding element of a station location marker, new power of the half of the sum of two weights that will acquire as the object element Weight executes step S312 to update the weight of the object element.In a preferred embodiment, it is assumed that need to move element 1 It moves to the 4th regional location, the 4th original element of regional location is element 4, and the element of weight 40, the 5th position is Element 5, weight 50, then the new weight of element 1 is (40+50)/2=45, is later updated to the weight of element 1 by 10 45。
Step S312: it is ranked up according to all elements of the updated weight to the user interface.It is preferred one In embodiment, after element 6 is moved to the 3rd regional location by the last one regional location, new weight is 25, always according to The ascending sequence of weight is ranked up all elements of present user interface, and the element 6 after dragging is located at element 2 and member Between element 3.
Fig. 6 is the ranking results schematic diagram of element sort method according to an embodiment of the present invention.As shown in fig. 6, by element 6 After being moved to the 3rd regional location by the last one regional location, new order of elements is element 1, element 2, element 6, element 3, element 4 and element 5.
Dragging sequence in above-described embodiment for an element is illustrated.In a preferred embodiment, user Multiple elements can be pulled simultaneously, for example pull element 5 and element 6 simultaneously, to be placed individually into the 2nd and the 3rd region position It sets, then can realize element sequence by the way that the above process is performed a plurality of times.
Element sort method through the embodiment of the present invention can be seen that by being in advance the element setting power of user interface Weight and station location marker are marked when user stops the drag operation to object element according to current location identity and its adjacent position The weight for knowing corresponding element is updated the weight of object element, so that the application only updates the weight of object element i.e. Element sequence, efficient quick and the position without the mobile other elements influenced by sequence can be achieved;By being set in advance for element Weight and station location marker are set, subsequent convenience is updated the weight of object element, re-starts with the element to user interface Sequence;After drag operation, the half of the sum of weight of former and later two elements of object element region position is as new power Weight, ensure that the harmony of data break.
Fig. 7 is the schematic diagram of the main modular of element collator according to an embodiment of the present invention.As shown in fig. 7, this hair The element collator 700 of bright embodiment, specifically includes that
Module 701 is obtained, for obtaining institute when detecting that stopping carries out drag operation to the object element of user interface State the current location identity of object element;Wherein, each element of the user interface is provided with weight and according to the weight The station location marker of size setting.Some element at user to user interface carries out drag operation, and the element such as can be visitor The desktop icons at family end, the item for showing list etc..Station location marker is set for each element of user interface in advance, is used to unique mark Know the current sequence of each element.If client detects that user stops carrying out drag operation to object element, the target is obtained Element is presently in the station location marker of the corresponding original element of regional location, using the station location marker as the current of object element Station location marker.
Update module 702, for being identified according to the weight of the corresponding element of the current location identity and its adjacent position The weight of corresponding element updates the weight of the object element.It is in advance the unique power of each element setting of user interface Weight, and all elements are ranked up according to weight size, the result of weight sequencing is the current sequence of each element.If target The current location identity of element is less than its station location marker, then before illustrating that the object element needs to be ordered into its home position Face;If the current location identity of object element is greater than its station location marker, it is original to illustrate that the object element needs to be ordered into its Behind position;Using the half of the sum of weight of former and later two elements of the object element after dragging as the new power of the object element Weight.
Sorting module 703, for being ranked up according to all elements of the updated weight to the user interface.This mould Block is identical as the rule being ranked up according to weight size to all elements in update module 702, i.e., according to weight by it is small to Big or descending sequence is ranked up, and be can be realized by above-mentioned module and is carried out dragging sequence to the element of user interface Function.
In addition, the element collator 700 of the embodiment of the present invention can also include: setup module and judge update module (being not shown in Fig. 7).Wherein, unique power is respectively set for each element for the user interface in setup module Weight, is ranked up all elements according to the size of the weight;And it is set respectively according to weight sequencing result for each element Set the station location marker.Update module is judged, for judging whether the current location identity is first station location marker Or the last one described station location marker;If the current location identity be first station location marker, obtain described in The weight of the corresponding element of first station location marker, new power of the half for the weight that will acquire as the object element Weight, to update the weight of the object element;And if the current location identity is the last one described station location marker, The weight of the corresponding element of the last one described station location marker is obtained, the sum of the weight and preset step-length that will acquire is as institute The new weight of object element is stated, to update the weight of the object element.
From the above, it can be seen that working as user by the way that weight and station location marker is arranged for the element of user interface in advance When stopping the drag operation to object element, the weight of corresponding element is identified according to current location identity and its adjacent position, The weight of object element is updated, so that element sequence can be realized in the weight that the application only updates object element, efficiently Positions quick and without the mobile other elements influenced by sequence;By being in advance that weight and station location marker is arranged in element, after It is continuous that conveniently the weight of object element is updated, sequence is re-started with the element to user interface;After drag operation, mesh The half of the sum of weight of former and later two elements of element region position is marked as new weight, ensure that the equal of data break Weighing apparatus property.
Fig. 8 is shown can be using the element sort method of the embodiment of the present invention or the exemplary system of element collator Framework 800.
As shown in figure 8, system architecture 800 may include terminal device 801,802,803, network 804 and server 805. Network 804 between terminal device 801,802,803 and server 805 to provide the medium of communication link.Network 804 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 801,802,803 and be interacted by network 804 with server 805, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 801,802,803 (merely illustrative) such as the application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform softwares.
Terminal device 801,802,803 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 805 can be to provide the server of various services, such as utilize terminal device 801,802,803 to user Generated click event provides the back-stage management server (merely illustrative) supported.Back-stage management server can be to receiving The data such as click data, content of text analyze etc. processing, and (such as target push information, product are believed by processing result Breath -- merely illustrative) feed back to terminal device.
It should be noted that element sort method provided by the embodiment of the present application generally by terminal device 801,802, 803 execute, and correspondingly, element collator is generally positioned in terminal device 801,802,803.
It should be understood that the number of terminal device, network and server in Fig. 8 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
According to an embodiment of the invention, the present invention also provides a kind of electronic equipment and a kind of computer-readable medium.
Electronic equipment of the invention includes: one or more processors;Storage device, for storing one or more journeys Sequence, when one or more of programs are executed by one or more of processors, so that one or more of processors are real The element sort method of the existing embodiment of the present invention.
Computer-readable medium of the invention is stored thereon with computer program, real when described program is executed by processor The element sort method of the existing embodiment of the present invention.
Below with reference to Fig. 9, it illustrates the computer systems 900 being suitable for realize the electronic equipment of the embodiment of the present invention Structural schematic diagram.Electronic equipment shown in Fig. 9 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in figure 9, computer system 900 includes central processing unit (CPU) 901, it can be read-only according to being stored in Program in memory (ROM) 902 or be loaded into the program in random access storage device (RAM) 903 from storage section 908 and Execute various movements appropriate and processing.In RAM 903, also it is stored with system 900 and operates required various programs and data. CPU 901, ROM 902 and RAM 903 are connected with each other by bus 904.Input/output (I/O) interface 905 is also connected to always Line 904.
I/O interface 905 is connected to lower component: the importation 906 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 907 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 908 including hard disk etc.; And the communications portion 909 of the network interface card including LAN card, modem etc..Communications portion 909 via such as because The network of spy's net executes communication process.Driver 910 is also connected to I/O interface 905 as needed.Detachable media 911, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 910, in order to read from thereon Computer program be mounted into storage section 908 as needed.
Particularly, disclosed embodiment, the process of key step figure description above may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 909, and/or from can Medium 911 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 901, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Key step figure and block diagram in attached drawing, illustrate the system, method and calculating according to various embodiments of the invention The architecture, function and operation in the cards of machine program product.In this regard, each box in flowchart or block diagram can To represent a part of a module, program segment or code, a part of above-mentioned module, program segment or code include one or Multiple executable instructions for implementing the specified logical function.It should also be noted that in some implementations as replacements, box Middle marked function can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated It can actually be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved. It, can be with holding it is also noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet It includes and obtains module, update module and sorting module.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself is also described as " stopping dragging the object element of user interface when detecting for example, obtaining module When dragging operation, the module of the current location identity of the object element is obtained ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: to obtain the object element when detecting that stopping carries out drag operation to the object element of user interface Current location identity;Wherein, each element of the user interface is provided with weight and according to weight size setting Station location marker;The power of corresponding element is identified according to the weight of the corresponding element of the current location identity and its adjacent position Weight, updates the weight of the object element;It is ranked up according to all elements of the updated weight to the user interface.
From the above, it can be seen that working as user by the way that weight and station location marker is arranged for the element of user interface in advance When stopping the drag operation to object element, the weight of corresponding element is identified according to current location identity and its adjacent position, The weight of object element is updated, so that element sequence can be realized in the weight that the application only updates object element, efficiently Positions quick and without the mobile other elements influenced by sequence;By being in advance that weight and station location marker is arranged in element, after It is continuous that conveniently the weight of object element is updated, sequence is re-started with the element to user interface;After drag operation, mesh The half of the sum of weight of former and later two elements of element region position is marked as new weight, ensure that the equal of data break Weighing apparatus property.
Method provided by the embodiment of the present invention can be performed in the said goods, has the corresponding functional module of execution method and has Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present invention.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (10)

1. a kind of element sort method characterized by comprising
When detecting that stopping carries out drag operation to the object element of user interface, the current location of the object element is obtained Mark;Wherein, the station location marker that each element of the user interface is provided with weight and is arranged according to the weight size;
The weight of corresponding element is identified according to the weight of the corresponding element of the current location identity and its adjacent position, is updated The weight of the object element;
It is ranked up according to all elements of the updated weight to the user interface.
2. the method according to claim 1, wherein the current location identity for obtaining the object element Before step, further includes:
Unique weight is respectively set for each element of the user interface, according to the size of the weight to all members Element is ranked up;
It is that the station location marker is respectively set in each element according to weight sequencing result.
3. method according to claim 1 or 2, which is characterized in that described according to the corresponding member of the current location identity The weight of element and its adjacent position identify the weight of corresponding element, update the weight of the object element, comprising:
If the current location identity is less than the station location marker and is not first station location marker, the present bit is obtained Set the weight of element corresponding to the corresponding weight of element of mark and the previous station location marker of the current location identity;
If the current location identity is greater than the station location marker and is not the last one station location marker, obtain described current The power of element corresponding to the latter station location marker of the weight of element corresponding to station location marker and the current location identity Weight;
New weight of the half of the sum of two weights that will acquire as the object element, to update the power of the object element Weight.
4. according to the method described in claim 3, it is characterized in that, it is described according to updated weight to the user interface Before the step of all elements are ranked up, further includes:
Judge whether the current location identity is first station location marker or the last one described station location marker;
If the current location identity is first station location marker, the corresponding member of first station location marker is obtained The weight of element, new weight of the half for the weight that will acquire as the object element, to update the object element Weight;
If the current location identity is the last one described station location marker, it is corresponding to obtain the last one described station location marker Element weight, new weight of the sum of the weight and preset step-length that will acquire as the object element, to update State the weight of object element.
5. a kind of element collator characterized by comprising
Module is obtained, for obtaining the target when detecting that stopping carries out drag operation to the object element of user interface The current location identity of element;Wherein, each element of the user interface is provided with weight and sets according to the weight size The station location marker set;
Update module, for identifying corresponding member according to the weight of the corresponding element of the current location identity and its adjacent position The weight of element, updates the weight of the object element;
Sorting module, for being ranked up according to all elements of the updated weight to the user interface.
6. device according to claim 5, which is characterized in that described device further include: setup module, for being the use Unique weight is respectively set in each element at family interface, is ranked up according to the size of the weight to all elements; And
It is that the station location marker is respectively set in each element according to weight sequencing result.
7. device according to claim 5 or 6, which is characterized in that the update module is also used to:
If the current location identity is less than the station location marker and is not first station location marker, the present bit is obtained Set the weight of element corresponding to the corresponding weight of element of mark and the previous station location marker of the current location identity;
If the current location identity is greater than the station location marker and is not the last one station location marker, obtain described current The power of element corresponding to the latter station location marker of the weight of element corresponding to station location marker and the current location identity Weight;And
New weight of the half of the sum of two weights that will acquire as the object element, to update the power of the object element Weight.
8. device according to claim 7, which is characterized in that described device further include: update module is judged, for judging Whether the current location identity is first station location marker or the last one described station location marker;
If the current location identity is first station location marker, the corresponding member of first station location marker is obtained The weight of element, new weight of the half for the weight that will acquire as the object element, to update the object element Weight;And
If the current location identity is the last one described station location marker, it is corresponding to obtain the last one described station location marker Element weight, new weight of the sum of the weight and preset step-length that will acquire as the object element, to update State the weight of object element.
9. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1-4.
10. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor The method as described in any in claim 1-4 is realized when row.
CN201810251552.8A 2018-03-26 2018-03-26 A kind of element sort method and device Pending CN110362297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810251552.8A CN110362297A (en) 2018-03-26 2018-03-26 A kind of element sort method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810251552.8A CN110362297A (en) 2018-03-26 2018-03-26 A kind of element sort method and device

Publications (1)

Publication Number Publication Date
CN110362297A true CN110362297A (en) 2019-10-22

Family

ID=68212159

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810251552.8A Pending CN110362297A (en) 2018-03-26 2018-03-26 A kind of element sort method and device

Country Status (1)

Country Link
CN (1) CN110362297A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966478A (en) * 2020-08-18 2020-11-20 北京百度网讯科技有限公司 Custom task ordering method and device, electronic device and medium
CN112434182A (en) * 2020-10-29 2021-03-02 北京奇艺世纪科技有限公司 Data storage and acquisition method, device, server and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020178191A1 (en) * 2001-05-24 2002-11-28 International Business Machines Corporation Method and apparatus in a data processing system for list ordering with multiple selection
US20090327940A1 (en) * 2008-06-27 2009-12-31 Microsoft Corporation Notification area that persistently rearranges elements
US20130024763A1 (en) * 2011-07-20 2013-01-24 International Business Machines Corporation Utilizing a graphical transition to sort an interface element independently of a document object model
EP3104281A1 (en) * 2015-06-12 2016-12-14 Thomson Licensing Apparatus and method for processing ranking evolution
CN106354366A (en) * 2016-08-26 2017-01-25 乐视控股(北京)有限公司 Method for treating desktop icons arrangement and device thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020178191A1 (en) * 2001-05-24 2002-11-28 International Business Machines Corporation Method and apparatus in a data processing system for list ordering with multiple selection
US20090327940A1 (en) * 2008-06-27 2009-12-31 Microsoft Corporation Notification area that persistently rearranges elements
US20130024763A1 (en) * 2011-07-20 2013-01-24 International Business Machines Corporation Utilizing a graphical transition to sort an interface element independently of a document object model
EP3104281A1 (en) * 2015-06-12 2016-12-14 Thomson Licensing Apparatus and method for processing ranking evolution
CN106354366A (en) * 2016-08-26 2017-01-25 乐视控股(北京)有限公司 Method for treating desktop icons arrangement and device thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111966478A (en) * 2020-08-18 2020-11-20 北京百度网讯科技有限公司 Custom task ordering method and device, electronic device and medium
CN111966478B (en) * 2020-08-18 2024-02-20 北京百度网讯科技有限公司 Custom task ordering method and device, electronic device and medium
CN112434182A (en) * 2020-10-29 2021-03-02 北京奇艺世纪科技有限公司 Data storage and acquisition method, device, server and storage medium

Similar Documents

Publication Publication Date Title
CN109460513A (en) Method and apparatus for generating clicking rate prediction model
CN109472523A (en) Method and apparatus for sorting cargo
CN108874513A (en) Handle method, system, electronic equipment and the computer-readable medium of timed task
CN110019503A (en) The dilatation of Redis cluster and/or the method and device of capacity reducing
CN110443531A (en) The method and apparatus for determining the bit information of article in order
CN109634833A (en) A kind of Software Defects Predict Methods and device
CN109446274A (en) The method and apparatus of big data platform BI metadata management
CN108776692A (en) Method and apparatus for handling information
CN109783197A (en) Dispatching method and device for program runtime environment
CN110097341A (en) A kind of automation O&M management-control method, device, medium and electronic equipment
CN105300398A (en) Method, device and system for acquiring site information
CN110232487A (en) A kind of task allocating method and device
CN110471848A (en) A kind of method and apparatus of dynamic returned packet
CN109002282A (en) A kind of method and apparatus for realizing animation effect in web page exploitation
CN110362297A (en) A kind of element sort method and device
CN109814957A (en) A kind of label addition method and device for IOS system
CN110046006A (en) The method and apparatus of menu sequencing
CN109960639A (en) A kind of method and apparatus generating test case
CN109960212A (en) Task sending method and device
CN109725988A (en) A kind of method for scheduling task and device
CN108985805A (en) A kind of method and apparatus that selectivity executes push task
CN112381964A (en) Power line inspection configuration method and system
CN108959636A (en) Data processing method, device, system, computer-readable medium
CN110381471A (en) The method and apparatus for determining optimum base station for unmanned vehicle
CN108933823A (en) User's touching reaches method and apparatus

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