Quick sorting algorithm for work items in project management system

By designing a quick sorting algorithm for work items in the project management system, using the RankUtil tool and the Rank<rank value data structure, the problem of low efficiency of traditional sorting is solved, efficient sorting operations and resource utilization are achieved, and it is suitable for frequently changing work items. Sort scenes.

CN118569798APending Publication Date: 2024-08-30SHANGHAI ZHENZHI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410650889.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Traditional agile project management systems are inefficient when processing work item sorting, especially when the sorting numbers need to be updated frequently, and conventional algorithms cannot effectively handle the problem of duplication of sorting numbers or the insertion of new items.

Method used

A quick sorting algorithm for work items is designed. Through the RankUtil tool, core components such as Rank are used to achieve efficient calculation and update of ranking values, reduce the number of database entry updates, and provide simplicity and ease of use. interface for easy reuse.

Benefits of technology

It significantly improves the efficiency of sorting operations, adapts to the addition, deletion and reordering of work items, is compatible with scenarios that conventional sorting algorithms cannot handle, and improves the response speed and computing resource utilization of the project management system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0004856279850000011
    Figure HDA0004856279850000011
  • Figure HDA0004856279850000021
    Figure HDA0004856279850000021
Patent Text Reader

Abstract

The invention relates to the technical field of information technology service management, in particular to a quick sorting algorithm for work items in a project management system. The method specifically comprises the following steps: transmitting a precursor sorting value and a subsequent sorting value; judging whether the precursor sorting value and the subsequent sorting value are empty or not; comparing the precursor sorting value with the subsequent sorting value, taking the smaller sorting value as a first parameter of a subsequent method, and taking the larger sorting value as a second parameter of the subsequent method; obtaining one of the two input sorting values as a new sorting value, and returning the new sorting value; the method comprises the following steps: carrying out Ranklt; sorting a value data structure gt; the object is formatted into a string value. Compared with the prior art, the algorithm greatly improves the efficiency of sorting operation; the algorithm can flexibly adapt to addition, deletion and reordering of the work items, is compatible with scenes which cannot be ordered by various common conventional ordering algorithms, and is an ideal solution for ordering the work items in agile project management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of information technology service management, and in particular to a work item quick sorting algorithm used in a project management system. Background Art

[0002] PMS (Project Management System) SaaS (Software as a Service) management system is a cloud-based agile project management solution designed to help organizations manage projects effectively. In agile project management, efficient work item sorting is the key to improving project management efficiency and responsiveness. Traditional agile project management systems often use integer sequence number-based methods to handle work item sorting. This method has significant problems. For example, if a new item needs to be inserted between two adjacent work items, the system needs to update the sorting numbers of all subsequent work items, resulting in low efficiency; if the sorting numbers of two adjacent work items are repeated, the system will be unable to insert a work item between them. SaaS systems serve multiple customers or teams at the same time and need to handle scenarios where a large number of work items frequently change their sorting numbers. The effective use of computing resources is particularly important, and the sorting must be efficient and reliable. Summary of the invention

[0003] In order to overcome the deficiencies of the prior art, the present invention provides a work item quick sorting algorithm for a project management system. The algorithm reduces the number of database entries that need to be actually updated during sorting adjustment, thereby improving efficiency. A simple and easy-to-use external interface is provided to facilitate reuse of the algorithm in different entities that need to be sorted.

[0004] To achieve the above purpose, a work item quick sorting algorithm for project management system is designed, which is characterized by: the specific method is as follows: Step 1: The business method calls RankUtil<ranking tool> and passes in the predecessor ranking value and the successor ranking value. Step 2: Determine whether the predecessor sort value and the successor sort value are empty, if yes, proceed to step 3; otherwise, proceed to step 4; Step 3: If both the predecessor ranking value and the successor ranking value are empty, set the predecessor ranking value to the minimum ranking value of the ranking system, set the successor ranking value to the maximum ranking value of the ranking system, and continue with step 7; Step 4: If both the predecessor ranking value and the successor ranking value are not empty, continue to judge whether the predecessor ranking value and the successor ranking value are not empty. If the predecessor ranking value is empty but the successor ranking value is not empty, continue to step 5; if the successor ranking value is empty but the predecessor ranking value is not empty, continue to step 6; Step 5: If the predecessor sort value is empty but the successor sort value is not empty, return the previous sort value of the successor sort value. If the subtraction result is less than the minimum sort value allowed by the system, return the minimum sort value and continue to step 9; Step 6: If the successor sort value is empty but the predecessor sort value is not empty, return the next sort value of the predecessor sort value. If the added result is greater than the maximum sort value allowed by the system, return the maximum sort value and continue to step 9; Step 7: Compare the predecessor sort value and the successor sort value, use the smaller sort value as the first parameter of the subsequent method, and use the larger sort value as the second parameter of the subsequent method; Step 8: Get a value whose size is between the two input sort values ​​and return it as the new sort value; Step 9: Format the Rank<rank value data structure> object into a string value and return it to the calling method.

