List data sorting method and device, electronic equipment and readable storage medium

By introducing the calculation and update operation of position weight values ​​in the sorting of list data, the problem of low sorting efficiency in the existing technology is solved, and efficient custom sorting is realized.

CN120994093APending Publication Date: 2025-11-21SHANGHAI ANXINCHENG NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511291213.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-10
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing list data sorting methods suffer from low sorting efficiency and high time complexity in large-scale lists due to the need for frequent modification of position numbers.

Method used

By converting multiple operations to rearrange the order of list data into a single operation to calculate and update position weights, and then using these position weights for sorting, the time complexity is reduced.

Benefits of technology

It improves the sorting efficiency of list data and enables efficient and smooth custom sorting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994093A_ABST
    Figure CN120994093A_ABST
Patent Text Reader

Abstract

The invention relates to a list data sorting method and device, electronic equipment and a readable storage medium, and the method comprises the steps: responding to a movement operation of a user on target list data in a target list, and determining first reference list data and second reference list data adjacent to a target movement position of the target list data; calculating and updating the position weight value of the target list data based on the position weight value of the first reference list data and the position weight value of the second reference list data; and sorting each piece of list data in the target list based on the position weight value of each piece of list data in the target list. Therefore, multiple sequence adjustment operations of the list data are converted into one calculation updating operation of the position weight value, so that the time complexity of list data sorting is reduced, and the sorting efficiency of the list data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a list data sorting method and device, an electronic device and a readable storage medium. BACKGROUND

[0002] In mobile terminals and web applications, users often need to customize the order of private lists (such as favorites, task lists, star lists, etc.) to meet the needs of personal preferences or priority management.

[0003] The existing list data sorting method sorts the list data of a private list by using a continuously increasing position number, and batch modifies the position numbers of multiple list data each time the order is adjusted. With the expansion of the list size, such overall or batch update makes the sorting operation have a high time complexity, resulting in low efficiency of list data sorting. SUMMARY

[0004] Therefore, the embodiments of the present application provide a list data sorting method, device, electronic device and readable storage medium, which converts multiple order adjustment operations of list data into a calculation and update operation of position weight values, reduces the time complexity of list data sorting, and improves the efficiency of list data sorting.

[0005] The present application mainly includes the following aspects: In a first aspect, the embodiments of the present application provide a list data sorting method, which comprises: In response to a user's moving operation on target list data in a target list, determining first reference list data and second reference list data adjacent to a target moving position of the target list data; Based on the position weight value of the first reference list data and the position weight value of the second reference list data, calculating and updating the position weight value of the target list data; Based on the position weight value of each list data in the target list, sorting each list data in the target list to obtain a target list after the moving operation.

[0006] In a second aspect, the embodiments of the present application further provide a list data sorting device, which comprises: A first determining module is configured to, in response to a user's moving operation on target list data in a target list, determine first reference list data and second reference list data adjacent to a target moving position of the target list data; A second determining module is configured to, based on the position weight value of the first reference list data and the position weight value of the second reference list data, calculate and update the position weight value of the target list data. The list sorting module is configured to sort each list data in the target list based on the position weight value of each list data in the target list, to obtain the target list after the moving operation.

[0007] In a third aspect, an electronic device is provided, which includes a processor, a memory, and a bus. The memory stores machine readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory through the bus. The machine readable instructions, when executed by the processor, perform the steps of the list data sorting method described above.

[0008] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the list data sorting method described above are performed.

[0009] The list data sorting method, device, electronic device, and readable storage medium provided by the embodiments of the present application, wherein the method includes: in response to a moving operation of a target list data in a target list by a user, determining a first reference list data and a second reference list data adjacent to a target moving position of the target list data; calculating and updating a position weight value of the target list data based on a position weight value of the first reference list data and a position weight value of the second reference list data; and sorting each list data in the target list based on the position weight value of each list data in the target list. In this way, the multiple list data order adjustment operations are converted into one position weight value calculation and updating operation, the time complexity of the list data sorting is reduced, and the sorting efficiency of the list data is improved.

