Method for customizing character sorting sequence, storage medium and equipment

Through the method of custom character sorting order, the existing database sorting scheme is solved inefficient and conflicting rules when dealing with complex characters and special comparison scenarios, achieving more efficient query and more flexible database operations.

CN119938809APending Publication Date: 2025-05-06CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411982778.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

When handling complex characters and special comparison scenarios, existing database sorting schemes need to introduce complex functions and processing logic, resulting in low query efficiency, inaccurate results, and possible sorting rules conflicts, affecting database performance.

Method used

Provides a method to customize character sorting order. By responding to custom character order instructions, obtain custom character order and objects to be sorted, modify their character order rules, and replace and/or sort characters according to the modified rules.

Benefits of technology

It improves query efficiency, enhances the integrity and recoverability of sorting rules, improves the accuracy of custom character sorting order, thereby improving the performance and operational flexibility of the database system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938809A_ABST
    Figure CN119938809A_ABST
Patent Text Reader

Abstract

The invention relates to a database technology, in particular to a method for customizing a character sorting sequence, a storage medium and equipment. The method for customizing the character sorting sequence comprises the following steps: in response to a custom character sequence instruction, obtaining a custom character sequence and a to-be-sorted object in the custom character sequence instruction; setting a character sequence rule corresponding to the to-be-sorted object according to the custom character sequence; and replacing and / or sorting the characters in the to-be-sorted object according to the modified character sequence rule. According to the method for customizing the character sorting sequence, the characters in the to-be-sorted object can be replaced and / or sorted based on the custom character sequence, so that complex characters can be effectively replaced conveniently, and operations such as special processing on the size sequence of the characters can be carried out conveniently; the problems of high query complexity, long execution time and the like caused by fixed sorting rules of the to-be-sorted objects are avoided, the query efficiency is improved, and the performance of a database system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to database technology, and in particular to a method, storage medium and device for user-defined character sorting sequence. Background Art

[0002] For database systems, sorting is a very important operation in querying instances, libraries, tables, and columns. It can help users search data faster and better understand and analyze data. Existing sorting schemes usually use the sorting rules generated by the system by default or directly specify the sorting rules generated for the objects to be sorted to perform operations such as querying, comparing, or sorting the data in the objects to be sorted.

[0003] However, the sorting rules of each object to be sorted in the existing sorting scheme are fixed after generation, and no additional rules can be added. Therefore, when performing queries, for special scenarios such as the presence of complex characters in some data and the need to perform unconventional numerical comparisons on characters, the existing sorting scheme needs to introduce complex functions and processing logic, which increases the complexity and execution time of the query, and easily leads to problems such as slow running speed, inaccurate query results, and low query efficiency, thereby affecting the overall performance of the database system. In addition, when multiple sorting rules are involved in a query, sorting rule conflicts may occur, thereby increasing the complexity and execution time of the query. Summary of the invention

[0004] In view of the above problems, a method, storage medium and device for customizing the sorting order of characters are proposed to overcome the above problems or at least partially solve the above problems.

[0005] An object of the present invention is to provide a method for customizing the character sorting order, which can improve the query efficiency.

[0006] A further object of the present invention is to improve the integrity and recoverability of sequencing rules.

[0007] Another further object of the present invention is to improve the accuracy of the sorting order of user-defined characters.

[0008] In particular, the present invention provides a method for customizing a character sorting order, comprising:

[0009] In response to the custom character sequence instruction, obtaining the custom character sequence and the object to be sorted in the custom character sequence instruction;

[0010] Modify the character sequence rules corresponding to the objects to be sorted according to the custom character sequence;

[0011] The characters in the object to be sorted are replaced and / or sorted according to the modified character sequence rule.

[0012] Optionally, the step of modifying the character sequence rule corresponding to the object to be sorted according to the custom character sequence includes:

[0013] Obtaining preset sorting rules corresponding to the objects to be sorted;

[0014] Obtaining a mapping relationship corresponding to a preset sorting rule, wherein the mapping relationship stores a character sequence rule;

[0015] Replace and / or adjust the positions of characters in a character sequence rule according to a custom character sequence.