[0005] The predecessor sort value and the successor sort value are both sort values ​​represented by character strings.

[0006] The specific process of step seven is as follows: (1) Compare the sign properties of the RankDecimal<ranking value> objects, positive number > 0 > negative number; (2) If the sign attributes are the same, compare the exponent attributes. Since exponent attributes are all non-negative integers, the RankDecimal<ranking value> object with a larger exponent attribute has a larger value, and thus it can be deduced that the Rank<ranking value data structure> object to which it belongs is larger. (3) If the exponent attributes are also the same, further compare the RankInteger<ranking unsigned integer> attributes in the RankDecimal<ranking value> objects. Specifically, compare the numbers in the Java integer array in the RankInteger<ranking unsigned integer> attributes bit by bit from low to high. If there is a difference in size, determine which RankInteger<ranking unsigned integer> attribute is larger based on the difference. If there is no difference, continue to compare the next digit of each. (4) If the Java integer array of a RankInteger<sorted unsigned integer> has not been completely read and the size has not been compared, and the Java integer array of another RankInteger<sorted unsigned integer> has not been completely read, then the RankInteger<sorted unsigned integer> that has not been read is larger; (5) If two Java integer arrays of RankInteger<sorted unsigned integers> are read at the same time and the sizes are not compared, the two RankInteger<sorted unsigned integers> are determined to be the same size; The size of the Rank<ranking value data structure> object is achieved based on comparing the member variable RankDecimal<ranking value> object in the Rank<ranking value data structure> object.

[0007] The specific process of step eight is as follows: (1) Subtract the values ​​of the two passed in Rank<ranking value data structure> objects, and the difference is the remaining available range between them; (2) If the remaining available interval is 0, an exception is thrown, indicating that the predecessor sort value and the successor sort value are equal, otherwise continue; (3) According to the number of digits in the remaining interval and the equal division granularity, determine the scaling factor of the quick-check multiplier set. The formula is: Multiplier set scaling factor = Number of integer digits in the remaining available interval - [ln (equal division granularity) / ln (base (decimal is 10, hexadecimal is 36, and 64th base is 64))]; (4) Multiply the quick-check multiplier set by the scaling factor and 0.1 respectively. The resulting set is the actual quick-check multiplier set used in this calculation. (5) Traverse the real quick-check multiplier set from large to small, and multiply them by the equal granularity. If the multiplication result is larger than the size of the available interval, continue to use the next number in the set for multiplication. Otherwise, use this value as the incremental step value. (6) If a suitable incremental step value is still not found after the real quick-check multiplier set is traversed, it means that the available interval is 0, and an exception is thrown, indicating that the predecessor sort value is the same as the successor sort value; (7) Find a suitable number as the temporary result value. The specific calculation process is as follows: first, perform a left shift or a right shift operation on the predecessor sort value and the incremental step value synchronously until the integer part of the incremental step value is 1 bit, discard the decimal part of the predecessor sort value and the incremental step value at this time, and record the remaining integer parts as the divisor and dividend respectively; (8) Multiply the incremental step value by 0.5, and record the result as the half-length increment; subtract the predecessor sort value from the temporary result value, and record the result as the difference; determine whether the difference is greater than or equal to the half-length increment, and return the temporary result as the final result; otherwise, return the temporary result plus the incremental step value as the final result.

[0008] The specific process of step nine is as follows: (1) Serialize RankBucket<sort bucket> into text, that is, the string corresponding to RankBucket<sort bucket> itself, and splice it to the front of the result; (2) Add a vertical bar (|) to separate the RankBucket part and the RankDecimal part; (3) Calculate the string corresponding to RankDecimal<ranking value>: (a) If the sign of the RankDecimal<ranking value> contained in the Rank<ranking value data structure> is negative, a minus sign (-) is added, otherwise no sign is added; (b) According to the exponent of RankDecimal<ranking value> and the Java integer array of RankInteger<ranking unsigned integer> contained in RankDecimal<ranking value>, determine the integer part and the decimal part, the integer part and the decimal part are separated by a colon (:), and the integer part is processed first, and then the decimal part; (c) Process the integer part and the decimal part separately: according to each digit in the Java integer array, look up the table in RankNumeralSystem<ranking numerical system> to get the corresponding character processing and concatenate them; (d) Remove the leading 0 and the trailing 0 from the resulting string. If the integer is less than 6 digits after the removal, add 0 to 6 digits in front. (e) Returns this string.