[0010] In order to make the above objectives, features and advantages of the present application more apparent, the following will specifically describe preferred embodiments in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0011] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be considered as a limitation to the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.

[0012] Figure 1 A flow chart of a list data sorting method provided by an embodiment of the present application is shown; Figure 2 A functional module diagram of a list data sorting device provided by an embodiment of the present application is shown. Figure 3 Fig. 2 shows a functional module diagram of a list data sorting device according to an embodiment of the present application; Figure 4 Fig. 3 shows a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0013] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0014] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0015] Please refer to Figure 1 , Figure 1 Fig. 1 shows a flowchart of a list data sorting method according to an embodiment of the present application. As shown in Fig. 1, the list data sorting method provided by the present application comprises the following steps: Figure 1 S101, in response to a user's moving operation on target list data in a target list, determining first reference list data and second reference list data adjacent to a target moving position of the target list data.

[0016] ​When a user's private data list (such as OKRs, KPIs, followed celebrities, etc.) needs to be displayed to the user, it is usually sorted according to a certain rule, such as time or popularity. If the user is not satisfied with the existing sorting rules and wants to support manual sorting, such as clicking "move up," "move down," or dragging to a target position, the position information of the list data needs to be saved so that the saved display order can be restored the next time the list is displayed. The usual practice is to add a numeric position attribute value to each data item, starting from 1 and incrementing by one. When performing a move up or down operation, the position attribute values ​​of the two elements being moved are swapped to complete the position exchange. When displaying the list data, sorting it in ascending order according to the position attribute values ​​allows the display of the user's custom order. However, when using the position attribute values ​​for sorting, because the position attribute values ​​are auto-incrementing, the position attribute values ​​are swapped and updated every time the data is moved up or down. Specifically, when performing a single up or down movement, the position attribute values ​​of two data items need to be modified; after performing N consecutive up or down movements, the position attribute values ​​of 2N data items need to be modified; when swapping two data items, the position attribute values ​​need to be modified ( The position attribute value of the data is incremented by 1 or decremented by 1 when inserting or deleting a list data item in the middle. This results in a high update complexity for arbitrarily sorted user-owned list data.

[0017] In this embodiment, in response to a user's movement operation on target list data in the target list (including clicking to move up, move down, and drag to the target position), the target movement position of the target list data corresponding to the operation is determined. This position is determined by the number of clicks on the move up / down button, or by the release point of the user's finger or mouse drag. Subsequently, two existing list data adjacent to the target movement position are determined, and are respectively denoted as the first reference list data and the second reference list data. It should be noted that in this embodiment, "adjacent" refers to the list data immediately before and immediately after the target list data in the final sorting sequence.

[0018] S102, based on the position weight values ​​of the first reference list data and the second reference list data, calculate and update the position weight value of the target list data.

[0019] Here, when it's necessary to set the order for the target list data, add an unsigned integer to each list data item. The attribute serves as the positional weight value for the list data. Among them, The minimum value is The maximum value is Thus, the position weight value of the target list data is calculated based on the position weight value of the first reference list data and the position weight value of the second reference list data, the updated position weight value of the target list data is inserted between the position weight value of the first reference list data and the position weight value of the second list data, and the position weight values of all other list data remain unchanged. Thus, only one update operation is performed on the position weight value of the target list data, thereby reducing the traditional batch update of O(N) complexity to single update of O(1) complexity, and the sorting efficiency of the list data can be effectively improved.

[0020] In S103, each list data in the target list is sorted based on the position weight value of each list data in the target list, and a target list after the moving operation is obtained.

[0021] Here, the target list is arranged in ascending order according to the updated position weight values, and the sorting result is rendered to the interface to form the target list after the moving operation. Since only one record is modified, the database write operation and network synchronization volume are significantly reduced, and efficient and smooth custom sorting can be realized.

[0022] Further, before responding to the moving operation of the target list data in the target list by the user, the method further comprises: In S a1, the first position weight value of the target list and the weight value growth step are determined based on the number of list data of the target list.

[0023] Here, the first position weight value is used to define the starting point of the sorting reference, and the weight value growth step is used to form a large enough interval between adjacent list data to provide a relatively sparse weight space for subsequent single insertion or moving. In the embodiment of the application, the first position weight value is set to , and the weight value growth step is set to .

[0024] In S a2, the initial position weight value of each list data in the target list is determined based on the first position weight value of the target list, the weight value growth step, and the initial arrangement order of each list data in the target list. The initial position weight values of any adjacent list data maintain an interval.

[0025] Here, the initial position weight values of any adjacent list data maintain an interval, so that only one data needs to be updated in the subsequent moving and inserting process to complete the sorting, thereby significantly reducing the overall time complexity. In the embodiment of the application, the position value of the first list data d[1] in the target list data is determined as , the position value of the second list data d[2] is determined as 20000, and so on. ​List data of The value is determined as , No. List data of The value is determined as , No. data of The value is determined as (Initial full sorting). When displaying list data on the page, sort and display it according to the position value from smallest to largest.

[0026] Further, the step of calculating and updating the position weight value of the target list data based on the position weight values ​​of the first reference list data and the second reference list data includes: Step b1: Add the position weight values ​​of the first reference list data and the second reference list data, and take the average value to obtain the position weight value of the target list data at the target moving position.

[0027] Here, the position weight values ​​of the first reference list data and the second reference list data are added together and averaged to obtain the position weight value of the target list data at the target movement position. In this embodiment of the application, when the first reference list data is at the target movement position... When a data item needs to be moved, you only need to care about the two adjacent data items above and below the target moving position. and and )of The value is sufficient. Since list data is all ordered... The values ​​are displayed on the user's page from smallest to largest, and are updated each time. All subsequent updates are immediate, so the user's page can access the data to be moved. of The value is obtained, and the two data points above and below the target position are retrieved. and of This allows you to calculate the positional weight of the target list data at the target's moving location. The specific formula can be expressed as: .