[0016] Optionally, after the step of replacing and / or sorting the characters in the sort object according to the modified character sequence rule, the method for customizing the character sort sequence further includes:

[0017] In response to the instruction to delete the custom character sequence, obtaining a mapping relationship corresponding to the instruction to delete the custom character sequence;

[0018] Delete the character sequence rule in the corresponding mapping relationship.

[0019] Optionally, after the step of deleting the character order rule in the corresponding mapping relationship, the method for customizing the character sorting order further includes:

[0020] Obtaining a preset sorting rule corresponding to the corresponding mapping relationship;

[0021] Generate character order rules according to the corresponding preset sorting rules and store them in the corresponding mapping relationship;

[0022] Sort the characters in the object to be sorted according to the generated character order rule.

[0023] Optionally, the objects to be sorted include instances, databases, data tables, and data columns; and

[0024] Before the step of obtaining the custom character sequence and the objects to be sorted in the custom character sequence instruction in response to the custom character sequence instruction, the method for customizing the character sorting sequence further includes:

[0025] Create a preset sorting rule corresponding to the object to be sorted;

[0026] The preset sorting rules are marked based on a preset marking method so that the objects to be sorted correspond to the preset sorting rules one by one.

[0027] Optionally, after the step of creating a preset sorting rule corresponding to the objects to be sorted, the method for customizing the character sorting order further includes:

[0028] Create a mapping relationship corresponding to the preset sorting rules;

[0029] Generate character order rules according to the corresponding preset sorting rules and store them in the corresponding mapping relationship;

[0030] Sort the characters in the object to be sorted according to the generated character order rule.

[0031] Optionally, after the step of creating a mapping relationship corresponding to a preset sorting rule, the method for customizing a character sorting order further includes:

[0032] Create a sorting library corresponding to each object to be sorted;

[0033] All mapping relationships with various objects to be sorted are stored in the sorting library corresponding to the types of objects to be sorted.

[0034] Optionally, after the step of creating a preset sorting rule corresponding to the object to be sorted, the method for customizing the character sorting order further comprises: in response to a query instruction, obtaining the object to be arranged involved in the query instruction;

[0035] When the query instruction involves multiple objects to be arranged, the preset sorting rules of the multiple objects to be arranged are executed according to the preset priority order, wherein the preset priority order is configured as the preset sorting rules of the data column, the preset sorting rules of the data table, the preset sorting rules of the database and the preset sorting rules of the instance in descending order.

[0036] According to another aspect of the present invention, a machine-readable storage medium is provided, on which a machine executable program is stored. When the machine executable program is executed by a processor, any of the above methods for customizing a character sorting order is implemented.

[0037] According to another aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a machine executable program stored in the memory and running on the processor, and the processor implements any of the above-mentioned methods of customizing character sorting order when executing the machine executable program.

[0038] The method for customizing the sorting order of characters of the present invention obtains the custom character order and the object to be sorted in the custom character order instruction in response to the custom character order instruction, modifies the character order rule corresponding to the object to be sorted according to the custom character order, and replaces and / or sorts the characters in the object to be sorted according to the modified character order rule, thereby realizing the custom operation of the character sorting order in the object to be sorted, so as to realize special processing such as replacement of query characters and customization of arrangement order. Therefore, the method for customizing the sorting order of characters of the present invention can realize the replacement and / or sorting of characters in the object to be sorted based on the custom character order, facilitates the effective replacement of complex characters and special processing of the size order of characters, avoids the problems of high query complexity and long execution time caused by the fixed sorting rules of the object to be sorted, improves the query efficiency, and thus improves the performance of the database system. In addition, the method for customizing the sorting order of characters of the present invention can flexibly modify the characters in the object to be sorted based on the custom character order, thereby improving the flexibility and operability of database operations.