[0009] The exception handling includes the following situations: Exception handling 1: The predecessor sort value and the successor sort value are equal, resulting in an error message when obtaining the intermediate value and failing to obtain the available interval. The specific handling process is as follows: (1) Determine whether the predecessor ranking value is equal to the system minimum value. If so, jump to step (2); otherwise, jump to step (5); (2) Query the database to find the smallest ranking value that is greater than the subsequent ranking value; (3) Calculate the middle value between this value in step (2) and the predecessor sort value, and record it as the new value; (4) Set the incoming successor sort value to this new value and jump to step (8); (5) Query the database for the largest ranking value that is smaller than the subsequent ranking value; (6) Calculate the intermediate value between this value in step (5) and the subsequent sorted value, and record it as the new value; (7) Set the incoming predecessor sort value to this new value and jump to step (8); (8) Re-calculate the intermediate value using the new predecessor ranking value and successor ranking value; Exception handling 2: when the successor node is the system minimum value, take the pre value: convert it into the case where both the predecessor value and the successor value are the system minimum value, and bring it into the processing; Exception handling 3, when the predecessor node is the system maximum value, take the next value: convert it into the case where the predecessor value and the successor value are both the system maximum values, and bring it into the processing.

[0010] The specific process of the addition is as follows: (1) Handling the case of different signs: If the addend is a negative number, then negate the addend to get a positive value, then subtract the addend from the positive value, and finally negate the result again; if the addend is a positive number, then negate the addend, then subtract the negated addend from the addend; (2) Handling the case of the same sign: If the signs of the addend and the augend are the same, the addition operation can be performed directly; (3) Additive bottom-level processing: (a) Align the exponent by left-shifting the integer portion of the shorter number; (b) Create a new array with the length of the longer of the two input arrays. For each digit, calculate the corresponding sum and take into account the carry. If the last digit also produces a carry, the result array needs to be extended to accommodate this extra carry. (c) Determine the exponent of the sum based on the larger value of the exponents of the two numbers before the addition operation; (d) Adjust the exponent, that is, shift it left or right, and remove the leading and trailing zeros of the result.

[0011] The specific process of the subtraction is as follows: (1) Handling the case of different signs: invert the number with a negative sign and then perform the addition operation; (2) Handling the case where the symbols are the same: (a) Calculate the two’s complement of the subtrahend; (b) add the two's complement of the minuend to the minuend; (c) Adjust the most significant bit: Since extra carries may occur in two’s complement addition, this step ensures that the most significant bit is set to 0; (d) The last step is to add 1 to the result of the previous step; (e) Adjust the exponent, that is, shift it left or right, and remove the leading and trailing zeros.

[0012] The specific process of the multiplication is as follows: (1) The sign bit is multiplied as the sign bit of the result; (2) The exponent bits are multiplied to form the exponent bits of the result; (3) Initialize the result array: create a new array with the length of the sum of the two operands; (4) Iterate through each bit of the multiplier and multiplicand through a double loop, accumulate the product of each pair of bits to the corresponding position of the result array, and handle the carry; (5) Adjust the exponent, that is, shift it left or right, and erase the leading and trailing zeros.

[0013] RankUtil<ranking tool>: represents the access point for providing the ranking function, and provides a method for calculating a new ranking value based on the previous ranking value and the next ranking value; Rank<rank value data structure>: represents a ranking number data structure, which is the core data structure of the sorting algorithm and consists of RankBucket<ranking bucket> and RankDecimal<ranking value>; RankBucket<sort bucket>: indicates that it contains a string to distinguish the business meanings of different sorts. If the strings contained in the RankBucket<sort bucket> of two Rank<sort value data structures> are different, sorting cannot be performed and the system will throw an exception, indicating that the sort buckets are inconsistent; RankNumeralSystem<ranking numerical system> and RankNumeralSystemHelper<ranking numerical system helper tool>: represent the implementation of different numerical systems, including decimal, 36-base, and 64-base by default, to support the conversion between the string form of the ranking number and the form of Rank<ranking value data structure>; RankDecimal<ranking value>: used to represent the actual size of a ranking value, including the sign, exponent, and RankInteger<ranking unsigned integer>; RankInteger<ranking unsigned integer>: indicates that the storage and representation of unsigned integers in multiple bases are implemented. The base is specified when the system is started, and Java integer arrays are used internally.<int[]> To store the value of each bit.

[0014] Compared with the prior art, the present invention provides a work item quick sorting algorithm for a project management system. The algorithm greatly improves the efficiency of sorting operations, especially when the number of work items is large or changes frequently. The algorithm can flexibly adapt to the addition, deletion and reordering of work items, and is compatible with various scenarios that cannot be sorted by common conventional sorting algorithms. It is an ideal solution for work item sorting in agile project management. The algorithm provides a simple and easy-to-use interface and can be easily integrated into existing project management tools. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is the overall workflow diagram of the present invention.

[0016] Figure 2 This is a workflow diagram of exception handling 1 in the present invention. DETAILED DESCRIPTION

[0017] The present invention will be further described below with reference to the accompanying drawings.

[0018] The main purpose of this invention is to provide a work item fast sorting algorithm to solve the challenge of frequent changes in work item sorting numbers in agile project management. The algorithm aims to achieve the following goals: 1. Improve sorting reliability. Regardless of the status of the sorting number stored in the system, it is necessary to respond to the customer's sorting adjustment request and ensure that the processing result is consistent with the customer's expectations.