[0028] Furthermore, in the embodiments of this application, the average value calculated is rounded down to ensure an integer result.

[0029] Step b2: Update the position weight value of the target list data to the position weight value of the target's moving position.

[0030] Here, the position weight value of the target list data is directly replaced by the position weight value obtained in step b1, so that the single position update of the list data is completed, and the position weight values of the remaining list data do not need to be modified.

[0031] Further, before determining the first reference list data and the second reference list data adjacent to the target moving position of the target list data in response to the user's moving operation on the target list data in the target list, the method further comprises: Step c1, when the target moving position is located before the first list data of the target list, the position weight value of the first reference list data is zero, and the first list data is taken as the second reference list data.

[0032] Here, when the target moving position is located before the first list data, the position weight value of the first reference list data is zero, and the first list data is directly taken as the second reference list data, so that when the new position weight value is inserted or moved before the first list data, the new position weight value can still fall within the legal interval and maintain sparse spacing. In the embodiment of the application, when the user performs the up operation on the first list data, the position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page. The position weight value of the first list data is directly obtained from the front-end page, and the position weight value of the second list data is obtained from the back-end page.

[0033] Step c2, when the target moving position is located after the last list data of the target list, the last list data is taken as the first reference list data, and the sum of the position weight value of the last list data and the weight value growth step of the target list is taken as the position weight value of the second reference list data.