[0039] Furthermore, the method for customizing the character sorting order of the present invention obtains a preset sorting rule corresponding to the object to be sorted, obtains a mapping relationship corresponding to the preset sorting rule, wherein the character order rule is stored in the mapping relationship, and the characters in the character order rule are replaced and / or the position is adjusted according to the custom character order, thereby realizing the modification of the character order rule corresponding to the object to be sorted through the interface, avoiding the loss of the original sorting rule caused by directly modifying the preset sorting rule of the object to be sorted according to the custom character order, improving the integrity and recoverability of the sorting rule, thereby improving the accuracy of subsequent operations, and further ensuring the performance of the database system.

[0040] Furthermore, the method for customizing the character sorting order of the present invention pre-creates preset sorting rules corresponding to the objects to be sorted, and marks the preset sorting rules based on a preset marking method, so that the objects to be sorted and the preset sorting rules correspond one to one, thereby achieving accurate recording of the correspondence between the objects to be sorted and the preset sorting rules, and ensuring the accuracy of the replacement and / or sorting operations on the characters in the objects to be sorted based on the custom character order in the subsequent process, that is, improving the accuracy of the custom character sorting order, thereby further improving the performance of the database system.

[0041] Based on the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings, those skilled in the art will become more aware of the above and other objects, advantages and features of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:

[0043] Figure 1 is a flowchart of a method for customizing a character sorting order according to an embodiment of the present invention;

[0044] Figure 2 is a schematic diagram of an application scenario of a method for customizing a character sorting order according to an embodiment of the present invention;

[0045] Figure 3 is a flowchart of a method for customizing a character sorting order according to another embodiment of the present invention;

[0046] Figure 4 is a schematic diagram of the structure of a machine-readable storage medium according to an embodiment of the present invention; and

[0047] Figure 5 is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0049] In order to solve the above technical problem, an embodiment of the present invention proposes a method for customizing the character sorting order. Figure 1 FIG. 1 is a schematic flow chart of a method for customizing a character sorting order according to an embodiment of the present invention. Figure 1 As shown, the method of customizing the character sorting order may generally include:

[0050] Step S102, in response to the custom character sequence instruction, obtaining the custom character sequence and the objects to be sorted in the custom character sequence instruction.

[0051] Step S104, modifying the character sequence rule corresponding to the object to be sorted according to the custom character sequence.

[0052] Step S106, replace and / or sort the characters in the sort object according to the modified character order rule. So far, the method for customizing the character sort order of the present invention realizes the custom operation of the character sort order in the sort object to achieve special processing such as replacement of query characters and customization of arrangement order.

[0053] Therefore, the method of customizing the character sorting order of the present invention can realize the replacement and / or sorting of the characters in the object to be sorted based on the custom character order, which is convenient for effectively replacing complex characters and performing special processing on the size order of characters, avoiding the problems of high query complexity and long execution time caused by the fixed sorting rules of the object to be sorted, improving the query efficiency, and thus improving the performance of the database system.

[0054] In addition, the method of customizing the character sorting order of the present invention can simultaneously create sorting rules corresponding to tables and columns when creating tables, record the correspondence between tables and columns and their sorting rules, and flexibly modify the characters in the objects to be sorted based on the custom character order, thereby improving the flexibility and operability of database operations.

[0055] In some embodiments, in the above step S102, the objects to be sorted obtained may include but are not limited to instances, databases, data tables, and data columns and the characters therein. In addition, the objects to be sorted may also include characters in query statements for data storage structures such as instances, databases, data tables, and data columns, as well as characters in query results.

[0056] In some embodiments, before the above step S102, the method for customizing the character sorting order of the present invention may further include the following steps: creating a preset sorting rule corresponding to the object to be sorted; marking the preset sorting rule based on a preset marking method so that the object to be sorted and the preset sorting rule correspond one to one. Specifically, the above step of marking the preset sorting rule based on the preset marking method may include the following steps: obtaining a unique identifier of the object to be sorted; storing the unique identifier in the preset sorting rule corresponding to the object to be sorted.

[0057] Therefore, the method for customizing the character sorting order of the present invention pre-creates a preset sorting rule corresponding to the object to be sorted, and marks the preset sorting rule based on a preset marking method, so that the object to be sorted and the preset sorting rule correspond one-to-one, thereby achieving accurate recording of the correspondence between the object to be sorted and the preset sorting rule, and ensuring the accuracy of the replacement and / or sorting operations on the characters in the object to be sorted based on the custom character order in the subsequent process, that is, improving the accuracy of the custom character sorting order, thereby further improving the performance of the database system.