[0019] 2. Through the algorithm, the number of database entries that need to be actually updated during sorting adjustment is reduced, thereby improving efficiency.

[0020] 3. Provide a simple and easy-to-use external interface to facilitate the reuse of algorithms in different entities that need to be sorted.

[0021] The algorithm of the present invention is mainly composed of the following core components: RankUtil<Sorting Tool>: Provides access to the sorting function and a method for calculating a new sorting value based on the previous sorting value and the next sorting value.

[0022] Rank<rank value data structure>: represents a ranking number data structure, which is the core data structure of the sorting algorithm. It consists of RankBucket<ranking bucket> and RankDecimal<ranking value>.

[0023] RankBucket<sort bucket>: contains a string to distinguish the business meanings of different sorts. If the strings contained in the RankBucket<sort bucket> of two Rank<sort value data structures> are different, sorting cannot be performed and the system will throw an exception, indicating that the sort buckets are inconsistent.

[0024] RankNumeralSystem<ranking numerical system> and RankNumeralSystemHelper<ranking numerical system helper tool>: implement different numerical systems, including decimal, 36-base and 64-base by default, to support the conversion between the string form of the sorting number and the Rank<sorting value data structure> form.

[0025] RankDecimal<ranking value>: used to represent the actual size of a ranking value, including the sign (positive, negative, 0), exponent (based on the selected base), and RankInteger<ranking unsigned integer> RankInteger<ranking unsigned integer>: implements the storage and representation of unsigned integers in multiple bases. The base is specified when the system is started, and Java integer arrays are used internally.<int[]> To store the value of each digit. For example, "100" in decimal is stored as int[]{1,0,0}; "f1" in hexadecimal is stored as int[]{15,1} 1. Initialize the sorting system definition when the system starts: 1. Define the base used by the system.

[0026] 2. Define the range of data that the sorting system can handle (upper and lower bounds).

[0027] 3. Define the granularity of equal division when the sorting system searches for the middle value of two sorted values ​​(the minimum is 2 equal divisions, and the maximum is equal to the number of symbols in the base).

[0028] 4. Define a quick-lookup multiplier set, usually an enumeration of the symbols of the base, and use it together with the equal division granularity to quickly determine the position of a new sort value between two sort values ​​without using division.

[0029] 5. Define the default step size when generating new predecessor / successor node sort values ​​from sort values.

[0030] Second, for newly added work items or work items whose positions are adjusted by the user by dragging, the algorithm calculates a new sort mark based on the position of the current work item (e.g., between two known work items, before all work items, at ).

[0031] like Figure 1 As shown, the specific implementation process of the algorithm of the present invention is: Step 1: The business method calls RankUtil<ranking tool> and passes in the predecessor ranking value and the successor ranking value. Step 2: Determine whether the predecessor sort value and the successor sort value are empty, if yes, proceed to step 3; otherwise, proceed to step 4; Step 3: If both the predecessor ranking value and the successor ranking value are empty, set the predecessor ranking value to the minimum ranking value of the ranking system, set the successor ranking value to the maximum ranking value of the ranking system, and continue with step 7; Step 4: If both the predecessor ranking value and the successor ranking value are not empty, continue to judge whether the predecessor ranking value and the successor ranking value are not empty. If the predecessor ranking value is empty but the successor ranking value is not empty, continue to step 5; if the successor ranking value is empty but the predecessor ranking value is not empty, continue to step 6; Step 5: If the predecessor sort value is empty but the successor sort value is not empty, return the previous sort value of the successor sort value. If the subtraction result is less than the minimum sort value allowed by the system, return the minimum sort value and continue to step 9; Step 6: If the successor sort value is empty but the predecessor sort value is not empty, return the next sort value of the predecessor sort value. If the added result is greater than the maximum sort value allowed by the system, return the maximum sort value and continue to step 9; Step 7: Compare the predecessor sort value and the successor sort value, use the smaller sort value as the first parameter of the subsequent method, and use the larger sort value as the second parameter of the subsequent method; Step 8: Get a value whose size is between the two input sort values ​​and return it as the new sort value; Step 9: Format the Rank<rank value data structure> object into a string value and return it to the calling method.

[0032] Among them, in step 7, the size of the Rank<ranking value data structure> object is realized based on comparing the member variable RankDecimal<ranking value> object in the Rank<ranking value data structure> object: (1) Compare the sign properties of the RankDecimal<ranking value> objects, positive number > 0 > negative number; (2) If the sign attributes are the same, compare the exponent attributes. Since exponent attributes are all non-negative integers, the RankDecimal<ranking value> object with a larger exponent attribute has a larger value, and thus it can be deduced that the Rank<ranking value data structure> object to which it belongs is larger. (3) If the exponent attributes are also the same, further compare the RankInteger<ranking unsigned integer> attributes in the RankDecimal<ranking value> objects. Specifically, compare the numbers in the Java integer array in the RankInteger<ranking unsigned integer> attributes bit by bit from low to high. If there is a difference in size, determine which RankInteger<ranking unsigned integer> attribute is larger based on the difference. If there is no difference, continue to compare the next digit of each. (4) If the Java integer array of a RankInteger<sorted unsigned integer> has not been completely read and the size has not been compared, and the Java integer array of another RankInteger<sorted unsigned integer> has not been completely read, then the RankInteger<sorted unsigned integer> that has not been read is larger; (5) If two Java integer arrays of RankInteger<sorted unsigned integers> are read at the same time and their sizes are not compared, the two RankInteger<sorted unsigned integers> are determined to be the same size.

