Insertion sorting method, device and system, computer program product and computer readable storage medium
By converting the sorting numbers on the role-based access control front-end page into a decimal array and generating new numbers through array comparison, the tedious number modification problem in traditional methods is solved, enabling fast and flexible insertion sorting, thus improving operational efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional role-based access control front-end page insertion and sorting methods require manually modifying a large number of numbers, which is cumbersome and error-prone, especially when there are many roles or the sorting changes frequently, resulting in poor user experience and efficiency.
The sorting numbers are converted into integer arrays with decimal digits. The sorting order is determined by comparing array elements. When a new character is inserted between any two characters, a new number that conforms to the array rules is generated without changing the existing character numbers.
It achieves fast and flexible insertion sorting, improves operational efficiency, has clear logic, and is suitable for permission management scenarios with a large number of roles, especially for external data transactions of financial institutions.
Smart Images

Figure CN121834015A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology, and in particular to an insertion sorting method, device, system, computer program product and computer readable storage medium capable of quick insertion sorting of role positions in a role permission management front-end page without large-scale renumbering. BACKGROUND
[0002] With the advent of the information age in China, financial institutions have gradually formed a digital transformation strategy focusing on financial technology driven by "technology + data". In this process, financial institutions have increasingly greater demand for external data and increasingly deep application of external data, and the external data market has experienced explosive growth. Therefore, fine management of external data has become the top priority, and external data transaction role permission management is an important part. Based on the need for role permission management, multiple role positions need to be set, and the front-end page management operation experience becomes increasingly important. Due to business needs, new role positions often need to be added or adjusted, and administrators need to manually sort and adjust the front-end page.
[0003] The traditional sorting adjustment method usually assigns a continuous integer number (such as 1, 2, 3,...) to each role, and the front-end displays in this order. When a new role needs to be inserted between two existing roles (for example, between numbers N and N+1), the existing technology usually needs to add 1 to all role numbers after the original number N+1 in order to make room for the new role. For example, to insert a new role between numbers 3 and 4, the original 4 is changed to 5, the original 5 is changed to 6, and so on. This process requires administrators to manually modify all subsequent affected role numbers one by one on the front-end interface, which is tedious, inefficient, and prone to errors, especially when there are a large number of roles or frequent sorting changes, the user experience and operation efficiency are particularly problematic.
[0004] Therefore, there is an urgent need for a technology that can achieve quick and flexible insertion sorting in the role permission management front-end page without large-scale modification of existing numbers.
[0005] This section is intended to provide background or context to the embodiments of the application recited in the claims. The description herein does not admit that it is prior art merely because it is included in this section. SUMMARY
[0006] The present application aims to solve the technical problems existing in the prior art, and provides an insertion sorting method, an insertion sorting device, a computer program product and a storage medium for quickly performing insertion sorting on a role permission management front-end page. The present application converts the sorting numbers in integer form into integer arrays split by digits, and performs sorting and insertion of the sorting numbers based on the comparison of array elements one by one, so that when a new role is inserted between any two roles, only a new number between the two in the sense of array comparison needs to be found for the new role, without changing the numbers and sorting positions of any existing roles.
[0007] To achieve the above-mentioned purpose, the first aspect of the present application provides an insertion sorting method for performing insertion sorting on a role permission management front-end page, comprising the following steps:
[0008] Step S1, assigning sorting numbers to each role position displayed on the role permission management front-end page, wherein the sorting numbers are arbitrary positive integers;
[0009] Step S2, converting the sorting numbers into decimal representation, and taking each digit of the decimal representation as an array element from left to right in the order from high to low, thereby converting each sorting number into an array, wherein the array is an integer array;
[0010] Step S3, determining the size relationship of each array based on the comparison of array elements one by one, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence;
[0011] Step S4, when a new role position needs to be inserted between the role position of the Nth sorting number and the role position of the (N+1)th sorting number, generating a sorting number M for the newly inserted role position, wherein the sorting number M satisfies the following conditions: when the M is converted into an array according to the method of step S2 and the size comparison of the array is performed according to the method of step S3, the size of the array corresponding to the M is between the array of the Nth sorting number and the array of the (N+1)th sorting number, wherein M and N are arbitrary positive integers; and
[0012] Step S5, inserting the sorting number M as the sorting number of the newly inserted role position between the Nth sorting number and the (N+1)th sorting number, without changing the sorting of other sorting numbers in the sorting number sequence; and
[0013] Step S6, the front-end page displays each role position according to the updated sorting number sequence.
[0014] Preferably, in the step S3, when performing the comparison of each array element by element, the arrays are compared in size from left to right from the first array element of the array, if a certain array has no element at the array element position, it is considered NULL, NULL is smaller than any integer, when the size relationship between the arrays is compared at a certain array element position, the comparison of the subsequent array elements is stopped, and the size relationship between the arrays is determined according to the comparison result of the current array element.
[0015] Preferably, in the step S4, when generating the sorting number M, the sorting number of the Nth sorting number is N', converted into decimal representation as N'=a n *10 n-1 +a n-1 *10 n-2 +…+a1*10 0 , converted into array representation as { a n , a n-1 , a n-2 , …, a1}, wherein n is the number of digits of the decimal representation of the Nth sorting number, a n , a n-1 , a n-2 , …, a1 is the value of each digit of the decimal representation of the Nth sorting number,
[0016] Let M=N'*10 k +h1*10 k-1 +h2*10 k-2 +…+h k *10 0 , k is an integer greater than or equal to 1, h1, h2…h k is an integer from 0 to 9,
[0017] The sorting number M is generated as follows:
[0018] a) initialize k=1;
[0019] b) h1, h2, …, h k-1 =9;
[0020] c) h k =9;
[0021] d) according to formula 1, calculate M, determine whether the M value meets the condition that it is not occupied by any sorting number in the current sorting number sequence and the size of the array corresponding to M is smaller than the array of the N+1th sorting number, if the condition is met, take the M value as the sorting number of the newly inserted role position, end the evaluation process of the sorting number M, otherwise h k =h k-1;
[0022] e) when h k is greater than or equal to 0, the process of d) is executed in a loop, when h k is less than 0, the process of f) is entered;
[0023] f) when h k is traversed from 9 to 0, and the M value satisfying the condition is not found, h k-1 is set to h k-1 -1, when h k-1 is greater than or equal to 0, the processes of c) to e) are executed in a loop, when h k-1 is less than 0, the process of g) is entered;
[0024] g) when h k-1 is traversed from 9 to 0, and the M value satisfying the condition is not found, h k-2 is set to h k-2 -1, h k-1 , h k are initialized to 9, and the processes of c) to f) are executed in a loop, when h k-2 is less than 0, the process of h) is entered;
[0025] h) h k-3 , h k-4 , …, h1 are traversed by the above method until the M value satisfying the condition is calculated;
[0026] i) when the M value satisfying the condition is not found after the above traversal calculation, k is set to k+1, and the processes of b) to h) are executed in a loop.
[0027] Preferably, the sorting numbers in the sorting number sequence are arranged in ascending order of the arrays converted from the sorting numbers.
[0028] Preferably, the sorting numbers in the sorting number sequence are arranged in descending order of the arrays converted from the sorting numbers.
[0029] Preferably, the insertion sort method is applied to the external data transaction role permission management of a financial institution.
[0030] Preferably, when the role positions are displayed on the role permission management front page, the role positions are displayed according to the arrangement order of the sorting numbers in the sorting number sequence assigned to the role positions.
[0031] The second aspect of the application provides an insertion sort device for performing insertion sort on a role permission management front page, the insertion sort device comprising a processor, and the processor performs the following steps:
[0032] Step S1: Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer;
[0033] Step S2: Convert the sorting number into a decimal representation, and use each digit of the decimal representation as an array element from left to right in order from the most significant digit to the least significant digit, thereby converting each sorting number into an array, wherein the array is an integer array;
[0034] Step S3: Based on the comparison of each array element after the transformation, determine the size relationship of each array, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence.
[0035] Step S4: When a new role position needs to be inserted between the role position with the Nth sorted number and the role position with the (N+1)th sorted number, a sorted number M is generated for the newly inserted role position. The sorted number M satisfies the following condition: when M is converted into an array according to the method in step S2 and the array size is compared according to the method in step S3, the size of the array corresponding to M is between the array with the Nth sorted number and the array with the (N+1)th sorted number, where M and N are any positive integers; and
[0036] Step S5: Insert the sort number M as the sort number for the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the order of other sort numbers in the sort number sequence; and
[0037] Step S6: The front-end page displays each of the roles and positions according to the updated sorting number sequence.
[0038] A third aspect of the present invention provides an insertion sorting system for performing insertion sorting on a role-based access control front-end page. The insertion sorting system includes a processor that performs the following processing:
[0039] Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer;
[0040] The sorting number is converted into a decimal representation, and each digit of the decimal representation is used as an array element from left to right in order from the most significant digit to the least significant digit. Thus, each sorting number is converted into an array, wherein the array is an integer array.
[0041] The size relationship of each array is determined by comparing each element of the transformed arrays, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence.
[0042] When a new role position needs to be inserted between the role position with the Nth sorted number and the role position with the (N+1)th sorted number, a sorted number M is generated for the newly inserted role position. The sorted number M satisfies the following condition: when M is converted into an array according to step S2 and the array size is compared according to step S3, the size of the array corresponding to M is between the array with the Nth sorted number and the array with the (N+1)th sorted number, where M and N are any positive integers; and
[0043] Insert the sort number M as the sort number for the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the order of other sort numbers in the sort number sequence; and
[0044] The updated sorting sequence is used to display each of the aforementioned roles and positions on the front-end page.
[0045] A fourth aspect of the present invention provides a computer program product comprising an insertion sorting program for performing insertion sorting on a role-based access control front-end page, the insertion sorting program causing the computer to perform the following steps:
[0046] Step S1: Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer;
[0047] Step S2: Convert the sorting number into a decimal representation, and use each digit of the decimal representation as an array element from left to right in order from the most significant digit to the least significant digit, thereby converting each sorting number into an array, wherein the array is an integer array;
[0048] Step S3: Based on the comparison of each array element after the transformation, determine the size relationship of each array, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence.
[0049] Step S4: When a new role position needs to be inserted between the role position with the Nth sorted number and the role position with the (N+1)th sorted number, a sorted number M is generated for the newly inserted role position. The sorted number M satisfies the following condition: when M is converted into an array according to the method in step S2 and the array size is compared according to the method in step S3, the size of the array corresponding to M is between the array with the Nth sorted number and the array with the (N+1)th sorted number, where M and N are any positive integers; and
[0050] Step S5: Insert the sort number M as the sort number for the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the order of other sort numbers in the sort number sequence; and
[0051] Step S6: The front-end page displays each of the roles and positions according to the updated sorting number sequence.
[0052] A fifth aspect of the present invention provides a computer-readable storage medium storing an insertion sorting program for performing insertion sorting on a role-based access control front-end page, the insertion sorting program causing the computer to perform the following steps:
[0053] Step S1: Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer;
[0054] Step S2: Convert the sorting number into a decimal representation, and use each digit of the decimal representation as an array element from left to right in order from the most significant digit to the least significant digit, thereby converting each sorting number into an array, wherein the array is an integer array;
[0055] Step S3: Based on the comparison of each array element after the transformation, determine the size relationship of each array, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence.
[0056] Step S4: When a new role position needs to be inserted between the role position with the Nth sorted number and the role position with the (N+1)th sorted number, a sorted number M is generated for the newly inserted role position. The sorted number M satisfies the following condition: when M is converted into an array according to the method in step S2 and the array size is compared according to the method in step S3, the size of the array corresponding to M is between the array with the Nth sorted number and the array with the (N+1)th sorted number, where M and N are any positive integers; and
[0057] Step S5: Insert the sort number M as the sort number for the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the order of other sort numbers in the sort number sequence; and
[0058] Step S6: The front-end page displays each of the roles and positions according to the updated sorting number sequence.
[0059] This invention enables fast and flexible insertion and sorting in the role and permission management front-end page, without requiring large-scale modifications to existing numbers.
[0060] The present invention can achieve the following beneficial effects.
[0061] Efficient and convenient operation: When adjusting the order of job roles, administrators do not need to manually modify the numbers of a large number of existing roles. They only need to generate a new number that conforms to the array sorting rules for the new role, which greatly improves the efficiency of manual sorting on the front-end page.
[0062] The logic is clear and intuitive: the sorting numbers are split into arrays by digit for comparison, which conforms to the intuitive understanding of human numerical order (e.g., "31" is between "3" and "4"), making it easy for administrators to understand and use.
[0063] Highly scalable: This method does not rely on the continuity of the numbering or a specific base, and can theoretically generate an infinite number of intermediate numbers, flexibly handling frequent sorting and insertion requirements.
[0064] Wide range of applications: Especially suitable for permission management scenarios such as external data transactions of financial institutions that require refined management, have multiple roles and positions, and have frequent sorting requirements. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0066] Figure 1 This is a structural diagram of the insertion sorting device according to an embodiment of the present invention.
[0067] Figure 2 This is a flowchart of the insertion sorting method according to an embodiment of the present invention. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0069] The acquisition, transmission, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0070] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0071] (Example 1)
[0072] This embodiment provides an insertion sorting device 1 for sorting insertions on a role-based access control front-end page. This embodiment is applied to the front-end of an external data transaction role-based access control system for financial institutions.
[0073] First use Figure 1 The structure of the insertion sorting device in this embodiment will be described.
[0074] Example 1 of the insertion sorting device is configured as a computer 10. The computer 10 includes, for example, a CPU (Central Processing Unit) 11 (as a processor), a ROM (Read-Only Memory) 12, a RAM (Random Access Memory) 13, a non-volatile memory 14, and an input / output interface (I / O) 15. The CPU 11, ROM 12, RAM 13, non-volatile memory 14, and I / O 15 are interconnected via a bus 16. An operation unit 17, a display unit 18, and a communication unit 19 are connected to the I / O 15.
[0075] Non-volatile memory 14 is an example of a storage device that retains stored information even when the power supply to non-volatile memory 14 is cut off. For example, semiconductor memory can be used, but hard disks can also be used. Non-volatile memory 14 does not necessarily have to be built into computer 10; for example, it can be a removable storage device that can be installed and removed from computer 10, such as a memory card.
[0076] The operation unit 17 is a functional unit operated by users (administrators) of the role and permission management front-end page, and is composed of input devices such as mouse, keyboard and touch panel.
[0077] Display unit 18 is a functional unit that displays the front-end page for role permission management, and may be configured to include display devices such as liquid crystal displays, organic EL (Electro Luminescence) displays, and projectors.
[0078] The communications unit 19 is connected to a communication line such as the Internet or a company LAN (Local Area Network) to interact with the role and permission management front-end page, receive operation instructions, and return role and position display data that has been inserted and sorted by the processor 11.
[0079] An insertion sorting program for performing insertion sorting on the role and permission management front-end page is, for example, pre-stored in the ROM 12 of the insertion sorting device 1. The processor 11 of the insertion sorting device 1 performs insertion sorting on the role and permission management front-end page by reading the insertion sorting program stored in the ROM 12.
[0080] The following is based on Figure 2 The flowchart shown illustrates the process by which the processor 11 of the insertion sort device 1 performs insertion sort processing.
[0081] During system initialization, processor 11 assigns an integer sorting number (hereinafter sometimes simply referred to as the number) to each role and position (step S1), for example: 1-Head Office Management Position, 2-Head Office Business Position, 3-Head Office Technical Position, 4-Branch Management Position, 5-Branch Business Position.
[0082] Processor 11 performs number conversion on the sorting numbers of each role and position (step S2). Processor 11 converts the number assigned to each role and position into decimal representation, and uses each digit of the decimal representation as an array element from left to right in order from the most significant digit to the least significant digit, thereby converting each number into an integer array.
[0083] For example, if there are sorted numbers: 1,2,21,214,45, they can be converted into integer arrays as {1}, {2}, {2,1}, {2,1,4}, and {4,5} using the method described above.
[0084] In this example, for instance, 1->{1}, 2->{2}, 3->{3}, 4->{4}, 5->{5}.
[0085] The size relationship of each array is determined by comparing each element of the arrays after the above conversion method, and the sorting order of the numbers is determined (step S3).
[0086] Specifically, when comparing each array element by element, the processor 11 compares the size of each array starting from the first array element from left to right. If an array has no element at that element position, it is considered NULL. NULL is less than any integer. When the size relationship between the arrays is found at a certain array element position, the comparison of the subsequent array elements is stopped, and the size relationship between the arrays is determined according to the current array element comparison result.
[0087] For example, comparing the arrays {2,1} and {2,1,4}, we first compare the first two elements, which are 2 and 2 respectively, so 2 = 2. Then we compare the second element, which is 1 = 1. Next, we compare the third element. Since {2,1} does not have a third element (it's considered NULL), and {2,1,4} has a third element of 4, NULL < 4, therefore the comparison result is {2,1} < {2,1,4}. Similarly, comparing {2,1,4} and {4,5}, we first compare the first two elements, which are 2 and 4 respectively, so 2 < 4, thus ending the comparison. Therefore, {2,1,4} < {4,5}.
[0088] In this example, when comparing the arrays {1}, {2}, {3}, {4}, {5}, we first compare the first element of each array element. Since 1 < 2 < 3 < 4 < 5, the result is {1} < {2} < {3} < {4} < {5}.
[0089] Therefore, the sorting order of the numbers is 1, 2, 3, 4, 5, resulting in the sorted number sequence 1, 2, 3, 4, 5 (which is sometimes referred to as the number sequence below).
[0090] Due to business needs, a new role, "Headquarters Auditor," needs to be inserted between "Headquarters Technical Position" (No. 3) and "Branch Management Position" (No. 4).
[0091] The traditional method requires changing number 4 to 5, number 5 to 6, and then setting the new character number to 4, which is tedious, complicated, and labor-intensive.
[0092] In this invention, when a new role position needs to be inserted between the role position with the Nth sort number and the role position with the (N+1)th sort number, the processor 11 generates a sort number M for the newly inserted role position. The sort number M satisfies the following condition: when M is converted into an array according to the method in step S2 and the size of the array is compared according to the method in step S3, the size of the array corresponding to M is between the array with the Nth sort number and the array with the (N+1)th sort number, where M and N are any positive integers (step S4).
[0093] Specifically, when the processor 11 generates the sorting number M of the newly inserted role / position, let the sorting number of the Nth sorting number be N', which is represented in decimal as N'=a n *10 n-1 +a n-1 *10 n-2 +…+a1*10 0 Converted to an array representation, it is { a n a n-1 a n-2 ..., a1}, where n is the number of decimal digits in the Nth sorting number, a n a n-1 a n-2 a1, ..., a1 are the values of each digit in the decimal representation of the Nth sorting number.
[0094] Let M = N' * 10 k +h1*10 k-1 +h2*10 k-2 +…+h k *10 0 (Formula 1)
[0095] k is an integer greater than or equal to 1, h1, h2...h k Integers from 0 to 9
[0096] The sort number M is generated according to the following method:
[0097] a) Initialize to k=1;
[0098] b) Make h1, h2, ..., h k-1 =9;
[0099] c) Make h k =9;
[0100] d) Calculate M according to Formula 1. Determine whether the value of M satisfies the conditions that it is not occupied by any sorting number in the current sorting sequence and the size of the array corresponding to M is smaller than the array of the (N+1)th sorting number. If the conditions are met, use the value of M as the sorting number of the newly inserted role / position, and end the calculation process for the sorting number M; otherwise, set h... k =h k -1;
[0101] e) When h k When h is greater than or equal to 0, process d) is executed repeatedly. k If the value is less than 0, proceed to the processing step f).
[0102] f) When h kIf a value of M satisfying the condition has not been found after traversing from 9 to 0, then h... k-1 =h k-1 -1, when h k-1 When h is greater than or equal to 0, the processes c) to e) are executed repeatedly. k-1 When the value is less than 0, proceed to the processing step g);
[0103] g) When h k-1 If a value of M that meets the condition has not been found after iterating from 9 to 0, then h... k-2 =h k-2 -1, h k-1 h k Initialize to 9, and execute the processes c)~f) in a loop until h... k-2 When the value is less than 0, proceed to the processing step h);
[0104] h) for h k-3 h k-4 h1, ..., h1 are all traversed using the above method until the M value that satisfies the condition is calculated;
[0105] i) If no M value that meets the conditions is found after the above traversal calculation, set k=k+1 and repeat the processing of b)~h).
[0106] For example, when inserting a new role between role number 21 and role number 214 in the numbering sequence 1,2,21,214,45 given above, N'=21, M=21*10 k +h1*10 k-1 +h2*10 k-1 +…h k *10 0 First, let k=1 and h1 be 0. Then we find M=210. 210 is not used in the current numbering sequence, and the array {2,1,0}<{2,1,4}. Therefore, we find M=210.
[0107] In this example, a new role, "Headquarters Auditor," needs to be inserted between "Headquarters Technical Position" (No. 3) and "Branch Management Position" (No. 4). According to the method above, the sort number of the new role "Headquarters Auditor" is 30.
[0108] The processor 11 inserts the sort number M generated in accordance with the above method as the sort number of the newly inserted role / position between the Nth sort number and the N+1th sort number, without changing the position or value of other numbers in the number sequence (step S5).
[0109] For example, processor 11 inserts the number M=210 obtained above between number 21 and number 214 in the number sequence 1,2,21,214,45.
[0110] In this example, the obtained sort number 30 for the new role "Headquarters Audit Position" is inserted between number 3 and number 4 in the number sequence 1, 2, 3, 4, 5, without making any changes to other numbers in the number sequence.
[0111] Once the insertion of the new job title number is complete, the processor 11 displays each job title on the front-end page according to the updated sorted number sequence (step S6).
[0112] For example, in this case, the updated sequence of job titles is: 1, 2, 3, 31, 4, 5. Therefore, the job titles are displayed in this order on the front-end page.
[0113] Head Office Management Position
[0114] General Business Position
[0115] Head Office Technical Position
[0116] Head Office Audit Position
[0117] Branch Management Position
[0118] Branch Business Position
[0119] The above demonstration clearly reflects the business logic of the "Head Office Audit Position" being positioned between the "Head Office Technical Position" and the "Branch Management Position".
[0120] According to this embodiment, the original role / position numbers (1, 2, 3, 4, 5) remain unchanged throughout the process. Only the new role / position number needs to be inserted in the corresponding position; no other unnecessary processing is required, making the process extremely simple. This achieves fast and flexible insertion and sorting in the role / permission management front-end page.
[0121] (Example 2)
[0122] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned insertion sorting method for inserting and sorting on the role and permission management front-end page.
[0123] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the aforementioned insertion sorting method for insertion sorting on the role and permission management front-end page.
[0124] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0125] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0126] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0127] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0128] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An insertion sorting method, used for insertion sorting on a role-based access control front-end page, characterized in that, The insertion sort method includes the following steps: Step S1: Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer; Step S2: Convert the sorting number into a decimal representation, and use each digit of the decimal representation as an array element from left to right in order from the most significant digit to the least significant digit, thereby converting each sorting number into an array, wherein the array is an integer array; Step S3: Based on the comparison of each array element after the transformation, determine the size relationship of each array, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence. Step S4: When a new role position needs to be inserted between the role position with the Nth sorted number and the role position with the (N+1)th sorted number, a sorted number M is generated for the newly inserted role position. The sorted number M satisfies the following condition: when M is converted into an array according to the method in step S2 and the array size is compared according to the method in step S3, the size of the array corresponding to M is between the array with the Nth sorted number and the array with the (N+1)th sorted number, where M and N are any positive integers; and Step S5: Insert the sort number M as the sort number for the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the order of other sort numbers in the sort number sequence; and Step S6: The front-end page displays each of the roles and positions according to the updated sorting number sequence.
2. The insertion sort method according to claim 1, characterized in that, In step S3, when comparing each array element, the arrays are compared sequentially starting from the first array element from left to right. If an array has no element at that element position, it is considered NULL. NULL is less than any integer. When the size relationship between the arrays is found at a certain array element position, the comparison of the subsequent array elements is stopped, and the size relationship between the arrays is determined according to the current array element comparison result.
3. The insertion sort method according to claim 1, characterized in that, When generating the sorting number M in step S4, let the sorting number of the Nth sorting number be N', which is represented in decimal as N'=a n *10 n-1 +a n-1 *10 n-2 +…+a1*10 0 Converted to an array representation, it is { a n a n-1 a n-2 ..., a1}, where n is the number of decimal digits in the Nth sorting number, a n a n-1 a n-2 a1, ..., a1 are the values of each digit in the decimal representation of the Nth sorting number. Let M = N' * 10 k +h1*10 k-1 +h2*10 k-2 +…+h k *10 0 k is an integer greater than or equal to 1, h1, h2...h k Integers from 0 to 9 The sort number M is generated according to the following method: a) Initialize to k=1; b) Make h1, h2, ..., h k-1 =9; c) Make h k =9; d) Calculate M according to Formula 1. Determine whether the value of M satisfies the conditions that it is not occupied by any sorting number in the current sorting sequence and the size of the array corresponding to M is smaller than the array of the (N+1)th sorting number. If the conditions are met, use the value of M as the sorting number of the newly inserted role / position, and end the calculation process for the sorting number M; otherwise, set h... k =h k -1; e) When h k When h is greater than or equal to 0, process d) is executed repeatedly. k If the value is less than 0, proceed to the processing step f). f) When h k If a value of M satisfying the condition has not been found after traversing from 9 to 0, then h... k-1 =h k-1 -1, when h k-1 When h is greater than or equal to 0, the processes c) to e) are executed repeatedly. k-1 When the value is less than 0, proceed to the processing step g); g) When h k-1 If a value of M that meets the condition has not been found after iterating from 9 to 0, then h... k-2 =h k-2 -1, h k-1 h k Initialize to 9, and execute the processes c)~f) in a loop until h... k-2 When the value is less than 0, proceed to the processing step h); h) for h k-3 h k-4 h1, ..., h1 are all traversed using the above method until the M value that satisfies the condition is calculated; i) If no M value that meets the conditions is found after the above traversal calculation, set k=k+1 and repeat the processing of b)~h).
4. The insertion sort method according to claim 1, characterized in that, The sorting numbers in the sorting sequence are arranged in ascending order according to the arrays after conversion.
5. The insertion sort method according to claim 1, characterized in that, The insertion sorting method is applied to the external data transaction role permission management of financial institutions.
6. The insertion sort method according to claim 1, characterized in that, When the role and position are displayed on the role and position management front-end page, the role and position are displayed in the order of the sorting number assigned to each role and position in the sorting number sequence.
7. An insertion sorting device for performing insertion sorting on a role-based access control front-end page, characterized in that, The insertion sorting device includes a processor, which performs the following processing: Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer; The sorting number is converted into a decimal representation, and each digit of the decimal representation is used as an array element from left to right in order from the most significant digit to the least significant digit. Thus, each sorting number is converted into an array, wherein the array is an integer array. The size relationship of each array is determined by comparing each element of the transformed arrays, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence. When a new role position needs to be inserted between the role position with the Nth sorted number and the role position with the (N+1)th sorted number, a sorted number M is generated for the newly inserted role position. The sorted number M satisfies the following condition: when M is converted into an array according to step S2 and the array size is compared according to step S3, the size of the array corresponding to M is between the array with the Nth sorted number and the array with the (N+1)th sorted number, where M and N are any positive integers; and Insert the sort number M as the sort number of the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the sort order of other sort numbers in the sort number sequence; as well as The updated sorting sequence is used to display each of the aforementioned roles and positions on the front-end page.
8. The insertion sorting apparatus according to claim 7, characterized in that, When the processor compares each array element by element, it compares the arrays sequentially from the first array element from left to right. If an array has no element at that element position, it is considered NULL, and NULL is less than any integer. When the size relationship between the arrays is found at a certain array element position, the comparison of the subsequent array elements is stopped, and the size relationship between the arrays is determined according to the current array element comparison result.
9. The insertion sorting apparatus according to claim 7, characterized in that, When the processor generates the sort number M, let the sort number of the Nth sort number be N', which is represented in decimal as N'=a. n *10 n-1 +a n-1 *10 n-2 +…+a1*10 0 Converted to an array representation, it is { a n a n-1 a n-2 , ..., a1}, where n is the number of decimal digits in the Nth sorting number, a n a n-1 a n-2 a1, ..., a1 are the values of each digit in the decimal representation of the Nth sorting number. Let M = N' * 10 k +h1*10 k-1 +h2*10 k-2 +…+h k *10 0 k is an integer greater than or equal to 1, h1, h2...h k Integers from 0 to 9 The sort number M is generated according to the following method: a) Initialize to k=1; b) Make h1, h2, ..., h k-1 =9; c) Make h k =9; d) Calculate M according to Formula 1. Determine whether the value of M satisfies the conditions that it is not occupied by any sorting number in the current sorting sequence and the size of the array corresponding to M is smaller than the array of the (N+1)th sorting number. If the conditions are met, use the value of M as the sorting number of the newly inserted role / position, and end the calculation process for the sorting number M; otherwise, set h... k =h k -1; e) When h k When h is greater than or equal to 0, process d) is executed repeatedly. k If the value is less than 0, proceed to the processing step f). f) When h k If a value of M satisfying the condition has not been found after traversing from 9 to 0, then h... k-1 =h k-1 -1, when h k-1 When h is greater than or equal to 0, the processes c) to e) are executed repeatedly. k-1 When the value is less than 0, proceed to the processing step g); g) When h k-1 If a value of M that meets the condition has not been found after iterating from 9 to 0, then h... k-2 =h k-2 -1, h k-1 h k Initialize to 9, and execute the processes c)~f) in a loop until h... k-2 When the value is less than 0, proceed to the processing step h); h) for h k-3 h k-4 h1, ..., h1 are all traversed using the above method until the M value that satisfies the condition is calculated; i) If no M value that meets the conditions is found after the above traversal calculation, set k=k+1 and repeat the processing of b)~h).
10. The insertion sorting apparatus according to claim 7, characterized in that, The processor arranges the sorted numbers in the sorted number sequence in ascending order according to the arrays after they have been converted.
11. The insertion sorting apparatus according to claim 7, characterized in that, The insertion sorting device is used for the management of external data transaction role permissions in financial institutions.
12. The insertion sorting apparatus according to claim 7, characterized in that, When the role and permission management front-end page displays the various roles and positions, the processor causes the roles and positions to be displayed in the order of the sorting numbers assigned to them in the sorting number sequence.
13. An insertion sorting system for performing insertion sorting on a role-based access control front-end page, characterized in that, The insertion sort system includes a processor, which performs the following processing: Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer; The sorting number is converted into a decimal representation, and each digit of the decimal representation is used as an array element from left to right in order from the most significant digit to the least significant digit. Thus, each sorting number is converted into an array, wherein the array is an integer array. The size relationship of each array is determined by comparing each element of the transformed arrays, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence. When a new role position needs to be inserted between the role position with the Nth sorted number and the role position with the (N+1)th sorted number, a sorted number M is generated for the newly inserted role position. The sorted number M satisfies the following condition: when M is converted into an array according to step S2 and the array size is compared according to step S3, the size of the array corresponding to M is between the array with the Nth sorted number and the array with the (N+1)th sorted number, where M and N are any positive integers; and Insert the sort number M as the sort number of the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the sort order of other sort numbers in the sort number sequence; as well as The updated sorting sequence is used to display each of the aforementioned roles and positions on the front-end page.
14. A computer program product comprising an insertion sorting program for performing insertion sorting on a role-based access control front-end page, characterized in that, The insertion sort procedure causes the computer to perform the following steps: Step S1: Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer; Step S2: Convert the sorting number into a decimal representation, and use each digit of the decimal representation as an array element from left to right in order from the most significant digit to the least significant digit, thereby converting each sorting number into an array, wherein the array is an integer array; Step S3: Based on the comparison of each array element after the transformation, determine the size relationship of each array, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence. Step S4: When a new role position needs to be inserted between the role position with the Nth sort number and the role position with the (N+1)th sort number, a sort number M is generated for the newly inserted role position. The sort number M satisfies the following condition: when M is converted into an array according to the method in step S2 and the array size is compared according to the method in step S3, the size of the array corresponding to M is between the array with the Nth sort number and the array with the (N+1)th sort number, where M and N are any positive integers. as well as Step S5: Insert the sort number M as the sort number of the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the sorting of other sort numbers in the sort number sequence; as well as Step S6: The front-end page displays each of the roles and positions according to the updated sorting number sequence.
15. A computer-readable storage medium storing an insertion sorting program for performing insertion sorting on a role-based access control front-end page, characterized in that, The insertion sort procedure causes the computer to perform the following steps: Step S1: Assign a sorting number to each role and position displayed on the role permission management front-end page, where the sorting number is any positive integer; Step S2: Convert the sorting number into a decimal representation, and use each digit of the decimal representation as an array element from left to right in order from the most significant digit to the least significant digit, thereby converting each sorting number into an array, wherein the array is an integer array; Step S3: Based on the comparison of each array element after the transformation, determine the size relationship of each array, thereby determining the sorting order of each sorting number corresponding to each array, and sorting each sorting number according to the sorting order to obtain a sorting number sequence. Step S4: When a new role position needs to be inserted between the role position with the Nth sort number and the role position with the (N+1)th sort number, a sort number M is generated for the newly inserted role position. The sort number M satisfies the following condition: when M is converted into an array according to the method in step S2 and the array size is compared according to the method in step S3, the size of the array corresponding to M is between the array with the Nth sort number and the array with the (N+1)th sort number, where M and N are any positive integers. as well as Step S5: Insert the sort number M as the sort number of the newly inserted role / position between the Nth sort number and the (N+1)th sort number, without changing the sorting of other sort numbers in the sort number sequence; as well as Step S6: The front-end page displays each of the roles and positions according to the updated sorting number sequence.