[0058] In some embodiments, after the above-mentioned step of creating preset sorting rules corresponding to the objects to be sorted, the method of customizing the character sorting order of the present invention may further include the following steps: in response to a query instruction, obtaining the objects to be arranged involved in the query instruction; when the query instruction involves multiple objects to be arranged, executing the preset sorting rules for the multiple objects to be arranged according to a preset priority order, wherein the preset priority order is configured such that the priorities of the preset sorting rules of the data columns, the preset sorting rules of the data tables, the preset sorting rules of the databases, and the preset sorting rules of the instances decrease in sequence.

[0059] In addition, when the query instruction includes a specified sort, the preset priority order can also be set as: specified sort > preset sort rule of data column > preset sort rule of data table > preset sort rule of database > preset sort rule of instance. That is to say, when querying, if the query instruction only involves a data table and does not include a specified sort, the preset sort rule of the data column is used first, and then the preset sort rule of the data table is used.

[0060] Therefore, when a query involves multiple sorting rules, they can be executed in sequence according to the preset priority order to achieve ordered query and sorting, thereby reducing the complexity of the query and shortening the execution time, thereby further improving the performance of the database system.

[0061] In some embodiments, after the above step of creating a preset sorting rule corresponding to the object to be sorted, the method of customizing the character sorting order of the present invention may further include the following steps: creating a mapping relationship corresponding to the preset sorting rule; generating a character order rule according to the corresponding preset sorting rule, and storing it in the corresponding mapping relationship; sorting the characters in the object to be sorted according to the generated character order rule. In other words, the preset sorting rule can be used as the original sorting rule of the object to be sorted corresponding to it, so as to replace and / or sort the characters inside it.

[0062] Therefore, when a custom character order is not set, the characters in the sorting object can be sorted according to the character order rules generated based on the preset sorting rules, ensuring orderly query and sorting when a custom character order is not set, thereby maintaining the stable operation of the query.

[0063] In some embodiments, after the step of creating a mapping relationship corresponding to a preset sorting rule, the method of customizing the character sorting order of the present invention may further include the following steps: creating a sorting library corresponding to each object to be sorted; storing all mapping relationships with various objects to be sorted in the sorting library corresponding to the object to be sorted according to the type of the object to be sorted. In other words, each object to be sorted has a preset sorting library corresponding to it, and each sorting library is used to store all mapping relationships corresponding to all preset sorting rules of the same object to be sorted.

[0064] Therefore, the method for customizing the character sorting order of the present invention realizes the orderly management of the mapping relationship by setting the sorting library, ensures the convenience of subsequent query and sorting operations, and further ensures the stable operation of the query.

[0065] In some embodiments, the above step S104 may include the following steps: obtaining a preset sorting rule corresponding to the object to be sorted; obtaining a mapping relationship corresponding to the preset sorting rule, wherein the mapping relationship stores a character order rule; and modifying the character order rule in the mapping relationship according to a custom character order. Specifically, the above step of modifying the character order rule in the mapping relationship according to the custom character order can be specifically performed as the following steps: replacing and / or adjusting the position of the characters in the character order rule according to the custom character order. That is to say, the above step S104 can be specifically performed as the following steps: obtaining a preset sorting rule corresponding to the object to be sorted; obtaining a mapping relationship corresponding to the preset sorting rule; and replacing and / or adjusting the position of the characters in the character order rule according to the custom character order.

[0066] It should be noted that in the above step S104, the character order rule modified according to the custom character order can be used to formulate the character sorting order in the corresponding object to be sorted, so as to achieve the replacement of characters in the query statement and / or sorting of characters in the query result of the query statement.