[0033] Among them, in step 8, a suitable sort value whose size is between the two input sort values ​​is obtained: (1) Subtract the values ​​of the two passed in Rank<ranking value data structure> objects, and the difference is the remaining available range between them; (2) If the remaining available interval is 0, an exception is thrown, indicating that the predecessor sort value and the successor sort value are equal, otherwise continue; (3) According to the number of digits in the remaining interval and the granularity of equal division, determine the scaling factor of the quick-check multiplier set. The formula is as follows: Multiplier set scaling factor = the number of integer digits in the remaining available interval - ⌊ln(equal division granularity) / ln(base (decimal is 10, hexadecimal is 36, and 64th base is 64))⌋; (4) Multiply the quick-check multiplier set by the scaling factor and 0.1 respectively. The resulting set is the actual quick-check multiplier set used in this calculation. (5) Traverse the real quick-check multiplier set from large to small, and multiply them by the equal granularity. If the multiplication result is larger than the size of the available interval, continue to use the next number in the set for multiplication. Otherwise, use this value as the incremental step value (this step actually uses the approximate result generated by multiplication instead of the exact result of division, because the algorithm complexity of multiplication is much lower than that of division, and the difference between the approximate value and the exact value can be ignored for the sorting system, so this solution is used here to improve execution efficiency); (6) If a suitable incremental step value is not found after the real quick-check multiplier set is traversed, it usually means that the available interval is 0, and an exception is thrown, indicating that the predecessor sort value is the same as the successor sort value; (7) Find a suitable number as a temporary result value. The specific calculation process is: first, perform a left shift operation (if the incremental step value is less than 1) or a right shift operation (if the incremental step value is greater than or equal to 1) on the predecessor sort value and the incremental step value simultaneously until the integer part of the incremental step value is 1 bit, discard the decimal part of the predecessor sort value and the incremental step value at this time, and record the remaining integer parts as the divisor and dividend respectively. Continue to add one to the divisor and take the remainder from the dividend until the remainder is 0 (divisible), and record the dividend at this time as the result base. Then shift the result base left (if the incremental step value is greater than or equal to 1) or right (if the incremental step value is less than 1) by the number of bits that the incremental step value has just been right-shifted or left-shifted, and the value obtained is the appropriate number. Since the operation of taking the remainder in a loop here, the divisor and the dividend are both integers, so all of them are converted into integer division in Java for calculation to speed up the calculation; (8) Multiply the incremental step value by 0.5, and record the result as the half-length increment. Subtract the predecessor sort value from the temporary result value, and record the result as the difference. Determine whether the difference is greater than or equal to the half-length increment, and return the temporary result as the final result. Otherwise, return the temporary result plus the incremental step value as the final result.

[0034] The processing flow of addition is as follows: (1) Handling the case of different signs: If the addend is a negative number, then negate the addend to get a positive value, then subtract the addend from the positive value, and finally negate the result again; if the addend is a positive number, then negate the addend, then subtract the negated addend from the addend; (1) Handling the case of the same sign: If the signs of the addend and the augend are the same, the addition operation can be performed directly; (3) Additive bottom-level processing: a) Align the exponent by left-shifting the integer portion of the shorter number; b) Create a new array with the length of the longer of the two input arrays. For each digit, calculate the corresponding sum and take into account the carry. If the last digit also produces a carry, the result array needs to be expanded to accommodate the extra carry; c) Determine the exponent of the sum based on the larger value of the exponents of the two numbers before the addition operation; d) Adjust the exponent (shift left or right) and remove leading and trailing zeros from the result.

[0035] The subtraction process is as follows: (1) Handling the case of different signs: invert the number with a negative sign and then perform the addition operation; (2) Handling the case where the symbols are the same: a) Calculate the two's complement of the subtrahend; b) Add the two's complement of the minuend to the minuend; c) Adjust the most significant bit: Since extra carries may occur in two’s complement addition, this step ensures that the most significant bit is set to 0; d) The last step is to add 1 to the result of the previous step. This is because in the two's complement representation, in order to get the final negative result, you need to add 1 after the addition operation; e) Adjust the exponent (shift left or right) and remove leading and trailing zeros.