[0034] ​Here, when the target moving position is located after the last list data, the last list data is taken as the first reference list data, and the sum of the position weight value of the last list data and the weight value growth step is taken as the position weight value of the second reference list data, so that when the last list data is inserted or moved, the new position weight value also falls within the sparse and continuous weight interval, avoiding subsequent conflicts. In the embodiment of the application, when the user performs the down movement of the first list data , the system queries the first reference list data and the second reference list data, calculates the new position weight value, and sets the position weight value of the second reference list data to the sum of the position weight value of the first reference list data and the weight value growth step when the first reference list data does not exist. When the second reference list data does not exist, it means that the second last list data is moved down, and the position weight value of the second reference list data is set to the sum of the position weight value of the first reference list data and the weight value growth step. When the third reference list data does not exist, it means that the target list data itself is the last list data and is not allowed to be moved down. After the calculation is completed, the attribute of the target list data is directly updated, and the data movement is completed.

[0035] Step c3, when the target list data is the first list data or the last list data of the target list, the moving operation is terminated.

[0036] Here, when the target list data itself is the first or last list data of the target list, the moving operation is directly terminated. This is because the first list data cannot be moved up, and the last list data cannot be moved down, and further operation is meaningless, and direct stop can avoid invalid calculation.

[0037] Further, before the position weight value of the target list data is calculated and updated based on the position weight value of the first reference list data and the position weight value of the second reference list data, the method further comprises: Step d1, if there is no interval between the position weight value of the first reference list data and the position weight value of the second reference list data, the first position weight value and the weight value growth step of the full rearrangement of the target list are determined based on the current list data quantity of the target list.

[0038] Here, if it is detected that there is no interval between the position weight value of the first reference list data and the position weight value of the second reference list data, the full rearrangement mechanism is triggered. At this time, the first position weight value and the weight value growth step after the full rearrangement are recalculated based on the current list data quantity of the target list, so as to ensure that there is enough interval for the subsequent position weight value insertion operation of the moving. In the embodiment of the application, when the infinite up movement or down movement operation is performed, the position weight value of the adjacent two list data and​​​​​​ The position weight value may appear In this situation, at this time and Adding new elements in the middle will cause positional compression of the list weight values. In this case, a full rearrangement of the entire list data is required, that is, rearranging all list data at once according to the insertion rules. Assign new values ​​to existing values, and then move them. The specific rearrangement process can be found in the full initial sort described above, and will not be repeated here. Specifically, it can be increased by estimation. and To reduce the frequency of full reordering, or based on the number of list data in the current list. calculate and Specifically, the calculation can be performed using the following formula: .

[0039] Step d2: Based on the first and second position weight values ​​of the target list after full rearrangement, the weight value increment step, and the current arrangement order of each list data in the target list, determine the position weight value of each list data after full rearrangement; wherein, any adjacent list data maintains a gap between the position weight values ​​after full rearrangement.

[0040] Here, based on the recalculated first and second position weights and the weight increment step, and combined with the current arrangement order of the list data in the target list, position weights are reassigned to all list data in turn. After rearrangement, the position weights of any adjacent list data are kept apart, thereby restoring the sparse weight distribution of the list, providing space for subsequent move or insertion operations, and avoiding weight value conflicts.

[0041] Furthermore, the method also includes: Step e1: In response to the user's list data insertion operation on the target list, determine the third reference list data and the fourth reference list data that are adjacent to the target insertion position of the list data to be inserted.

[0042] Here, in response to a user's insertion operation into the target list, the target insertion position of the list data to be inserted is first determined, and the third and fourth reference list data adjacent to this target insertion position are located. The position weight values ​​of these two reference data will be used to calculate the position weight value of the data to be inserted, ensuring that the list data is accurately arranged between the third and fourth reference list data after the insertion operation. In this embodiment, the third and fourth reference list data are only distinguished from the first and second reference list data for different operation scenarios, and no specific distinction or limitation is made.

[0043] Step e2, based on the position weight value of the third reference list data and the position weight value of the fourth reference list data, calculate and determine the position weight value of the to-be-inserted list data.

[0044] Here, based on the position weight value of the third reference list data and the position weight value of the fourth reference list data, the position weight value of the to-be-inserted list data is calculated. This calculation process is similar to the moving operation, using the average value or other appropriate methods to ensure that the newly inserted data can be correctly integrated into the existing weight system while maintaining the spacing between adjacent data.