[0067] Therefore, the method for customizing the character sorting order of the present invention obtains the preset sorting rule corresponding to the object to be sorted, obtains the mapping relationship corresponding to the preset sorting rule, wherein the character order rule is stored in the mapping relationship, and the characters in the character order rule are replaced and / or the position is adjusted according to the custom character order, thereby realizing the modification of the character order rule corresponding to the object to be sorted through the interface, avoiding the loss of the original sorting rule caused by directly modifying the preset sorting rule of the object to be sorted according to the custom character order, improving the integrity and recoverability of the sorting rule, thereby improving the accuracy of subsequent operations, and further ensuring the performance of the database system.

[0068] In some embodiments, after the step of replacing and / or sorting the characters in the sort object according to the modified character order rule, the method of customizing the character sort order of the present invention may further include the following steps: in response to the instruction to delete the custom character order, obtaining a mapping relationship corresponding to the instruction to delete the custom character order; deleting the character order rule in the corresponding mapping relationship. In other words, the method of customizing the character sort order of the present invention may also cancel the application of the custom character order.

[0069] Therefore, the method of customizing the character sorting order of the present invention deletes the records related to the custom character order in response to the instruction to delete the custom character order, thereby avoiding the erroneous application of the remaining custom character order in subsequent queries, thereby improving the accuracy of subsequent query results.

[0070] In some embodiments, after the above step of deleting the character order rules in the corresponding mapping relationship, the method of customizing the character sorting order of the present invention may further include the following steps: obtaining the preset sorting rules corresponding to the corresponding mapping relationship; generating the character order rules according to the corresponding preset sorting rules, and storing them in the corresponding mapping relationship; replacing and / or sorting the characters in the sorting object according to the generated character order rules. That is, after deleting the records related to the custom character order, the method of customizing the character sorting order of the present invention may also re-edit the character order rules in the corresponding mapping relationship according to the corresponding preset sorting rules.

[0071] Therefore, the method of customizing the character sorting order of the present invention realizes the smooth acquisition of the character order rules in subsequent queries by re-editing the character order rules in the corresponding mapping relationship according to the corresponding preset sorting rules after canceling the use of the custom rules, thereby further ensuring the accuracy of the subsequent query results.

[0072] Figure 2 Schematic diagram of an application scenario of a method for customizing a character sorting order according to an embodiment of the present invention. Figure 2 As shown, the specific scheme of the method for customizing the character sorting order of the present invention can be:

[0073] 1. Through the interface, pass in the unique identifier (object identifier, oid) of the data table or data column, and then pass in the characters and operators to be modified.

[0074] 2. When creating a data table, a preset sorting rule for the data table will be automatically created, ending with the table oid, and a preset sorting rule for the data column will also be automatically created, ending with the column oid. The specific steps are as follows:

[0075] (1) Create a preset collation rule for the data table: create table t1(a varchar(20))collatecollate_name;

[0076] (2) Create a preset collation rule for a data column: create table t1(a varchar(20)collatecollate_name1; b varchar(20)collatecollate_name2);

[0077] (3) The database system automatically creates a collation rule: create collation collate_name1_oid (oid is the unique identifier of the table or column, ensuring that the preset collation rule of each table or column is unique);

[0078] When querying, if the query involves a data table, the preset sorting rules of the data table will be used. If the query involves a column, the preset sorting rules of the data column will be used first. If it involves specified sorting, the preset priority order can be: specified sorting > preset sorting rules of data columns > preset sorting rules of data tables > preset sorting rules of databases > preset sorting rules of instances.

[0079] 3. Processing custom character sorting order:

[0080] (1) Each preset sorting rule corresponds to a mapping relationship, and the mapping relationship stores the order of characters. The order of characters stored in the mapping relationship can be used as a character order rule; different preset sorting rules correspond to different mapping relationships, and the corresponding character order is also different; for example: ① Pinyin sorting order: 2>3>6>4>5>1; ② If sorting by strokes: 1>2>3>4>5>6;

[0081] (2) The sorting result can be affected by modifying the character order rules in the mapping relationship corresponding to the preset sorting rules;

[0082] (3) Because each data table and each data column has its own preset sorting rules, the setting of custom character order is to set the character order rule corresponding to the preset sorting rules;