[0036] The multiplication process is as follows: (1) The sign bit is multiplied as the sign bit of the result; (2) The exponent bits are multiplied to form the exponent bits of the result; (3) Initialize the result array: create a new array with the length of the sum of the two operands; (4) Use a double loop to traverse each bit of the multiplier and multiplicand. For each pair of bit products, add them to the corresponding position of the result array and handle the carry; (5) Adjust the exponent (shift left or right) and remove the leading and trailing zeros.

[0037] Among them, the Rank object is formatted into a string value for output: (1) Serialize RankBucket<sort bucket> into text, that is, the string corresponding to RankBucket<sort bucket> itself, and splice it to the front of the result; (2) Add a vertical bar (|) to separate the RankBucket part and the RankDecimal part; (3) Calculate the string corresponding to RankDecimal<ranking value>: a) If the sign of the RankDecimal<ranking value> contained in the Rank<ranking value data structure> is negative, a minus sign (-) is added, otherwise no sign is added; b) According to the exponent of RankDecimal<ranking value> and the Java integer array of RankInteger<ranking unsigned integer> contained in RankDecimal<ranking value>, determine the integer part and the decimal part, the integer part and the decimal part are separated by a colon (:), and the integer part is processed first, and then the decimal part; c) Process the integer part and the decimal part separately: according to each digit in the Java integer array, look up the table in RankNumeralSystem<ranking numerical system> to get the corresponding character processing and splice them together; d) Remove the leading 0 and the trailing 0 from the obtained string. If the integer is less than 6 digits after the removal, add 0 to 6 digits in front. e) Return this string.

[0038] Among them, the exception handling is as follows: like Figure 2 As shown, exception 1, the predecessor sort value and the successor sort value are equal, resulting in an error in the available interval when obtaining the intermediate value: (1) Determine whether the predecessor ranking value is equal to the system minimum value. If so, jump to step (2); otherwise, jump to step (5); (2) Query the database to find the smallest ranking value that is greater than the subsequent ranking value; (3) Calculate the middle value between this value in step (2) and the predecessor sort value, and record it as the new value; (4) Set the incoming successor sort value to this new value and jump to step (8); (5) Query the database for the largest ranking value that is smaller than the subsequent ranking value; (6) Calculate the intermediate value between this value in step (5) and the subsequent sorted value, and record it as the new value; (7) Set the incoming predecessor sort value to this new value and jump to step (8); (8) Re-calculate the intermediate value using the new predecessor sort value and successor sort value.

[0039] Exception handling 2: when the successor node is the system minimum value, take the pre value: convert it into the case where both the predecessor value and the successor value are the system minimum value, and bring it into the processing.

[0040] Exception handling 3: take the next value when the predecessor node is the system maximum value: convert it into the case where both the predecessor value and the successor value are the system maximum values, and bring it into the processing.

[0041] Compared with traditional sorting algorithms, the algorithm of the present invention greatly improves the efficiency of sorting operations, especially when there are a large number of work items or they change frequently; the algorithm can flexibly adapt to the addition, deletion and reordering of work items, and is compatible with various scenarios that cannot be sorted by common conventional sorting algorithms. It is an ideal solution for sorting work items in agile project management; the algorithm provides a simple and easy-to-use interface and can be easily integrated into existing project management tools.

[0042] Embodiment: The method of the present invention is currently used to support work item sorting in the company's PMSSaaS system. The current work item data set size is about 1.6 million. Before applying the method of the present invention, a traditional integer-based sorting number scheme was used. Due to the architectural limitations of the traditional scheme, when frequently dragging work items for sorting, there will be scenarios where the sorting numbers of tens of thousands of work items need to be updated at one time. The customer response delay is as high as more than ten seconds, which seriously affects the customer experience and greatly consumes the computing power of the database server. After using the method of the present invention, the probability of scenarios requiring large-scale updates to work item sorting numbers has dropped by 10 times, and the average time spent on work item sorting has been reduced to 200 milliseconds, significantly improving the benefits of the company and its customers.

Claims

1. A quick sorting algorithm for work items in a project management system, characterized by: The specific method is as follows: Step 1: The business method calls RankUtil<ranking tool> and passes in the predecessor ranking value and the successor ranking value; Step 2: Determine whether the predecessor sort value and the successor sort value are empty, if yes, proceed to step 3; otherwise, proceed to step 4; Step 3: If both the predecessor ranking value and the successor ranking value are empty, set the predecessor ranking value to the minimum ranking value of the ranking system, set the successor ranking value to the maximum ranking value of the ranking system, and continue with step 7; Step 4: If both the predecessor ranking value and the successor ranking value are not empty, continue to judge whether the predecessor ranking value and the successor ranking value are not empty. If the predecessor ranking value is empty but the successor ranking value is not empty, continue to step 5; if the successor ranking value is empty but the predecessor ranking value is not empty, continue to step 6; Step 5: If the predecessor sort value is empty but the successor sort value is not empty, return the previous sort value of the successor sort value. If the subtraction result is less than the minimum sort value allowed by the system, return the minimum sort value and continue to step 9; Step 6: If the successor sort value is empty but the predecessor sort value is not empty, return the next sort value of the predecessor sort value. If the added result is greater than the maximum sort value allowed by the system, return the maximum sort value and continue to step 9; Step 7: Compare the predecessor sort value and the successor sort value, use the smaller sort value as the first parameter of the subsequent method, and use the larger sort value as the second parameter of the subsequent method; Step 8: Get a value whose size is between the two input sort values ​​and return it as the new sort value; Step 9: Format the Rank<rank value data structure> object into a string value and return it to the calling method.