[0045] Step e3, based on the position weight value of each list data in the target list, sort each list data in the target list to obtain the target list after the insertion operation.

[0046] Here, based on the position weight value of each list data in the target list, sort each list data in the target list to obtain the target list after the insertion operation. After sorting, the user can see the updated list, in which the newly inserted data has been correctly placed in the list according to its position weight value, without the need to modify the position weight value of any subsequent data The time complexity is low.

[0047] Further, the method further comprises: Step f1, in response to the user's list data deletion operation on the target list, determine the current position weight value of the deleted list data, and keep the position weight values of the remaining list data unchanged after deletion.

[0048] Here, in response to the user's deletion operation on a certain list data in the target list, the system first determines the current position weight value of the deleted list data. After performing the deletion operation, the system keeps the position weight values of the remaining list data unchanged, thereby avoiding a large number of weight value updates caused by the deletion of a single data, significantly reducing the time complexity of the operation.

[0049] Step f2, based on the position weight value of each list data in the target list, sort each list data in the target list to obtain the target list after the deletion operation.

[0050] Here, based on the position weight value of each list data in the target list, sort each list data in the target list to obtain the target list after the deletion operation. Since only one data is deleted without modifying the weight values of other data, the sorting process is fast and efficient, ensuring that the list can still be correctly displayed after the deletion operation.

[0051] The embodiment of the present application provides a list data sorting method, which comprises the following steps: in response to a moving operation of target list data in a target list by a user, determining first reference list data and second reference list data adjacent to a target moving position of the target list data; calculating and updating a position weight value of the target list data based on a position weight value of the first reference list data and a position weight value of the second reference list data; and sorting each list data in the target list based on the position weight value of each list data in the target list. In this way, the time complexity of list data sorting is reduced and the sorting efficiency of list data is improved by converting multiple sequence adjustment operations of list data into one calculation and updating operation of a position weight value.

[0052] Based on the same application concept, the embodiment of the present application further provides a list data sorting device corresponding to the list data sorting method provided by the above-mentioned embodiment. Since the principle of solving problems in the device of the embodiment of the present application is similar to the list data sorting method of the above-mentioned embodiment of the present application, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described here.

[0053] Please refer to Figure 2 , Figure 2 for a function module diagram of a list data sorting device provided by the embodiment of the present application. As shown in Figure 2 , the list data sorting device 200 comprises: a first determining module 210, configured to determine first reference list data and second reference list data adjacent to a target moving position of target list data in a target list in response to a moving operation of the target list data by a user; a second determining module 220, configured to calculate and update a position weight value of the target list data based on a position weight value of the first reference list data and a position weight value of the second reference list data; a list sorting module 230, configured to sort each list data in the target list based on the position weight value of each list data in the target list, to obtain a target list after the moving operation.

[0054] Further, please refer to Figure 3 , Figure 3 for a function module diagram of a list data sorting device provided by the embodiment of the present application. As shown in Figure 3 , the list data sorting device 200 further comprises: a third determining module 240, configured to determine a first position weight value of the target list and a weight value growth step length based on the number of list data of the target list.

[0055] The fourth determining module 250 is configured to determine an initial position weight value of each list data in the target list based on the first position weight value of the target list, the weight value growth step, and an initial arrangement order of each list data in the target list, wherein an interval is maintained between the initial position weight values of any adjacent list data.

[0056] Further, before the second determining module 220 is configured to calculate and update the position weight value of the target list data based on the position weight value of the first reference list data and the position weight value of the second reference list data, the second determining module 220 is further configured to: add the position weight value of the first reference list data and the position weight value of the second reference list data, and then take an average value to obtain the position weight value of the target list data at the target mobile position; update the position weight value of the target list data as the position weight value of the target mobile position.