[0083] (4) All mapping relationships are stored in the corresponding sorting library according to the type of the object to be sorted.

[0084] 4. If you do not want to use a custom character sequence, you can delete the corresponding relationship through the interface, including:

[0085] (1) Each customized character sequence will be recorded;

[0086] (2) If a custom character sequence is deleted, the relevant content in the record will be deleted;

[0087] (3) After deleting the relevant content, re-edit the character sequence rules corresponding to the preset sorting rules.

[0088] Thus, the method of the present invention for customizing the character sorting order can realize the replacement and / or sorting of the characters in the object to be sorted based on the custom character order, which is convenient for effectively replacing complex characters and performing special processing on the order of the size of characters, avoiding the problems of high query complexity and long execution time caused by the fixed sorting rules of the object to be sorted, improving the query efficiency, and thus improving the performance of the database system. In addition, the method of the present invention for customizing the character sorting order can flexibly modify the characters in the object to be sorted based on the custom character order, improving the flexibility and operability of database operations.

[0089] Furthermore, the method for customizing the character sorting order of the present invention obtains a preset sorting rule corresponding to the object to be sorted, obtains a mapping relationship corresponding to the preset sorting rule, wherein the character order rule is stored in the mapping relationship, and the characters in the character order rule are replaced and / or position adjusted according to the custom character order, thereby realizing the modification of the character order rule corresponding to the object to be sorted through the interface, avoiding the loss of the original sorting rule caused by directly modifying the preset sorting rule of the object to be sorted according to the custom character order, improving the integrity and recoverability of the sorting rule, thereby improving the accuracy of subsequent operations, and further ensuring the performance of the database system.

[0090] Furthermore, the method for customizing the character sorting order of the present invention pre-creates a preset sorting rule corresponding to the object to be sorted, and presets the sorting rule based on a unique identifier so that the object to be sorted and the preset sorting rule correspond one-to-one, thereby achieving accurate recording of the correspondence between the object to be sorted and the preset sorting rule, and ensuring the accuracy of the replacement and / or sorting operations on the characters in the object to be sorted based on the custom character order in the subsequent process, that is, improving the accuracy of the custom character sorting order, thereby further improving the performance of the database system.

[0091] In a specific embodiment, for the data table t1: Create table t1(name varchar(20), age int); Insert into t1 values('张三'); when querying, the query statement in traditional query is: select * from t1 where name = '张三';. After using the method of custom character sorting order of the present invention, the character sorting order of the name column on the data table t1 can be customized, and set name = the first letter. At this time, the query statement can be: select * from t1 where name = 'zs'. Thus, the method of custom character sorting order of the present invention realizes replacing complex characters such as Chinese characters with the first letters of Chinese characters, that is, realizes replacing the characters in the object to be sorted according to the modified character order rule.

[0092] In a specific embodiment, for the data table t2: Create table t1(name varchar(20), age int); Insert into t1 values('张三'); Insert into t1 values('李四'); Insert into t1 values('王五'); Insert into t1 values('麻六'); when querying, if the user needs to sort the names in a specific order, such as: 麻六 > 李四 > 王五 > 张三. After using the method of custom character sorting order of the present invention, the character order rule corresponding to the name column can be set using the custom character sorting order, so that the characters on the name column are sorted in the order of '麻六 > 李四 > 王五 > 张三'. After executing the query statement "select name from t1;", the query result can be '麻六, 李四, 王五, 张三' sorted according to the custom character sorting order of the name column. Thus, the method of custom character sorting order of the present invention realizes sorting the names in a specific order, that is, realizes sorting the characters in the object to be sorted according to the modified character order rule.

[0093] Figure 3 It is a schematic flowchart of the method of custom character sorting order according to another embodiment of the present invention. The following combines Figure 3 , and specifically describes the process steps of this embodiment.

[0094] Step S302, create a preset sorting rule corresponding to the object to be sorted.

[0095] Step S304, mark the preset sorting rule with the unique identifier of the object to be sorted.

[0096] Step S306: creating a mapping relationship corresponding to the preset sorting rule, wherein the mapping relationship stores a character sequence rule generated according to the corresponding preset sorting rule.