2. The work item quick sorting algorithm for a project management system according to claim 1, characterized in that: The predecessor sort value and the successor sort value are both sort values ​​represented by character strings.

3. The work item quick sorting algorithm for a project management system according to claim 1, characterized in that: The specific process of step seven is as follows: (1) Compare the sign properties of the RankDecimal<ranking value> objects, positive number > 0 > negative number; (2) If the sign attributes are the same, compare the exponent attributes. Since exponent attributes are all non-negative integers, the RankDecimal<ranking value> object with a larger exponent attribute has a larger value, and thus it can be deduced that the Rank<ranking value data structure> object to which it belongs is larger. (3) If the exponent attributes are also the same, further compare the RankInteger<ranking unsigned integer> attributes in the RankDecimal<ranking value> objects. Specifically, compare the numbers in the Java integer array in the RankInteger<ranking unsigned integer> attributes bit by bit from low to high. If there is a difference in size, determine which RankInteger<ranking unsigned integer> attribute is larger based on the difference. If there is no difference, continue to compare the next digit of each. (4) If the Java integer array of a RankInteger<sorted unsigned integer> has not been completely read and the size has not been compared, and the Java integer array of another RankInteger<sorted unsigned integer> has not been completely read, then the RankInteger<sorted unsigned integer> that has not been read is larger; (5) If two Java integer arrays of RankInteger<sorted unsigned integers> are read at the same time and the sizes are not compared, the two RankInteger<sorted unsigned integers> are determined to be the same size; The size of the Rank<ranking value data structure> object is achieved based on comparing the member variable RankDecimal<ranking value> object in the Rank<ranking value data structure> object.

4. The work item quick sorting algorithm for a project management system according to claim 1, characterized in that: The specific process of step eight is as follows: (1) Subtract the values ​​of the two passed in Rank<ranking value data structure> objects, and the difference is the remaining available range between them; (2) If the remaining available interval is 0, an exception is thrown, indicating that the predecessor sort value and the successor sort value are equal, otherwise continue; (3) According to the number of digits in the remaining interval and the equal division granularity, determine the scaling factor of the quick-check multiplier set. The formula is: Multiplier set scaling factor = Number of integer digits in the remaining available interval - [ln (equal division granularity) / ln (base (decimal is 10, hexadecimal is 36, and 64th base is 64))]; (4) Multiply the quick-check multiplier set by the scaling factor and 0.1 respectively. The resulting set is the actual quick-check multiplier set used in this calculation. (5) Traverse the real quick-check multiplier set from large to small, and multiply them by the equal granularity. If the multiplication result is larger than the size of the available interval, continue to use the next number in the set for multiplication. Otherwise, use this value as the incremental step value. (6) If a suitable incremental step value is still not found after the real quick-check multiplier set is traversed, it means that the available interval is 0, and an exception is thrown, indicating that the predecessor sort value is the same as the successor sort value; (7) Find a suitable number as the temporary result value. The specific calculation process is as follows: first, perform a left shift or a right shift operation on the predecessor sort value and the incremental step value synchronously until the integer part of the incremental step value is 1 bit, discard the decimal part of the predecessor sort value and the incremental step value at this time, and record the remaining integer parts as the divisor and dividend respectively; (8) Multiply the incremental step value by 0.5, and the result is recorded as the half-length increment; Subtract the predecessor sort value from the temporary result value, and record the result as the difference; determine whether the difference is greater than or equal to the half-length increment, and return the temporary result as the final result; Otherwise, the temporary result plus the incremental step value is returned as the final result.

5. The work item quick sorting algorithm for a project management system according to claim 1, characterized in that: The specific process of step nine is as follows: (1) Serialize RankBucket<sort bucket> into text, that is, the string corresponding to RankBucket<sort bucket> itself, and splice it to the front of the result; (2) Add a vertical bar (|) to separate the RankBucket part and the RankDecimal part; (3) Calculate the string corresponding to RankDecimal<ranking value>: (a) If the sign of the RankDecimal<ranking value> contained in the Rank<ranking value data structure> is negative, a minus sign (-) is added, otherwise no sign is added; (b) According to the exponent of RankDecimal<ranking value> and the Java integer array of RankInteger<ranking unsigned integer> contained in RankDecimal<ranking value>, determine the integer part and the decimal part, the integer part and the decimal part are separated by a colon (:), and the integer part is processed first, and then the decimal part; (c) Process the integer part and the decimal part separately: according to each digit in the Java integer array, look up the table in RankNumeralSystem<ranking numerical system> to get the corresponding character processing and concatenate them; (d) Remove the leading 0 and the trailing 0 from the resulting string. If the integer is less than 6 digits after the removal, add 0 to 6 digits in front. (e) Returns this string.