[0057] Further, before the first determining module 210 is configured to determine the first reference list data and the second reference list data adjacent to the target mobile position of the target list data in the target list in response to the user's moving operation on the target list data, the first determining module 210 is further configured to: when the target mobile position is located before the first list data in the target list, take zero as the position weight value of the first reference list data, and take the first list data as the second reference list data; when the target mobile position is located after the last list data in the target list, take the last list data as the first reference list data, and take the sum of the position weight value of the last list data and the weight value growth step of the target list as the position weight value of the second reference list data; when the target list data is the first list data or the last list data in the target list, terminate the moving operation.

[0058] Further, before the second determining module 220 is configured to calculate and update the position weight value of the target list data based on the position weight value of the first reference list data and the position weight value of the second reference list data, the second determining module 220 is further configured to: if there is no interval between the position weight value of the first reference list data and the position weight value of the second reference list data, determine the first position weight value and the weight value growth step of the full rearrangement of the target list based on the current number of list data in the target list; determining position weight values of the list data in the target list after the full rearrangement based on the first position weight value, the weight value growth step and the current arrangement order of each list data in the target list; wherein an interval is kept between position weight values of any adjacent list data after the full rearrangement.

[0059] Further, as shown in Figure 3 The list data sorting device 200 further comprises: The fifth determining module 260 is configured to determine third reference list data and fourth reference list data adjacent to a target insertion position of the list data to be inserted in response to a list data insertion operation of the target list by the user. The sixth determining module 270 is configured to calculate and determine the position weight value of the list data to be inserted based on the position weight value of the third reference list data and the position weight value of the fourth reference list data. The list sorting module 230 is further configured to sort each list data in the target list based on the position weight value of each list data in the target list to obtain the target list after the insertion operation.

[0060] Further, as shown in Figure 3 The list data sorting device 200 further comprises: The seventh determining module 280 is further configured to determine the current position weight value of the list data to be deleted and keep the position weight values of the remaining list data unchanged after the deletion in response to a list data deletion operation of the target list by the user.

[0061] The list sorting module 230 is further configured to sort each list data in the target list based on the position weight value of each list data in the target list to obtain the target list after the deletion operation.

[0062] The list data sorting device provided by the embodiments of the present application comprises: a first determining module configured to determine first reference list data and second reference list data adjacent to a target moving position of target list data in a target list in response to a moving operation of the target list data by the user; a second determining module configured to calculate and update the position weight value of the target list data based on the position weight value of the first reference list data and the position weight value of the second reference list data; and a list sorting module configured to sort each list data in the target list based on the position weight value of each list data in the target list. In this way, the multiple list data order adjustment operations are converted into one position weight value calculation and update operation, thereby reducing the time complexity of the list data sorting and improving the sorting efficiency of the list data.

[0063] Based on the same application concept, please refer toFigure 4 , Figure 4 Figure 1 is a structural schematic diagram of an electronic device provided in an embodiment of the present application. As shown in Figure 1, the electronic device 100 comprises a processor 110, a memory 120 and a bus 130. Figure 4

[0064] The memory 120 stores machine readable instructions executable by the processor 110. When the electronic device 100 is running, the processor 110 and the memory 120 communicate with each other through the bus 130. The machine readable instructions are executed by the processor 110 to perform the steps of the list data sorting method provided in the above-described embodiment. For details, refer to the method embodiment, which will not be described here again.

[0065] Based on the same application concept, the present embodiment further provides a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the list data sorting method provided in the above-described embodiment are executed. For details, refer to the method embodiment, which will not be described here again.

[0066] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described apparatus and unit can refer to the corresponding process in the foregoing method embodiment, which will not be described here again.

[0067] In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. The apparatus embodiment described above is only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, apparatuses or units, which can be electrical, mechanical or other forms.

[0068] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., they can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.

[0069] In addition, each functional unit in the embodiments provided in the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.

[0070] ​If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.