[0097] Step S308: Create a sorting library corresponding to each object to be sorted, and classify and store the mapping relationship into the corresponding sorting library.

[0098] Step S310, in response to the custom character sequence instruction, obtaining the custom character sequence.

[0099] Step S312, obtaining the corresponding mapping relationship in the sorting library.

[0100] Step S314: modify the character sequence rule in the corresponding mapping relationship according to the custom character sequence.

[0101] Step S316: replace and / or sort the characters in the sort object according to the modified character sequence rule. At this point, this process ends.

[0102] Therefore, the method for customizing the character sorting order of the present invention can use the local external table to map the corresponding remote table, and create a view based on the local external table to indirectly access the data of the remote table, thereby realizing access to the remote table through the view, avoiding direct access of the user to the remote table, hiding the original table structure of the remote table, thereby improving the security of the database operation object authority level, and further improving the security of the data.

[0103] Furthermore, the method for customizing the character sorting order of the present invention accesses the data of the remote table through a view, simplifies the SQL statement, and improves the clarity of the data access logic, thereby improving the efficiency of the user's use of the database and the ease of the user's understanding.

[0104] Furthermore, the method of customizing the character sorting order of the present invention accesses the data of the remote table through the view, which facilitates the granting of different permissions to different views to distinguish the access restrictions of the remote table, is beneficial to the permission control management of database users, and improves the flexibility and operability of database operations.

[0105] This embodiment also provides a machine-readable storage medium and a computer device. Figure 4 is a schematic diagram of the structure of a machine-readable storage medium 10 according to an embodiment of the present invention, Figure 5 is a schematic diagram of the structure of a computer device 20 according to an embodiment of the present invention.

[0106] The machine-readable storage medium 10 stores a machine executable program 11 thereon. When the machine executable program 11 is executed by a processor, the method for customizing the character sorting order of any of the above embodiments is implemented.

[0107] The computer device 20 may include a memory 220, a processor 210, and a machine executable program 11 stored in the memory 220 and running on the processor 210, and the processor 210 implements the method of customizing the character sorting order of any of the above embodiments when executing the machine executable program 11.

[0108] It should be noted that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any machine-readable storage medium for use by an instruction execution system, device or equipment (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or equipment and execute instructions), or used in combination with these instruction execution systems, devices or equipment.

[0109] For the purposes of the description of this embodiment, the machine-readable storage medium 10 may be any device that can contain, store, communicate, propagate or transmit a program for use with an instruction execution system, device or apparatus or in conjunction with such instruction execution systems, devices or apparatuses. More specific examples (a non-exhaustive list) of the machine-readable storage medium 10 include the following: an electrical connection portion (electronic device) having one or more wirings, a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the machine-readable storage medium 10 may even be paper or other suitable medium on which the program may be printed, because the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.

[0110] It should be understood that each part of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system.

[0111] The computer device 20 may be, for example, a server, a desktop computer, a notebook computer, a tablet computer, or a smart phone. In some examples, the computer device 20 may be a cloud computing node. The computer device 20 may be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, a program module may include routines, programs, target programs, components, logic, data structures, etc. that perform specific tasks or implement specific abstract data types. The computer device 20 may be implemented in a distributed cloud computing environment where remote processing devices linked through a communication network perform tasks. In a distributed cloud computing environment, program modules may be located on a local or remote computing system storage medium including a storage device.

[0112] The computer device 20 may include a processor 210 adapted to execute stored instructions, and a memory 220 providing temporary storage space for the operation of the instructions during operation. The processor 210 may be a single-core processor, a multi-core processor, a computing cluster, or any number of other configurations. The memory 220 may include a random access memory (RAM), a read-only memory, a flash memory, or any other suitable storage system.

[0113] The flow chart provided by the present embodiment is not intended to indicate that the operation of the method will be performed in any particular order, or that all operations of the method are included in all every case. In addition, the method may include additional operations. Within the scope of the technical thinking provided by the present embodiment method, additional changes may be made to the above method.

