A database data processing method and device based on multi-rule dynamic sorting
By identifying and converting data types, using regular expressions to classify field values of mixed data types, and adopting corresponding sorting rules for sorting, the problem of low processing efficiency in traditional methods is solved and efficient sorting of mixed data types is achieved.
Patent Information
- Application Number
- CN202510942084.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-07-09
AI Technical Summary
Traditional sorting methods cannot effectively handle complex sorting requirements of mixed data types and have low processing efficiency.
By receiving sorting request information, identifying the data type of the field value, converting the field value of the first data type into an empty string, using a regular expression to classify the field value of the second data type, and sorting according to the sorting rules of different data types.
It improves data processing efficiency, meets the complex sorting requirements of mixed data types, and ensures the standardization and consistency of data.
Smart Images

Figure CN120470157B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and in particular relates to a database data processing method and device based on multi-rule dynamic sorting. Background Art
[0002] In data processing scenarios, it's often necessary to sort lists containing multiple data types, such as Chinese characters, numbers, and empty strings. Traditional sorting methods typically only support sorting rules for a single data type, such as sorting by string or numerical value. However, when a list contains Chinese characters, numbers, and empty strings, traditional sorting methods cannot meet the complex sorting requirements of mixed-type data, resulting in low processing efficiency. Summary of the Invention
[0003] In view of this, the present invention aims to propose a database data processing method and device based on multi-rule dynamic sorting to solve the problem of low processing efficiency of mixed data types.
[0004] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0005] In a first aspect, the present invention provides a database data processing method based on multi-rule dynamic sorting, comprising:
[0006] Receive sorting request information, and extract a set of field values to be sorted from the data set based on the request information;
[0007] Identify the data type of the field value in the field value set;
[0008] In a case where the field value set includes a field value of a first data type, converting the field value of the first data type into an empty string, where the field value of the first data type does not include numbers and preset language characters;
[0009] The empty string and the field value set including the field values of the second data type are sorted according to data type.
[0010] Furthermore, the field value of the first data type includes at least one of an undefined value, a reserved value, a space character, and a null character.
[0011] Furthermore, the field value of the second data type includes numbers and preset language characters, and the method further includes:
[0012] Classifying the field value of the second data type using a regular expression to obtain at least one of a numeric character string and a character string in a preset language;
[0013] The step of sorting the empty string and the field value set including the field values of the second data type according to data type includes:
[0014] At least one of the numeric character string and the preset language character string, and the empty character string are sorted according to data type.
[0015] Furthermore, sorting the empty string and the field value set including the field values of the second data type according to data type includes:
[0016] When the field value of the second data type is the numeric string, sorting the field value according to the numerical sorting rule, and placing the empty string after the numeric string;
[0017] or
[0018] When the field value of the second data type is the preset language character string, sorting the field value according to the character string sorting rule, and placing the empty character string after the preset language character string;
[0019] or
[0020] When the field value of the second data type includes the numeric string and the preset language text string, the field values are sorted according to the string sorting rule, and the empty string is located after the numeric string and the preset language text string;
[0021] The numerical value sorting rule and the character string sorting rule are both preset data processing procedures.
[0022] Furthermore, when the field value of the second data type includes a numeric string and a text string in a preset language, sorting the field value according to a string sorting rule includes:
[0023] When the field value of the second data type includes the numeric string and the preset language character string, sorting the field values according to the sorting rule of first the numeric string and then the preset language character string;
[0024] or
[0025] When the field value of the second data type includes the numeric character string and the preset language character string, the field value is sorted according to the sorting rule of the preset language character string first and the numeric character string later.
[0026] In a second aspect, based on the same concept, the present invention further provides a database data processing device based on multi-rule dynamic sorting, comprising:
[0027] An extraction module, configured to receive sorting request information and extract a set of field values to be sorted from a data set based on the request information;
[0028] an identification module, configured to identify the data type of the field value in the field value set;
[0029] a conversion module, configured to convert the field value of a first data type into an empty string if the field value set includes a field value of the first data type, wherein the field value of the first data type does not include numbers and characters in a preset language;
[0030] A sorting module is used to sort the empty string and the field value set including the field value of the second data type according to data type.
[0031] Furthermore, the field value of the first data type includes at least one of an undefined value, a reserved value, a space character, and a null character.
[0032] Furthermore, the field value of the second data type includes numbers and preset language characters, and the device further includes:
[0033] a classification module, configured to classify the field value of the second data type using a regular expression to obtain at least one of a numeric character string and a character string in a preset language;
[0034] The sorting module includes:
[0035] The sorting submodule is used to sort at least one of the digital character string and the preset language character string, and the empty character string according to data type.
[0036] Compared with the prior art, the database data processing method and device based on multi-rule dynamic sorting described in the present invention have the following advantages:
[0037] The present invention discloses a database data processing method and apparatus based on multi-rule dynamic sorting. The method and apparatus receive sorting request information, extract a set of field values to be sorted from a data set based on the request information, identify the data types of the field values in the set, convert the field values of the first data type into empty strings if the set includes field values of the first data type, and the field values of the first data type do not include numbers or text in a preset language, and sort the empty strings and the field values of the second data type included in the set according to their data types. In this way, by sorting field values of different data types using corresponding sorting rules, data processing efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which constitute part of the present invention, are provided to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are provided to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:
[0039] Figure 1 Schematic diagram of the data processing method provided in this embodiment Figure 1 ;
[0040] Figure 2 Schematic diagram of the data processing method provided in this embodiment Figure 2 ;
[0041] Figure 3 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0044] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0045] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.
[0046] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0047] See also Figure 1 , Figure 1 A schematic diagram of a database data processing method based on multi-rule dynamic sorting provided in an embodiment of the present application Figure 1 As shown in the figure, the method includes:
[0048] Step 101: receiving a sorting request message, and extracting a set of field values to be sorted from a data set based on the request message;
[0049] The above-mentioned sorting request information may include multiple data sets, and the field value set to be sorted is the set of each specific value of each column to be sorted in the data set. The field values constitute the basic elements of the database table. Each field value is part of a record in the data set, is the specific data content, and is the basis for query, statistics and other operations. Multiple field values constitute a complete data record.
[0050] In an optional implementation, the field value may be a number, text, date, time, etc., wherein the text may include at least one of Chinese text, English text, or other text.
[0051] In an optional implementation, the above-mentioned sorting request information may further include a field name, that is, an identifier of each column in the data set.
[0052] In this implementation, by reasonably defining field names, data resources can be efficiently managed and utilized.
[0053] The sorted field value set is extracted, that is, according to the field name specified by the user, the field value of the column where the field name is located is extracted from the data set, so that the correctness of the data to be processed can be ensured.
[0054] In an alternative implementation, in a user data table, "Name," "Age," and "Email" are all field names, while "Zhang San," "25," and "zhangsan@xx.xxx" are the corresponding field values. It should be noted that, taking the "Name" field name as an example, the specific representation of the field value can be various, such as "Zhang San," "Li Si," and "Wang Wu," and these "names" are specific representations of this attribute. During the data management process, users can manage and apply data by querying, modifying, and deleting field values.
[0055] Step 102, identifying the data type of the field value in the field value set;
[0056] The above data types can be numbers, text, empty strings, spaces, etc. In this way, the field value set is composed of different types of data types, reflecting the diversity of data representation.
[0057] In an optional embodiment, the above data types may also include integers, characters, variable-length characters, bits, etc.
[0058] In this embodiment, by identifying the data type of the field value, the data range and characteristics that can be stored in the field value can be more clearly understood.
[0059] Step 103: if the field value set includes a field value of a first data type, convert the field value of the first data type into an empty string, where the field value of the first data type does not include numbers or preset language characters;
[0060] In step 102, after identifying the data type of the field value in the field value set, and if it is determined that the field value set does not include numbers or a preset language, the field value of that type is converted to an empty string. The preset language is a pre-set text type, such as Chinese, English, or other text.
[0061] In an optional embodiment, when the field value of the first data type does not include numbers and preset language characters, the field value of the first data type is converted into an empty string to perform standardization and consistency processing on the field value of the first data type, thereby ensuring the standardization and consistency of the data to be processed.
[0062] In an optional embodiment, the field value of the first data type may include at least one of an undefined value (undefined), a reserved value (null), a space character, and a null character.
[0063] It should be understood that the empty string is the only string in the HYPERLINK "https: / / baike.baidu.com / item / %E5%AD%97%E6%AF%8D%E8%A1%A8 / 1314769?fromModule=lemma_inlink" \t "_blank" alphabet Σ that does not have HYPERLINK "https: / / baike.baidu.com / item / %E5%AD%97%E7%AC%A6 / 4768913?fromModule=lemma_inlink" \t "_blank" characters, labeled ε or λ. The length of the empty string is 0, and the empty string occupies one byte in memory.
[0064] In an optional implementation, when the converted field value is an empty string, or an empty string after removing spaces, it is uniformly identified as a null value.
[0065] In this embodiment, when sorting field values, field values marked as null values may be sorted according to the sorting rules to improve data processing efficiency.
[0066] In the embodiment of the present application, the field values of the first data type are processed for standardization and consistency, thereby ensuring the standardization and consistency of the data to be processed.
[0067] Step 104: sort the empty string and the field value set including the field values of the second data type according to data type.
[0068] The field values of the second data type are the set of all field values except the field values of the first data type. The empty strings converted in step 103 and the field values identified as the second data type are sorted. This improves data processing capabilities compared to traditional sorting methods that only support sorting rules for a single data type, such as sorting by string or numerical value.
[0069] It should be understood that the field of the second data type may include numbers and / or text, wherein the text may be in a preset language, such as Chinese, English, or other text.
[0070] In an optional embodiment, when the field value includes only text and empty strings, the text can be sorted according to string rules, and the empty string is always placed at the end of the sort sequence.
[0071] In an optional implementation, when the field value includes numbers, text, and empty strings, the numbers and text can be sorted according to string rules, and the empty string is always placed at the end of the sort sequence.
[0072] In another optional embodiment, when the field value includes only numbers and empty strings, the numbers can be sorted according to the numerical sorting rule, and the empty string is always placed at the end of the sorting sequence.
[0073] In this way, data processing efficiency can be improved by sorting field values of different data types using corresponding sorting rules.
[0074] In an optional implementation, an empty string and a field value whose data type is the second data type may also be sorted according to a specified sorting rule, wherein the specified sorting rule is a preset sorting rule.
[0075] In this embodiment, by sorting empty strings and field values whose data type is the second data type according to pre-set sorting rules, as the diversity and complexity of data continue to increase, users can flexibly adjust the sorting rules according to specific needs, thereby improving the adaptability of data processing.
[0076] In another optional embodiment, ascending or descending sorting can be used for sorting, so that users can see the data arrangement results more intuitively, thereby improving data processing and analysis capabilities.
[0077] Optionally, the field value of the first data type includes at least one of an undefined value (undefined), a reserved value (null), a space character, and a null character.
[0078] It should be understood that "undefined" is often used to indicate that a variable has not yet been assigned a value. During data processing, when undefined is converted to a string, it is converted to an empty string. Null is used to indicate the absence of an object or a value. During data processing, Null is also converted to an empty string. A space character with a length greater than 0 indicates a value, which is a whitespace character. The null character is a valid character object with a length of 0.
[0079] In an embodiment of the present application, by converting all field values of the first data type into empty strings, the standardization and consistency of the data are improved, thereby improving the data processing capability.
[0080] Optionally, the field value of the second data type includes numbers and text in a preset language, and the method further includes:
[0081] The field value of the second data type is classified using a regular expression to obtain at least one of a numeric character string and a character string in a preset language.
[0082] The above-mentioned numbers can be Arabic numerals, and the above-mentioned preset language and text can be Chinese text, English text, or other text, which is not limited in this embodiment.
[0083] When the second data type includes numbers and preset language characters, they are classified by regular expressions to obtain a number string and / or a preset language character string. Wherein, a regular expression is a pattern for matching character strings, which is a set of special text consisting of letters and symbols.
[0084] In an embodiment of the present application, data processing efficiency can be improved by using regular expressions to classify field values of the second data type.
[0085] In an optional embodiment, step 104 includes:
[0086] At least one of the numeric character string and the preset language character string, and the empty character string are sorted according to data type.
[0087] In an embodiment of the present application, data processing efficiency can be improved by sorting field values whose field value types are numeric strings, preset language text strings, and empty strings.
[0088] In an optional embodiment, after classifying the field values of the second data type through regular expressions, the numeric strings in the field values can be sorted according to numerical rules, the preset language and text strings in the field values can be sorted according to string rules, the empty strings in the field values can be set at the beginning of the sorting sequence, the empty strings in the field values can be set at the end of the sorting sequence, and so on. This embodiment does not limit this.
[0089] In another optional embodiment, after classifying the field values of the second data type using regular expressions, the field values containing numeric strings and preset language text strings can also be sorted according to the interweaving rules of numeric strings and preset language text strings.
[0090] Among them, the interspersion rules can be pre-set interspersion rules, for example: the numeric strings and the preset language and text strings are sorted in a manner of alternating with each other in sequence, or the numeric strings and the preset language and text strings are sorted in a manner of alternating with each other at certain regular intervals, which is not limited in this embodiment.
[0091] In another optional implementation, when the field value includes mixed data of multiple types including numeric strings, preset language text strings, and empty strings, corresponding sorting rules may be applied to the multiple data types.
[0092] Optionally, sorting the empty string and the field value set including the field values of the second data type according to data type includes:
[0093] When the field value of the second data type is the numeric string, sorting the field value according to the numerical sorting rule, and placing the empty string after the numeric string;
[0094] or
[0095] When the field value of the second data type is the preset language character string, sorting the field value according to the character string sorting rule, and placing the empty character string after the preset language character string;
[0096] or
[0097] When the field value of the second data type includes the numeric string and the preset language text string, the field values are sorted according to the string sorting rule, and the empty string is located after the numeric string and the preset language text string;
[0098] The numerical value sorting rule and the character string sorting rule are both preset data processing procedures.
[0099] The above numerical sorting rules may include numerical size sorting rules, and may also include numerical length sorting rules, etc.
[0100] In an embodiment of the present application, when the field value of the second data type is a numeric string, the field value is sorted according to the numerical sorting rules, and the empty string of the first data type is arranged after the numeric string. In this way, the two data types containing numeric strings and empty strings can be arranged, and by improving the data sorting efficiency, the data processing efficiency can be improved.
[0101] In an optional implementation, the field values may be arranged in ascending order, or the field values may be arranged in descending order.
[0102] In an optional implementation, when the field value of the second data type is a numeric string, the field value may be arranged in order from short to long, or the field value may be arranged in order from long to short.
[0103] When the field value of the second data type is a preset language text string, the field value is sorted according to the string sorting rules, and the empty string is placed after the preset language text string. In this way, the two data types containing the preset language text string and the empty string can be arranged. By improving the data sorting efficiency, the data processing efficiency can be improved.
[0104] The string rule may include an alphabetical sorting rule. Thus, when the field value of the second data type is a preset language character string, the field value may be sorted according to the alphabetical sorting rule based on the first letter of the first word of the field value.
[0105] In an optional implementation, when the field value of the second data type is a Chinese character, the field value may be sorted according to the first pinyin letter of the first Chinese character.
[0106] In an optional implementation, when the field of the second data type is in English, the sorting may be performed based on the first letter of the first English letter of the field value.
[0107] The above string rules may also include a stroke number sorting rule, for example, sorting based on the stroke number of the first Chinese character of the field value.
[0108] When the field value of the second data type includes a numeric string and a preset language text string, the field value is sorted according to the string sorting rules, and the empty string is placed after the numeric string and the preset language text string. In this way, the three data types including the numeric string, the preset language text string and the empty string can be arranged. By improving the data sorting efficiency, the data processing efficiency can be improved.
[0109] As can be seen from the above, there may be multiple sorting rules for the preset numeric character strings and the preset language character strings, which are not limited in this embodiment.
[0110] In addition, it should be noted that when the preset language character string of the second data type includes multiple languages, it can also be set to be sorted according to a preset sorting rule, which is not limited in this embodiment.
[0111] In an embodiment of the present application, field values of various data types are sorted to meet various sorting requirements in different scenarios.
[0112] Optionally, when the field value of the second data type includes a numeric string and a text string in a preset language, sorting the field value according to a string sorting rule includes:
[0113] When the field value of the second data type includes the numeric string and the preset language character string, sorting the field values according to the sorting rule of first the numeric string and then the preset language character string;
[0114] or
[0115] When the field value of the second data type includes the numeric character string and the preset language character string, the field value is sorted according to the sorting rule of the preset language character string first and the numeric character string later.
[0116] It should be understood that when the field value of the second data type includes a numeric string and a preset language and text string, the field value is sorted according to the sorting rule of the preset language and text string first and then the numeric string, or the numeric string first and then the preset language and text string, which means that the data of the two data types are not sorted interspersed.
[0117] In an embodiment of the present application, when the field value of the second data type includes at least two data types, a numeric string and a preset language text string, a sorting rule is set so that the two data types are not interspersed for sorting, which can facilitate user viewing.
[0118] In addition, the empty string is placed after the numeric string and the preset language text string. In this way, the three data types including the numeric string, the preset language text string and the empty string can be arranged. By improving the data sorting efficiency, the data processing efficiency can be improved.
[0119] In order to more clearly describe the data processing method provided in the embodiment of the present application, please refer to Figure 2 The workflow of the data processing method is shown in .
[0120] like Figure 2As shown, after extracting the field values to be sorted, the field values to be sorted are normalized. This normalization process converts undefined values, reserved values, spaces, and null characters in the field values into empty strings. Furthermore, empty strings in the field values are marked as null values, where null values include empty strings and field values that are empty strings after removing spaces. The field values to be sorted are then determined to be of different data types. If the current field value is a purely numeric string, the field value is sorted according to a numeric sorting rule. If the current field value is a non-numeric string, the field value is sorted according to a string sorting rule. If the field value includes both purely numeric and non-numeric data types, the two data types are sorted using a non-interleaved sorting rule. Specifically, if the preset language is Chinese, the sorting rules may include sorting Chinese characters before numbers (also called ascending order) and sorting Chinese characters after numbers (also called descending order). In this way, the field values to be sorted are sorted by the sorting rules of the multi-rule dynamic sorting, and the obtained sorting results are returned. At this point, the data processing method completes the sorting of field values of different data types.
[0121] In this way, data processing efficiency can be improved by sorting field values of different data types using corresponding sorting rules.
[0122] See also Figure 3 , Figure 3 A schematic diagram of the structure of a database data processing device based on multi-rule dynamic sorting provided in an embodiment of the present application, i.e., a data processing device, as shown in the figure, includes:
[0123] Extraction module 301, configured to receive sorting request information and extract a set of field values to be sorted from a data set based on the request information;
[0124] Identification module 302, used to identify the data type of the field value in the field value set;
[0125] The conversion module 303 is configured to convert the field value of the first data type into an empty string if the field value set includes a field value of the first data type, where the field value of the first data type does not include numbers or characters in a preset language.
[0126] The sorting module 304 is configured to sort the empty string and the field value set including the field values of the second data type according to data type.
[0127] Optionally, the field value of the first data type includes at least one of an undefined value, a reserved value, a space character, and a null character.
[0128] Optionally, the field value of the second data type includes numbers and preset language characters, and the apparatus 300 further includes:
[0129] a classification module, configured to classify the field value of the second data type using a regular expression to obtain at least one of a numeric character string and a character string in a preset language;
[0130] The sorting module includes:
[0131] The sorting submodule is used to sort at least one of the digital character string and the preset language character string, and the empty character string according to data type.
[0132] Optionally, the sorting submodule is specifically configured to:
[0133] When the field value of the second data type is the numeric string, sorting the field value according to the numerical sorting rule, and placing the empty string after the numeric string;
[0134] or
[0135] When the field value of the second data type is the preset language character string, sorting the field value according to the character string sorting rule, and placing the empty character string after the preset language character string;
[0136] or
[0137] When the field value of the second data type includes the numeric string and the preset language text string, the field values are sorted according to the string sorting rule, and the empty string is located after the numeric string and the preset language text string;
[0138] The numerical value sorting rule and the character string sorting rule are both preset data processing procedures.
[0139] Optionally, when the field value of the second data type includes a numeric string and a text string in a preset language, sorting the field value according to a string sorting rule includes:
[0140] When the field value of the second data type includes the numeric string and the preset language character string, sorting the field values according to the sorting rule of first the numeric string and then the preset language character string;
[0141] or
[0142] When the field value of the second data type includes the numeric character string and the preset language character string, the field value is sorted according to the sorting rule of the preset language character string first and the numeric character string later.
[0143] The data processing device in the embodiment of the present application can be an electronic device, such as an electronic device with an operating system, or a component in the electronic device, such as an integrated circuit or a chip.
[0144] The data processing device provided in the embodiment of the present application can realize Figure 1 or Figure 2 The various processes implemented in the method embodiment shown achieve the same technical effect, and to avoid repetition, they will not be described again here.
[0145] Alternatively, as Figure 4 As shown, an embodiment of the present application also provides an electronic device 400, including a processor 401 and a memory 402, wherein the memory 402 stores a program or instruction that can be run on the processor 401, and when the program or instruction is executed by the processor 401, the various steps of the above-mentioned data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0146] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A database data processing method based on multi-rule dynamic sorting, which is applied to list sorting in data processing scenarios, is characterized by: include: Receive sorting request information, and extract a set of field values to be sorted from the data set based on the request information; Identify the data type of the field value in the field value set; In a case where the field value set includes a field value of a first data type, converting the field value of the first data type into an empty string, where the field value of the first data type does not include numbers and preset language characters; The empty string and the field value set including the field values of the second data type are sorted according to data type.
2. The database data processing method based on multi-rule dynamic sorting according to claim 1, characterized in that: The field value of the first data type includes at least one of an undefined value, a reserved value, a space character, and a null character.
3. A database data processing method based on multi-rule dynamic sorting according to claim 1 or 2, characterized in that: The field value of the second data type includes numbers and preset language characters, and the method further includes: Classifying the field value of the second data type using a regular expression to obtain at least one of a numeric character string and a character string in a preset language; The step of sorting the empty string and the field value set including the field values of the second data type according to data type includes: At least one of the numeric character string and the preset language character string, and the empty character string are sorted according to data type.
4. The database data processing method based on multi-rule dynamic sorting according to claim 3 is characterized in that: The step of sorting the empty string and the field value set including the field values of the second data type according to data type includes: When the field value of the second data type is the numeric string, sorting the field value according to the numerical sorting rule, and placing the empty string after the numeric string; or When the field value of the second data type is the preset language character string, sorting the field value according to the character string sorting rule, and placing the empty character string after the preset language character string; or When the field value of the second data type includes the numeric string and the preset language text string, the field values are sorted according to the string sorting rule, and the empty string is located after the numeric string and the preset language text string; The numerical value sorting rule and the character string sorting rule are both preset data processing procedures.
5. The database data processing method based on multi-rule dynamic sorting according to claim 4 is characterized in that: When the field value of the second data type includes a numeric string and a text string in a preset language, sorting the field value according to a string sorting rule includes: When the field value of the second data type includes the numeric string and the preset language character string, sorting the field values according to the sorting rule of first the numeric string and then the preset language character string; or When the field value of the second data type includes the numeric character string and the preset language character string, the field value is sorted according to the sorting rule of the preset language character string first and the numeric character string later.
6. A database data processing device based on multi-rule dynamic sorting, applied to a database data processing method based on multi-rule dynamic sorting according to any one of claims 1 to 5, characterized in that: include: An extraction module, configured to receive sorting request information and extract a set of field values to be sorted from a data set based on the request information; an identification module, configured to identify the data type of the field value in the field value set; a conversion module, configured to convert the field value of a first data type into an empty string if the field value set includes a field value of the first data type, wherein the field value of the first data type does not include numbers and characters in a preset language; A sorting module is used to sort the empty string and the field value set including the field value of the second data type according to data type.
7. The database data processing device based on multi-rule dynamic sorting according to claim 6, characterized in that: The field value of the first data type includes at least one of an undefined value, a reserved value, a space character, and a null character.
8. A database data processing device based on multi-rule dynamic sorting according to claim 6 or 7, characterized in that: The field value of the second data type includes numbers and preset language characters, and the device further includes: a classification module, configured to classify the field value of the second data type using a regular expression to obtain at least one of a numeric character string and a character string in a preset language; The sorting module includes: The sorting submodule is used to sort at least one of the digital character string and the preset language character string, and the empty character string according to data type.
Citation Information
Patent Citations
Data processing method and device, equipment and storage medium
CN118803628A
Text search result sorting method and device, electronic equipment, readable medium and program product
CN119202221A