[0071] It should be noted that similar reference numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. In addition, the terms "first", "second", "third" and the like are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0072] Finally, it should be noted that the above-described embodiments are only specific implementations of the present application, which are used to illustrate the technical solutions of the present application, but not to limit them. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily think of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed by the present application, or make equivalent replacements to some of the technical features. These modifications, changes or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for sorting list data, characterized in that, The method includes: In response to a user's movement operation on target list data in the target list, a first reference list data and a second reference list data adjacent to the target movement position of the target list data are determined; Based on the position weight values ​​of the first reference list data and the second reference list data, the position weight value of the target list data is calculated and updated. Based on the position weight values ​​of each list data in the target list, the list data in the target list is sorted to obtain the target list after the move operation.

2. The sorting method for list data according to claim 1, characterized in that, Prior to responding to a user's movement operation on the target list data in the target list, the method further includes: Based on the number of list data in the target list, determine the weight value of the first position of the target list and the step size for the weight value to increase. Based on the first and second position weight values ​​of the target list, the weight value increment step, and the initial arrangement order of each list data in the target list, the initial position weight values ​​of each list data are determined; wherein, the initial position weight values ​​of any adjacent list data are kept at an interval.

3. The sorting method for list data according to claim 1, characterized in that, The step of calculating and updating the position weight value of the target list data based on the position weight values ​​of the first reference list data and the second reference list data includes: The position weight values ​​of the first reference list data and the second reference list data are added together and then averaged to obtain the position weight value of the target list data at the target moving position. Update the position weight value of the target list data to the position weight value of the target's moving position.

4. The method for sorting list data according to claim 1, characterized in that, Before determining first and second reference list data adjacent to the target movement position of the target list data after responding to a user's movement operation on the target list data in the target list, the method further includes: When the target movement position is before the first list data of the target list, then zero is used as the position weight value of the first reference list data, and the first list data is used as the second reference list data; When the target movement position is after the last list data of the target list, the last list data is used as the first reference list data, and the sum of the position weight value of the last list data and the weight value of the target list is used as the position weight value of the second reference list data. The move operation is terminated when the target list data is the first or last item in the target list.

5. The method for sorting list data according to claim 2, characterized in that, Before calculating and updating the position weight value of the target list data based on the position weight values ​​of the first reference list data and the second reference list data, the method further includes: If there is no gap between the position weight value of the first reference list data and the position weight value of the second reference list data, then the first position weight value and weight value growth step size of the target list are determined based on the current list data quantity. Based on the first and second position weight values ​​of the target list after full rearrangement, the weight value increment step, and the current arrangement order of each list data in the target list, the position weight values ​​of each list data after full rearrangement are determined; wherein, any adjacent list data maintains a gap between the position weight values ​​after full rearrangement.

6. The method for sorting list data according to claim 1, characterized in that, The method further includes: In response to a user's operation to insert list data into the target list, a third reference list and a fourth reference list are determined that are adjacent to the target insertion position of the list data to be inserted. Based on the position weight values ​​of the third reference list data and the fourth reference list data, the position weight value of the list data to be inserted is calculated and determined. Based on the position weight values ​​of each list data in the target list, the list data in the target list is sorted to obtain the target list after the insertion operation.

7. The method for sorting list data according to claim 1, characterized in that, The method further includes: In response to a user's deletion operation on the target list, the current position weight value of the deleted list data is determined, and the position weight values ​​of the remaining list data remain unchanged after deletion. Based on the position weight values ​​of each list data in the target list, the list data in the target list is sorted to obtain the target list after the deletion operation.

8. A sorting device for list data, characterized in that, The sorting device for the list data includes: The first determining module is used to determine, in response to a user's movement operation on target list data in the target list, a first reference list data and a second reference list data adjacent to the target movement position of the target list data; The second determining module is used to calculate and update the position weight value of the target list data based on the position weight value of the first reference list data and the position weight value of the second reference list data. The list sorting module is used to sort the list data in the target list based on the position weight value of each list data in the target list, so as to obtain the target list after the move operation.

9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. The machine-readable instructions are executed by the processor to perform the steps of the sorting method for list data as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the sorting method for list data as described in any one of claims 1 to 7.