[0114] At this point, those skilled in the art should recognize that, although multiple exemplary embodiments of the present invention have been shown and described in detail herein, many other variations or modifications that conform to the principles of the present invention can still be directly determined or derived based on the content disclosed in the present invention without departing from the spirit and scope of the present invention. Therefore, the scope of the present invention should be understood and recognized as covering all these other variations or modifications.

Claims

1. A method for customizing a character sorting order, comprising: In response to the custom character sequence instruction, obtaining the custom character sequence and the objects to be sorted in the custom character sequence instruction; Modify the character sequence rule corresponding to the object to be sorted according to the custom character sequence; The characters in the object to be sorted are replaced and / or sorted according to the modified character sequence rule.

2. The method for customizing the character sorting order according to claim 1, wherein: The step of modifying the character sequence rule corresponding to the object to be sorted according to the custom character sequence comprises: Obtaining a preset sorting rule corresponding to the object to be sorted; Acquire a mapping relationship corresponding to the preset sorting rule, wherein the mapping relationship stores a character sequence rule; The characters in the character sequence rule are replaced and / or the positions are adjusted according to the custom character sequence.

3. The method for customizing the character sorting order according to claim 2, wherein: After the step of replacing and / or sorting the characters in the to-be-sorted object according to the modified character sequence rule, the method for customizing the character sorting sequence further includes: In response to the instruction to delete a custom character sequence, obtaining a mapping relationship corresponding to the instruction to delete a custom character sequence; Delete the character sequence rule in the corresponding mapping relationship.

4. The method for customizing the character sorting order according to claim 3, wherein: After the step of deleting the character order rule in the corresponding mapping relationship, the method for customizing the character sorting order further includes: Obtaining a preset sorting rule corresponding to the corresponding mapping relationship; Generate a character sequence rule according to the corresponding preset sorting rule, and store it in the corresponding mapping relationship; The characters in the object to be sorted are sorted according to the generated character sequence rule.

5. The method for customizing the character sorting order according to claim 2, wherein: The objects to be sorted include instances, databases, data tables and data columns; and Before the step of obtaining the custom character sequence and the objects to be sorted in the custom character sequence instruction in response to the custom character sequence instruction, the method for customizing the character sorting sequence further includes: Creating a preset sorting rule corresponding to the objects to be sorted; The preset sorting rule is marked based on a preset marking method so that the objects to be sorted correspond to the preset sorting rule one by one.

6. The method for customizing the character sorting order according to claim 5, wherein: After the step of creating a preset sorting rule corresponding to the object to be sorted, the method for customizing the character sorting order further includes: Creating a mapping relationship corresponding to the preset sorting rule; Generate a character sequence rule according to the corresponding preset sorting rule, and store it in the corresponding mapping relationship; The characters in the object to be sorted are sorted according to the generated character sequence rule.

7. The method for customizing the character sorting order according to claim 6, wherein: After the step of creating a mapping relationship corresponding to the preset sorting rule, the method for customizing the character sorting order further includes: Creating a sorting library corresponding to each of the objects to be sorted; All the mapping relationships with various objects to be sorted are stored in the sorting library corresponding to the types of the objects to be sorted.

8. The method for customizing the character sorting order according to claim 5, wherein: After the step of creating a preset sorting rule corresponding to the objects to be sorted, the method for customizing the character sorting order further includes: in response to a query instruction, obtaining the objects to be arranged involved in the query instruction; In the case where the query instruction involves multiple objects to be arranged, the preset sorting rules of the multiple objects to be arranged are executed according to the preset priority order, wherein the preset priority order is configured such that the priorities of the preset sorting rules of the data column, the preset sorting rules of the data table, the preset sorting rules of the database and the preset sorting rules of the instance decrease in sequence.

9. A machine-readable storage medium having a machine executable program stored thereon, wherein the machine executable program, when executed by a processor, implements the method for customizing a character sorting order according to any one of claims 1 to 8.

10. A computer device comprising a memory, a processor, and a machine executable program stored in the memory and running on the processor, wherein the processor implements the method for customizing a character sorting order according to any one of claims 1 to 8 when executing the machine executable program.