6. The work item quick sorting algorithm for a project management system according to claim 4, characterized in that: The exception handling includes the following situations: Exception handling 1: The predecessor sort value and the successor sort value are equal, resulting in an error message when obtaining the intermediate value and failing to obtain the available interval. The specific handling process is as follows: (1) Determine whether the predecessor ranking value is equal to the system minimum value. If so, jump to step (2); otherwise, jump to step (5); (2) Query the database to find the smallest ranking value that is greater than the subsequent ranking value; (3) Calculate the middle value between this value in step (2) and the predecessor sort value, and record it as the new value; (4) Set the incoming successor sort value to this new value and jump to step (8); (5) Query the database for the largest ranking value that is smaller than the subsequent ranking value; (6) Calculate the intermediate value between this value in step (5) and the subsequent sorted value, and record it as the new value; (7) Set the incoming predecessor sort value to this new value and jump to step (8); (8) Re-calculate the intermediate value using the new predecessor ranking value and successor ranking value; Exception handling 2: when the successor node is the system minimum value, take the pre value: convert it into the case where both the predecessor value and the successor value are the system minimum value, and bring it into the processing; Exception handling 3: take the next value when the predecessor node is the system maximum value: convert it into the case where both the predecessor value and the successor value are the system maximum values, and bring it into the processing.

7. The work item quick sorting algorithm for a project management system according to claim 4, characterized in that: The specific process of the addition is as follows: (1) Handling the case of different signs: If the addend is a negative number, then negate the addend to get a positive value, then subtract the addend from the positive value, and finally negate the result again; if the addend is a positive number, then negate the addend, then subtract the negated addend from the addend; (2) Handling the case of identical signs: If the signs of the addend and the augend are identical, the addition operation can be performed directly. (3) Additive bottom-level processing: (a) Align the exponent by left-shifting the integer portion of the shorter number; (b) Create a new array with the length of the longer of the two input arrays. For each digit, calculate the corresponding sum and take into account the carry. If the last digit also produces a carry, the result array needs to be extended to accommodate this extra carry. (c) Determine the exponent of the sum based on the larger value of the exponents of the two numbers before the addition operation; (d) Adjust the exponent, that is, shift it left or right, and remove the leading and trailing zeros of the result.

8. The work item quick sorting algorithm for a project management system according to claim 4, characterized in that: The specific process of the subtraction is as follows: (1) Handling the case of different signs: invert the number with a negative sign and then perform the addition operation; (2) Handling the case where the symbols are the same: (a) Calculate the two's complement of the subtrahend; (b) add the two's complement of the minuend to the minuend; (c) Adjust the most significant bit: Since extra carries may occur in two’s complement addition, this step ensures that the most significant bit is set to 0; (d) The last step is to add 1 to the result of the previous step; (e) Adjust the exponent, that is, shift it left or right and remove the leading and trailing zeros.

9. The work item quick sorting algorithm for a project management system according to claim 4, characterized in that: The specific process of the multiplication is as follows: (1) The sign bit is multiplied as the sign bit of the result; (2) The exponent bits are multiplied to form the exponent bits of the result; (3) Initialize the result array: create a new array with the length of the sum of the two operands; (4) Iterate through each bit of the multiplier and multiplicand through a double loop, accumulate the product of each pair of bits to the corresponding position of the result array, and handle the carry; (5) Adjust the exponent, that is, shift it left or right, and erase the leading and trailing zeros.

10. The work item quick sorting algorithm for a project management system according to claim 1, characterized in that: RankUtil<ranking tool>: represents the access point for providing the ranking function, and provides a method for calculating a new ranking value based on the previous ranking value and the next ranking value; Rank<rank value data structure>: represents a ranking number data structure, which is the core data structure of the sorting algorithm and consists of RankBucket<ranking bucket> and RankDecimal<ranking value>; RankBucket<sort bucket>: indicates that it contains a string to distinguish the business meanings of different sorts. If the strings contained in the RankBucket<sort bucket> of two Rank<sort value data structures> are different, sorting cannot be performed and the system will throw an exception, indicating that the sort buckets are inconsistent; RankNumeralSystem<ranking numerical system> and RankNumeralSystemHelper<ranking numerical system helper tool>: represent the implementation of different numerical systems, including decimal, 36-base, and 64-base by default, to support the conversion between the string form of the ranking number and the form of Rank<ranking value data structure>; RankDecimal<ranking value>: used to represent the actual size of a ranking value, including the sign, exponent, and RankInteger<ranking unsigned integer>; RankInteger<ranking unsigned integer>: indicates that the storage and representation of unsigned integers in multiple bases are implemented. The base is specified when the system is started, and Java integer arrays are used internally.<int[]> To store the value of each bit.