Data line moving method and device, electronic equipment and storage medium
By adjusting the sorting value of data rows, the method simplifies and speeds up data row movement, addressing complexity and inefficiencies in existing methods.
Patent Information
- Application Number
- CN202411204005.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-01-03
AI Technical Summary
Existing methods for moving data rows in a predetermined order are complex, requiring locking and interface calls that increase time costs and reduce processing efficiency.
Adjusting the sorting value of data rows to change their positions, using a sorting field with an initial value based on creation time, and employing virtual data rows to handle different movement scenarios.
The method simplifies the process, reduces time costs, and improves processing efficiency while ensuring accurate movement results.
Smart Images

Figure CN119250031A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to methods, devices, electronic devices and storage media for moving data in the fields of data processing and cloud computing. Background Art
[0002] In actual applications, data rows are usually arranged in a predetermined order. In some scenarios, such as when multiple people are collaboratively editing a table, there may be a need to move data rows, such as moving a data row up or down to change the position of the data row. Summary of the invention
[0003] The present disclosure provides a data row moving method, device, electronic device and storage medium.
[0004] A data row moving method, comprising:
[0005] Obtain a move request issued by a user for any data row among the M data rows displayed, where M is a positive integer greater than 1, the data row includes a sorting field, and the M data rows are sorted in ascending order of sorting values, the sorting value is the value of the sorting field, and the initial value of the sorting value is the creation time of the corresponding data row;
[0006] The data row corresponding to the move request is used as a target data row, and the target data row is moved to a target position by adjusting the sort value of the relevant data row.
[0007] A data row moving device comprises: a first processing module and a second processing module;
[0008] The first processing module is used to obtain a move request issued by a user for any data row among the M data rows displayed, where M is a positive integer greater than 1, the data row includes a sorting field, and the M data rows are sorted in ascending order according to a sorting value, the sorting value is a value of the sorting field, and an initial value of the sorting value is a creation time of the corresponding data row;
[0009] The second processing module is used to use the data row corresponding to the move request as the target data row, and move the target data row to a target position by adjusting the sort value of the relevant data row.
[0010] An electronic device, comprising:
[0011] at least one processor; and
[0012] a memory communicatively connected to the at least one processor; wherein,
[0013] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.
[0014] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method as described above.
[0015] A computer program product comprises a computer program / instruction, wherein the computer program / instruction implements the method described above when executed by a processor.
[0016] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0018] Figure 1 It is a flow chart of an embodiment of the data row moving method disclosed in the present invention;
[0019] Figure 2 Schematic diagram of the structure of the data row moving device embodiment 200 of the present disclosure;
[0020] Figure 3 A schematic block diagram of an electronic device 300 that can be used to implement an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0021] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0022] In addition, it should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0023] Figure 1 FIG. 1 is a flow chart of an embodiment of the data row moving method disclosed in the present invention. Figure 1As shown, the following specific implementation methods are included.
[0024] In step 101, a move request issued by a user for any data row among the M data rows displayed is obtained, where M is a positive integer greater than 1, and the data row includes a sorting field. The M data rows are sorted in ascending order according to the sorting value, the sorting value is the value of the sorting field, and the initial value of the sorting value is the creation time of the corresponding data row.
[0025] In step 102, the data row corresponding to the move request is used as a target data row, and the target data row is moved to a target position by adjusting the sort value of the relevant data row.
[0026] To achieve the movement of data rows, the traditional processing method is usually as follows: by setting predecessors and successors, the relationship between data rows is established. When the data row needs to be moved, the position of the data row is changed by modifying the predecessors and successors. However, the implementation process of this method is relatively complicated, such as requiring locking and calling more interfaces, which increases the time cost and reduces the processing efficiency.
[0027] By adopting the scheme described in the above method embodiment, the position of the data row can be moved by adjusting the value of the sort field in the data row. The implementation process is simple, thereby reducing time cost, improving processing efficiency, and ensuring the accuracy of the movement result.
[0028] For each data row, a sort field may be set respectively. The value of the sort field may be called a sort value. The initial value of the sort value may be the creation time of the corresponding data row, which is usually a millisecond-level timestamp.
[0029] For each data row, you can sort it in ascending order according to the sort value. Accordingly, in the initial state, you can sort each data row in descending order according to the creation time. When adding a new data row, just add it to the end of the existing data row according to the creation time.
[0030] Assuming that M (the specific value can be determined according to actual needs) data rows are displayed, and assuming that a move request issued by the user for any of the data rows is obtained, the data row corresponding to the move request can be used as the target data row, that is, the data row requested to be moved by the user can be used as the target data row, and the target data row can be moved to the target position by adjusting the sort value of the relevant data row.
[0031] In some embodiments of the present disclosure, a method for moving a target data row to a target position by adjusting the sorting value of a related data row may include: in response to determining that the target position is a position between any two adjacent data rows, taking the former data row of the two adjacent data rows as the first data row, and taking the latter data row of the two adjacent data rows as the second data row, and performing the following first processing according to the first data row and the second data row: obtaining a first difference between the sorting value of the second data row and the sorting value of the first data row, and in response to determining that the first difference is greater than or equal to a first threshold, adjusting the sorting value of the target data row in accordance with the principle that the sorting value of the target data row is greater than the sorting value of the first data row and less than the sorting value of the second data row, the first threshold being a positive integer greater than 1, and sorting and displaying each data row according to the most recently obtained sorting value of each data row.
[0032] Assume that the value of M is 20. For ease of expression, the 20 data rows are called data row a, data row b, ..., data row s and data row t in order of sorting from first to last. Assume that the user requests to move data row b between data row e and data row f. Then, data row e can be taken as the first data row and data row f can be taken as the second data row. The difference between the sorting value of the second data row and the sorting value of the first data row can be obtained (to distinguish it from the difference that appears later, it is called the first difference). Then, the first difference can be compared with the first threshold. If it is determined that the first difference is greater than or equal to the first threshold, the sorting value of the target data row can be adjusted according to the principle that the sorting value of the target data row is greater than the sorting value of the first data row and less than the sorting value of the second data row. Then, each data row can be sorted and displayed according to the latest sorting value of each data row, thereby achieving the purpose of moving data row b between data row e and data row f. The whole process is simple and convenient to implement.
[0033] The specific value of the first threshold can be determined according to actual needs, such as 2.
[0034] In some embodiments of the present disclosure, in response to determining that the target position is the first position, the constructed first virtual data row may be used as the first data row, and the data row originally in the first position may be used as the second data row, and the sorting value of the first virtual data row may be a first predetermined value that is less than the sorting values of all data rows. In addition, in response to determining that the target position is the last position, the data row originally in the last position may be used as the first data row, and the constructed second virtual data row may be used as the second data row, and the sorting value of the second virtual data row may be the current time.
[0035] In actual applications, in addition to wanting to move a data row to a position between two other adjacent data rows, the user may also want to move a data row in the middle to the first position or the last position.
[0036] For the case of moving to the first position, the constructed first virtual data row can be used as the first data row, and the data row originally in the first position can be used as the second data row, and then the first processing can be performed according to the first data row and the second data row. Among them, the first virtual data row does not need to include real specific data, and only needs to set the corresponding sorting value, so that when the target position is the first position, the processing method of the first processing can still be used. In addition, the sorting value of the first virtual data row can be a first predetermined value that is less than the sorting values of all data rows. For example, the first predetermined value can be 0.
[0037] In the case of moving to the end position, the data row originally at the end position can be used as the first data row, and the constructed second virtual data row can be used as the second data row, and then the first processing can be performed according to the first data row and the second data row. Among them, the second virtual data row does not need to include real specific data, but only needs to set the corresponding sorting value, so that when the target position is the end position, the processing method of the first processing can still be used. In addition, the sorting value of the second virtual data row can be the current time.
[0038] It can be seen that by adopting the above processing method, no matter the target position is the position between any two adjacent data rows, the first position or the last position, the first data row and the second data row can be determined quickly and accurately, and then the movement of the target data row can be completed based on the first data row and the second data row, thereby meeting the different movement needs of users and improving user satisfaction.
[0039] After obtaining the first difference between the sorting value of the second data row and the sorting value of the first data row and determining that the first difference is greater than or equal to the first threshold, the sorting value of the target data row can be adjusted according to the principle of making the sorting value of the target data row greater than the sorting value of the first data row and less than the sorting value of the second data row.
[0040] In some embodiments of the present disclosure, the quotient of the first difference and 2 can be obtained. In response to determining that the quotient is an integer, the quotient can be used as a first correction value. In response to determining that the quotient is a decimal, the quotient can be rounded up or down as the first correction value. Thereafter, the sum of the ranking value of the first data row and the first correction value can be obtained, and the sum can be used as the ranking value of the adjusted target data row.
[0041] For example, assuming that the user requests to move data row b to a position between data row e and data row f, and assuming that the first difference between the ranking value of data row f and the ranking value of data row e (such as represented by △t1) is greater than the first threshold, then the quotient of △t1 and 2 (△t1 / 2) can be obtained. If the obtained quotient is an integer, the obtained quotient can be directly used as the first correction value. If the obtained quotient is a decimal, the obtained quotient can be rounded up or down, and the result after rounding up or down can be used as the first correction value. Furthermore, the sum of the ranking value of the first data row and the first correction value can be obtained as the adjusted ranking value of the target data row.
[0042] Through the above processing, the sorting value of the target data row can be adjusted to the middle value of the sorting values of the first data row and the second data row, and then each data row can be sorted and displayed according to the latest sorting value of each data row, thereby moving the position of the target data row between the first data row and the second data row.
[0043] The above description is about the processing method when the first difference is greater than or equal to the first threshold. In practical applications, the first difference may also be less than the first threshold.
[0044] Accordingly, in some embodiments of the present disclosure, in response to determining that the first difference is less than the first threshold, the sorting value of the second data row can be increased by a second predetermined value, and the second predetermined value is greater than or equal to the first threshold. Thereafter, the sorting value of the target data row can be adjusted in accordance with the principle of making the sorting value of the target data row greater than the sorting value of the first data row and less than the sorting value of the adjusted second data row. Furthermore, each data row can be sorted and displayed according to the most recently obtained sorting value of each data row.
[0045] As mentioned above, the sorting value is usually a millisecond timestamp in the form of an integer. Assuming that the value of the first threshold is 2, if the first difference is less than the first threshold, such as the first difference is 1, the quotient obtained is 0.5, and the first correction value obtained after rounding up or down will be 0 or 1, which will cause the sorting value of the adjusted target data row to be the same as the sorting value of the first data row or the second data row, thereby causing subsequent incorrect sorting. Therefore, if it is determined that the first difference is less than the first threshold, the sorting value of the second data row can be increased by a second predetermined value. The specific value of the second predetermined value can be determined according to actual needs, but is usually greater than or equal to the first threshold. After that, the sorting value of the target data row can be adjusted according to the principle of making the sorting value of the target data row greater than the sorting value of the first data row and less than the sorting value of the adjusted second data row, and then each data row can be sorted and displayed according to the latest sorting value of each data row.
[0046] By adjusting the ranking value of the second data row, the difference between the ranking value of the second data row and the ranking value of the first data row can be made greater than the first threshold, thereby avoiding the aforementioned problem of incorrect ranking.
[0047] In some embodiments of the present disclosure, a second difference between the adjusted ranking value of the second data row and the ranking value of the first data row can be obtained, and the quotient of the second difference and 2 can be obtained. In response to determining that the quotient is an integer, the quotient can be used as a second correction value. In response to determining that the quotient is a decimal, the quotient can be rounded up or down as a second correction value. Furthermore, the sum of the ranking value of the first data row and the second correction value can be obtained, and the sum can be used as the ranking value of the adjusted target data row.
[0048] In actual applications, after adjusting the ranking value of the second data row, the following situation may occur: the ranking value of the adjusted second data row is greater than the ranking value of the third data row, and the third data row is the adjacent data row located after the second data row. This situation is not allowed, because after sorting and displaying the data rows according to the latest ranking values of the data rows, the second data row will be located after the third data row, but in fact, except for the target data row that should be moved to the position before the second data row, the positions of other data rows should remain unchanged, that is, adjusting the ranking value of the second data row may cause sorting errors.
[0049] To solve the above problem, in some embodiments of the present disclosure, before sorting and displaying each data row according to the most recently obtained sorting value of each data row, it can be first determined whether there is a third data row. In response to determining that there is a third data row and determining that the sorting value of the third data row is greater than the adjusted sorting value of the second data row, the data rows can be sorted and displayed according to the most recently obtained sorting value of each data row. In response to determining that there is no third data row, the data rows can also be sorted and displayed according to the most recently obtained sorting value of each data row.
[0050] That is to say, if it is determined that there is a third data row, and it is determined that the sorting value of the third data row is greater than the sorting value of the adjusted second data row, then it can be determined that the "problem of sorting errors may result after adjusting the sorting value of the second data row" will not occur, and accordingly, each data row can be sorted and displayed according to the latest sorting value of each data row. Alternatively, if it is determined that there is no third data row, that is, it is determined that the second data row is the data row at the end, then naturally the "problem of sorting errors may result after adjusting the sorting value of the second data row" will not occur, and accordingly, each data row can be sorted and displayed according to the latest sorting value of each data row.
[0051] In some embodiments of the present disclosure, in response to determining that there is a third data row and determining that the ranking value of the third data row is less than or equal to the adjusted ranking value of the second data row, the third data row may be used as a data row to be processed, and the following second processing may be performed on the data row to be processed: increasing the ranking value of the data row to be processed by a second predetermined value, in response to determining that there is a fourth data row and determining that the ranking value of the fourth data row is greater than the adjusted ranking value of the data row to be processed, sorting and displaying each data row according to the latest ranking value of each data row, the fourth data row being an adjacent data row after the data row to be processed, in response to determining that there is no fourth data row, sorting and displaying each data row according to the latest ranking value of each data row, in response to determining that there is a fourth data row and determining that the ranking value of the fourth data row is less than or equal to the adjusted ranking value of the data row to be processed, taking the fourth data row as the data row to be processed, and repeating the second processing.
[0052] If the adjusted ranking value of the second data row is greater than or equal to the ranking value of the third data row, then the ranking value of the third data row can also be increased by the second predetermined value, thereby ensuring that the third data row is still located after the second data row after sorting, but it may cause the ranking value of the third data row to be greater than or equal to the ranking value of the fourth data row. Therefore, the above-mentioned second processing can be performed on the third data row. For the convenience of expression, the third data row is called the data row to be processed. If it is determined that there is a fourth data row, and it is determined that the ranking value of the fourth data row is greater than the adjusted ranking value of the data row to be processed, each data row can be sorted and displayed according to the latest ranking value of each data row. If it is determined that there is no fourth data row, each data row can also be sorted and displayed according to the latest ranking value of each data row. If it is determined that there is a fourth data row, and it is determined that the ranking value of the fourth data row is less than or equal to the adjusted ranking value of the data row to be processed, the fourth data row can be used as the data row to be processed and the second processing can be repeated.
[0053] Through the above processing, reasonable adjustment of the sorting values of the third data row and subsequent data rows can be achieved, thereby ensuring that the positions of the data rows other than the target data row remain unchanged, thereby improving the accuracy of the sorting results, etc.
[0054] In combination with the above introduction, the data row moving method disclosed in the present invention can be further illustrated as follows.
[0055] Sort Value 1717171200 1717257600 … 1718380800 1718467200 1718467201 Data Row D1 D2 … D(M-2) D(M-1) D(M)
[0056] Table 1 Multiple data rows that have not been moved sorted by creation time
[0057] As shown in Table 1, assume that there are M data rows D1, D2, ..., D(M), each of which includes a sorting field. The value of the sorting field is the sorting value. The initial value of each sorting value can be the creation time of the corresponding data row. In the initial state, the M data rows can be sorted in descending order according to the creation time.
[0058] Assuming that a move request is obtained for data row D2, requesting to move data row D2 to a position between data row D(M-2) and data row D(M-1), then data row D(M-2) can be used as the first data row, data row D(M-1) can be used as the second data row, and the first difference between the ranking value 1718467200 of data row D(M-1) and the ranking value 1718380800 of data row D(M-2) can be obtained, that is, 1718467200-1718380800=86400. Assuming that the first difference is 8 6400 is greater than the first threshold value, so the quotient of 86400 / 2 can be obtained, and the quotient 43200 can be used as the first correction value, and then the sum of the ranking value 1718380800 of the data row D(M-2) and the first correction value 43200 can be obtained, that is, 1718380800+43200=1718424000, and 1718424000 can be used as the ranking value of the adjusted data row D2, and then the data rows can be sorted and displayed according to the latest ranking values of the data rows, so as to obtain the sorting results shown in Table 2.
[0059] Sort Value 1717171200 … 1718380800 1718424000 1718467200 1718467201 Data Row D1 … D(M-2) D2 D(M-1) D(M)
[0060] Table 2 Sorting results after moving data row D2 to a position between data row D(M-2) and data row D(M-1)
[0061] Assuming that a move request issued by the user for data row D2 is obtained, requesting to move data row D2 to a position between data row D(M-1) and data row D(M), then data row D(M-1) can be used as the first data row, and data row D(M) can be used as the second data row, and the first difference between the ranking value 1718467201 of data row D(M) and the ranking value 1718467200 of data row D(M-1) can be obtained, that is, 1718467201-1718467200=1. Since the first difference is less than the first threshold, the ranking value of data row D(M) can be increased by a second predetermined value, such as 500, to 1718467701, and then the adjusted ranking value 1718467701 of data row D(M) and the ranking value of data row D(M-1) can be obtained. According to the second difference between the ranking values 1718467200 of the data row D(M-1), that is, 1718467701-1718467200=501, assuming that the second difference 501 is greater than the first threshold, then the quotient of 501 / 2 can be obtained, and the obtained quotient 250.5 can be rounded down as the second correction value, that is, the second correction value is 250, and then the sum of the ranking value 1718467200 of the data row D(M-1) and the second correction value 250 can be obtained, that is, 1718467200+250=1718467450, and 1718467450 can be used as the ranking value of the adjusted data row D2, and then the data rows can be sorted and displayed according to the latest ranking values of the data rows, so as to obtain the sorting results shown in Table 3.
[0062] Sort Value 1717171200 … 1718380800 1718467200 1718467450 1718467701 Data Row D1 … D(M-2) D(M-1) D(2) D(M)
[0063] Table 3 Sorting results after moving data row D2 to a position between data row D(M-1) and data row D(M)
[0064] In the above example, it is assumed that there are no other data rows after the data row D(M). If there are other data rows after the data row D(M), it is also necessary to determine whether adjusting the sorting value of the data row D(M) will affect other subsequent data rows. If so, it is also necessary to adjust the sorting values of the relevant data rows after the data row D(M) according to the method described in the present disclosure.
[0065] In addition, it should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are expressed as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0066] The above is an introduction to the method embodiment. The following is a further explanation of the scheme disclosed in the present invention through an apparatus embodiment.
[0067] Figure 2 FIG. 2 is a schematic diagram of the structure of the data row moving device embodiment 200 of the present disclosure. Figure 2 As shown, it includes: a first processing module 201 and a second processing module 202.
[0068] The first processing module 201 is used to obtain a move request issued by a user for any data row among the M data rows displayed, where M is a positive integer greater than 1, and the data row includes a sorting field. The M data rows are sorted in ascending order of the sorting value, the sorting value is the value of the sorting field, and the initial value of the sorting value is the creation time of the corresponding data row.
[0069] The second processing module 202 is configured to use the data row corresponding to the move request as a target data row, and move the target data row to a target position by adjusting the sort value of the relevant data row.
[0070] By adopting the scheme described in the above device embodiment, the position of the data row can be moved by adjusting the value of the sort field in the data row. The implementation process is simple, thereby reducing time cost, improving processing efficiency, and ensuring the accuracy of the movement result.
[0071] For each data row, a sort field may be set respectively. The value of the sort field may be called a sort value. The initial value of the sort value may be the creation time of the corresponding data row, which is usually a millisecond-level timestamp.
[0072] For each data row, you can sort it in ascending order according to the sort value. Accordingly, in the initial state, you can sort each data row in descending order according to the creation time. When adding a new data row, just add it to the end of the existing data row according to the creation time.
[0073] Assuming that M data rows are displayed, and assuming that the first processing module 201 obtains a move request issued by the user for any of the data rows, the second processing module 202 can use the data row corresponding to the move request as the target data row, that is, the data row requested to be moved by the user as the target data row, and can move the target data row to the target position by adjusting the sort value of the relevant data row.
[0074] In some embodiments of the present disclosure, the second processing module 202 moves the target data row to the target position by adjusting the sorting value of the relevant data row, which may include: in response to determining that the target position is a position between any two adjacent data rows, taking the former data row of the two adjacent data rows as the first data row, taking the latter data row of the two adjacent data rows as the second data row, and performing the following first processing according to the first data row and the second data row: obtaining a first difference between the sorting value of the second data row and the sorting value of the first data row, in response to determining that the first difference is greater than or equal to a first threshold, adjusting the sorting value of the target data row according to the principle that the sorting value of the target data row is greater than the sorting value of the first data row and less than the sorting value of the second data row, the first threshold being a positive integer greater than 1, and sorting and displaying each data row according to the most recently obtained sorting value of each data row.
[0075] In some embodiments of the present disclosure, in response to determining that the target position is the first position, the second processing module 202 may use the constructed first virtual data row as the first data row, and the data row originally in the first position as the second data row, and the sorting value of the first virtual data row may be a first predetermined value that is less than the sorting values of all data rows. In addition, in response to determining that the target position is the last position, the data row originally in the last position may be used as the first data row, and the constructed second virtual data row may be used as the second data row, and the sorting value of the second virtual data row may be the current time.
[0076] Among them, in some embodiments of the present disclosure, the second processing module 202 can obtain the quotient of the first difference and 2. In response to determining that the quotient is an integer, the quotient can be used as the first correction value. In response to determining that the quotient is a decimal, the quotient can be rounded up or down as the first correction value. Thereafter, the sum of the ranking value of the first data row and the first correction value can be obtained, and the sum can be used as the ranking value of the adjusted target data row.
[0077] The above description is about the processing method when the first difference is greater than or equal to the first threshold. In practical applications, the first difference may also be less than the first threshold.
[0078] Accordingly, in some embodiments of the present disclosure, in response to determining that the first difference is less than the first threshold, the second processing module 202 may increase the sorting value of the second data row by a second predetermined value that is greater than or equal to the first threshold, and then the sorting value of the target data row may be adjusted in accordance with the principle that the sorting value of the target data row is greater than the sorting value of the first data row and less than the sorting value of the adjusted second data row, and then each data row may be sorted and displayed according to the most recently obtained sorting value of each data row.
[0079] Among them, in some embodiments of the present disclosure, the second processing module 202 can obtain the second difference between the adjusted ranking value of the second data row and the ranking value of the first data row, and can obtain the quotient of the second difference and 2. In response to determining that the quotient is an integer, the quotient can be used as the second correction value. In response to determining that the quotient is a decimal, the quotient can be rounded up or down as the second correction value, and then the sum of the ranking value of the first data row and the second correction value can be obtained, and the sum can be used as the ranking value of the adjusted target data row.
[0080] In some embodiments of the present disclosure, before sorting and displaying each data row according to the most recently obtained sorting value of each data row, the second processing module 202 may first determine whether there is a third data row. In response to determining that there is a third data row and determining that the sorting value of the third data row is greater than the adjusted sorting value of the second data row, the data rows may be sorted and displayed according to the most recently obtained sorting value of each data row. In response to determining that there is no third data row, the data rows may also be sorted and displayed according to the most recently obtained sorting value of each data row.
[0081] In addition, in some embodiments of the present disclosure, in response to determining that there is a third data row and that the ranking value of the third data row is less than or equal to the adjusted ranking value of the second data row, the second processing module 202 may use the third data row as a data row to be processed, and may perform the following second processing on the data row to be processed: increase the ranking value of the data row to be processed by a second predetermined value; in response to determining that there is a fourth data row and that the ranking value of the fourth data row is greater than the adjusted ranking value of the data row to be processed, sort and display each data row according to the latest ranking value of each data row, the fourth data row being an adjacent data row after the data row to be processed; in response to determining that there is no fourth data row, sort and display each data row according to the latest ranking value of each data row; in response to determining that there is a fourth data row and that the ranking value of the fourth data row is less than or equal to the adjusted ranking value of the data row to be processed, use the fourth data row as the data row to be processed, and repeat the second processing.
[0082] Figure 2 The specific working process of the illustrated device embodiment can refer to the relevant description in the aforementioned method embodiment and will not be described in detail.
[0083] In summary, the scheme described in the present invention can reduce time costs, improve processing efficiency and improve the accuracy of movement results. Moreover, the scheme described in the present invention can be applied to different application scenarios, such as collaborative editing, multi-view movement, etc., and has wide applicability.
[0084] The scheme disclosed in the present invention can be applied to the field of artificial intelligence, especially to the fields of data processing and cloud computing. Artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing. Artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0085] In addition, the data rows and the like in the embodiments described in this disclosure are not for a specific user and do not reflect the personal information of a specific user. In the technical solution of this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0086] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0087] Figure 3 A schematic block diagram of an electronic device 300 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0088] like Figure 3 As shown, the device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 to a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 can also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0089] A number of components in the device 300 are connected to the I / O interface 305, including: an input unit 306, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a disk, an optical disk, etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 309 allows the device 300 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0090] The computing unit 301 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI, Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP, Digital Signal Processing), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 301 performs the various methods and processes described above, such as the methods described in the present disclosure. For example, in some embodiments, the methods described in the present disclosure may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 300 via the ROM 302 and / or the communication unit 309. When the computer program is loaded into the RAM 303 and executed by the computing unit 301, one or more steps of the methods described in the present disclosure may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to execute the method described in the present disclosure in any other appropriate manner (for example, by means of firmware).
[0091] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0092] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0093] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM, Electronically Programmable Read-Only Memory), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM, Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0094] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0095] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by digital data communication (e.g., a communication network) in any form or medium. Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0096] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0097] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0098] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data row moving method, comprising: Obtain a move request issued by a user for any data row among the M data rows displayed, where M is a positive integer greater than 1, the data row includes a sorting field, and the M data rows are sorted in ascending order of sorting values, the sorting value is the value of the sorting field, and the initial value of the sorting value is the creation time of the corresponding data row; The data row corresponding to the move request is used as a target data row, and the target data row is moved to a target position by adjusting the sort value of the relevant data row.
2. The method according to claim 1, wherein: The step of moving the target data row to the target position by adjusting the ranking value of the related data row comprises: In response to determining that the target position is a position between any two adjacent data rows, taking a first data row of the two adjacent data rows as a first data row, and taking a second data row of the two adjacent data rows as a second data row; The following first processing is performed according to the first data row and the second data row: a first difference between the sorting value of the second data row and the sorting value of the first data row is obtained; in response to determining that the first difference is greater than or equal to a first threshold, the sorting value of the target data row is adjusted according to the principle that the sorting value of the target data row is greater than the sorting value of the first data row and less than the sorting value of the second data row, and the first threshold is a positive integer greater than 1; and each data row is sorted and displayed according to the most recently obtained sorting value of each data row.
3. The method according to claim 2, further comprising: In response to determining that the target position is the first position, taking the constructed first virtual data row as the first data row, taking the data row originally in the first position as the second data row, and the ranking value of the first virtual data row being a first predetermined value less than the ranking values of all data rows; In response to determining that the target position is the end position, the data row originally at the end position is used as the first data row, and the constructed second virtual data row is used as the second data row, and the sort value of the second virtual data row is the current time.
4. The method according to claim 2 or 3, wherein: The step of adjusting the ranking value of the target data row according to the principle that the ranking value of the target data row is greater than the ranking value of the first data row and less than the ranking value of the second data row comprises: Obtaining a quotient of the first difference and 2, and in response to determining that the quotient is an integer, using the quotient as a first correction value, and in response to determining that the quotient is a decimal, rounding up or down the quotient as the first correction value; The sum of the ranking value of the first data row and the first correction value is obtained, and the sum is used as the adjusted ranking value of the target data row.
5. The method according to claim 2 or 3, further comprising: In response to determining that the first difference is less than the first threshold, increasing the ranking value of the second data row by a second predetermined value, the second predetermined value being greater than or equal to the first threshold; According to the principle that the ranking value of the target data row is greater than the ranking value of the first data row and less than the ranking value of the second data row after adjustment, the ranking value of the target data row is adjusted; The data rows are sorted and displayed according to the most recently obtained sorting values of the data rows.
6. The method according to claim 5, wherein: The step of adjusting the ranking value of the target data row according to the principle that the ranking value of the target data row is greater than the ranking value of the first data row and less than the ranking value of the second data row after adjustment includes: Obtaining a second difference between the adjusted ranking value of the second data row and the ranking value of the first data row; Obtaining a quotient of the second difference and 2, and in response to determining that the quotient is an integer, using the quotient as a second correction value, and in response to determining that the quotient is a decimal, rounding up or down the quotient as the second correction value; The sum of the ranking value of the first data row and the second correction value is obtained, and the sum is used as the adjusted ranking value of the target data row.
7. The method according to claim 5, further comprising: Before sorting and displaying the data rows according to the most recently obtained sorting values of the data rows, determining whether there is a third data row, the third data row being an adjacent data row located after the second data row; In response to determining that the third data row exists and determining that the ranking value of the third data row is greater than the adjusted ranking value of the second data row, sorting and displaying each data row according to the latest ranking value of each data row; In response to determining that the third data row does not exist, the data rows are sorted and displayed according to the most recently obtained sorting values of the data rows.
8. The method according to claim 7, further comprising: In response to determining that the third data row exists and determining that the ranking value of the third data row is less than or equal to the adjusted ranking value of the second data row, taking the third data row as a data row to be processed, and performing the following second processing on the data row to be processed: Increasing the ranking value of the data row to be processed by the second predetermined value; in response to determining that there is a fourth data row and determining that the ranking value of the fourth data row is greater than the adjusted ranking value of the data row to be processed, sorting and displaying each data row according to the latest ranking value of each data row, the fourth data row being an adjacent data row located after the data row to be processed; In response to determining that the fourth data row does not exist, the data rows are sorted and displayed according to the most recently obtained sorting values of the data rows; in response to determining that the fourth data row exists, and determining that the sorting value of the fourth data row is less than or equal to the adjusted sorting value of the data row to be processed, the fourth data row is used as the data row to be processed, and the second processing is repeated.
9. A data line moving device, comprising: A first processing module and a second processing module; The first processing module is used to obtain a move request issued by a user for any data row among the M data rows displayed, where M is a positive integer greater than 1, the data row includes a sorting field, and the M data rows are sorted in ascending order according to a sorting value, the sorting value is a value of the sorting field, and an initial value of the sorting value is a creation time of the corresponding data row; The second processing module is used to use the data row corresponding to the move request as the target data row, and move the target data row to a target position by adjusting the sort value of the relevant data row.
10. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
