Data sorting method and device, computer equipment and storage medium

By constructing a mechanism that separates the data index from the actual data, and sorting only the lightweight index, the problems of memory overhead and performance loss in traditional multidimensional data sorting are solved, achieving efficient and flexible multidimensional data sorting.

CN121579480APending Publication Date: 2026-02-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511760212.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Traditional multidimensional data sorting methods suffer from memory overhead and performance degradation due to repeated data copying, which limits the flexibility and efficiency of sorting.

Method used

By constructing a mechanism to separate the data index from the actual data, sorting operations are performed only on the lightweight data index, while keeping the storage order of the target data unchanged, thus achieving the separation of the index sorting result from the data storage result.

Benefits of technology

It significantly improves sorting efficiency, avoids memory overhead and performance loss, and enhances the flexibility of multi-dimensional data sorting, enabling it to quickly respond to sorting needs for any combination of different dimension columns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579480A_ABST
    Figure CN121579480A_ABST
Patent Text Reader

Abstract

The invention relates to a data sorting method and device, computer equipment and a storage medium. The method comprises the following steps: in response to a sorting request for any dimension column in a target database, determining a sorting strategy of the sorting request; the target database comprises at least one piece of target data and a data index having a mapping relationship with the target data; the target data comprises at least one dimension column; sorting the data indexes of the corresponding target data in the target database according to the data content of the dimension column based on a sorting strategy to obtain an index sorting result of the target data; wherein in the index sorting result, each data index is a sorting result obtained by sorting according to the sorting request, and the sorting sequence of each target data is not changed. By adopting the method, the sorting flexibility and the sorting efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data sorting technology, and in particular to a data sorting method, apparatus, computer device, and storage medium. Background Technology

[0002] With the rapid development of big data and real-time analytics technologies, fast sorting of multi-dimensional in-memory data has become crucial for improving data analysis efficiency. In applications such as online analytical processing (OLAP), data warehousing, and real-time decision-making systems, it is often necessary to dynamically sort the same dataset multiple times according to different dimension columns to meet diverse query and analysis needs.

[0003] In traditional techniques, sorting multidimensional data typically involves encapsulating the data as objects. For example, in C++, data is organized into structures with corresponding comparison operators, or in Java, sorting rules are defined by implementing comparable interfaces. This approach achieves sorting by directly comparing object attribute values, requiring multiple copies and moves of the entire data object during the sorting process.

[0004] However, traditional sorting methods require moving or copying actual data objects for each sort, which leads to huge memory overhead and performance loss when sorting multiple times according to different dimensions. This severely limits the flexibility and efficiency of sorting. Summary of the Invention

[0005] Therefore, it is necessary to provide a data sorting method, apparatus, computer equipment, and storage medium that can improve sorting flexibility and efficiency in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a data sorting method, including:

[0007] In response to a sorting request for any dimension column in the target database, a sorting strategy for the sorting request is determined; the target database includes at least one target data and a data index that has a mapping relationship with the target data; the target data includes at least one dimension column;

[0008] Based on the sorting strategy, the data index of the corresponding target data in the target database is sorted according to the data content of the dimension column to obtain the index sorting result of the target data;

[0009] In the index sorting results, each data index is a sorting result obtained by sorting according to the sorting request, and the sorting order of each target data has not changed.

[0010] In one embodiment, the method further includes:

[0011] In response to a query request for the index sorting result, each data index matched with the query request is determined as a first index;

[0012] The target data having a mapping relationship with each first index is displayed to display the query result.

[0013] In one embodiment, the target data having a mapping relationship with each first index is displayed to display the query result, including:

[0014] From the target database, target data having a mapping relationship with the corresponding first index is obtained;

[0015] According to the sorting order of each first index, each target data is sorted to obtain a query sorting result;

[0016] The query sorting result is displayed to display the query result.

[0017] In one embodiment, the target data further includes at least one metric column; the method further includes:

[0018] In response to a data processing request for the index sorting result, each second index matched with the data processing request and the data processing strategy corresponding to each second index are determined; the data processing strategy includes at least one metric column to be processed;

[0019] For each second index, target data having a mapping relationship with the second index is obtained from the target database;

[0020] Based on the data processing strategy corresponding to the second index, the data content of the corresponding metric column in the target data is processed to obtain a data processing result of the second index;

[0021] The data processing result of each second index is displayed.

[0022] In one embodiment, the data processing result of each second index is displayed, including:

[0023] According to the sorting order of each second index, the data processing result corresponding to the corresponding second index is sorted to obtain a data sorting result;

[0024] The data sorting result is displayed to display the data processing result of each second index.

[0025] In one embodiment, the data index is determined by the following method:

[0026] At least one target data to be sorted is obtained;

[0027] According to the arrangement order of each target data, the data index of the corresponding target data is determined; the target data and the corresponding data index have a mapping relationship;

[0028] The data index and the target data are stored in the target database in the form of a dynamic array.

[0029] In one embodiment, the method further comprises:

[0030] In response to a data addition request for the target database, obtaining addition data;

[0031] sequentially adding the addition data to the target database;

[0032] According to the data index order of the target data, generating a data index of the addition data to complete the data addition request for the target database.

[0033] In a second aspect, the application further provides a data sorting device, comprising:

[0034] A policy module is configured to determine a sorting policy of a sorting request in response to the sorting request for any dimension column in a target database; the target database comprises at least one target data and a data index having a mapping relationship with the target data; the target data comprises at least one dimension column.

[0035] A sorting module is configured to sort the data index of the corresponding target data in the target database based on the data content of the dimension column according to the sorting policy, and obtain an index sorting result of the target data.

[0036] In the index sorting result, each data index is the sorting result obtained by sorting according to the sorting request, and the sorting order of each target data does not change.

[0037] In a third aspect, the application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0038] In response to a sorting request for any dimension column in a target database, determine a sorting policy of the sorting request; the target database comprises at least one target data and a data index having a mapping relationship with the target data; the target data comprises at least one dimension column.

[0039] Based on the sorting policy, sort the data index of the corresponding target data in the target database according to the data content of the dimension column, and obtain an index sorting result of the target data.

[0040] In the index sorting result, each data index is the sorting result obtained by sorting according to the sorting request, and the sorting order of each target data does not change.

[0041] In a fourth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the following steps:

[0042] In response to a sorting request for any dimension column in the target database, determining a sorting strategy of the sorting request; the target database comprising at least one target data and a data index having a mapping relationship with the target data; the target data comprising at least one dimension column;

[0043] Based on the sorting strategy, sorting the data index of the corresponding target data in the target database according to the data content of the dimension column, to obtain an index sorting result of the target data;

[0044] In the index sorting result, each data index is a sorting result obtained by sorting according to the sorting request, and the sorting order of each target data does not change.

[0045] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:

[0046] In response to a sorting request for any dimension column in the target database, determining a sorting strategy of the sorting request; the target database comprising at least one target data and a data index having a mapping relationship with the target data; the target data comprising at least one dimension column;

[0047] Based on the sorting strategy, sorting the data index of the corresponding target data in the target database according to the data content of the dimension column, to obtain an index sorting result of the target data;

[0048] In the index sorting result, each data index is a sorting result obtained by sorting according to the sorting request, and the sorting order of each target data does not change.

[0049] The above data sorting method, device, computer device and storage medium, by constructing a separation mechanism of data index and actual data, only sorting the lightweight data index when responding to the sorting request, and keeping the storage order of the target data itself unchanged. This design makes the system not need to move or copy the actual data at each sorting time, fundamentally avoiding the memory overhead and performance loss caused by data duplication in the traditional sorting method, thereby significantly improving the sorting efficiency; at the same time, due to the flexibility and low cost characteristics of index sorting, the system can quickly respond to the sorting demand of any combination of different dimension columns, greatly enhancing the flexibility of multi-dimensional data sorting. BRIEF DESCRIPTION OF DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor based on these drawings.

[0051] Figure 1 An application environment diagram of the data sorting method provided in the embodiment;

[0052] Figure 2A A flowchart of the first data sorting method provided in the embodiment;

[0053] Figure 2B A sorting result diagram provided in the embodiment;

[0054] Figure 3 A flowchart of the query result display step provided in the embodiment;

[0055] Figure 4 A flowchart of the data processing result display step provided in the embodiment;

[0056] Figure 5 A flowchart of the target data storage step provided in the embodiment;

[0057] Figure 6 A flowchart of the data adding step provided in the embodiment;

[0058] Figure 7 A structural block diagram of the data sorting device provided in the embodiment;

[0059] Figure 8 An internal structure diagram of the computer device provided in the embodiment. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0061] The data sorting method provided in the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data required by the server 104 to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The computer device determines the sorting strategy of the sorting request in response to the sorting request of any dimension column in the target database; the target database includes at least one target data and a data index having a mapping relationship with the target data; the target data includes at least one dimension column; based on the sorting strategy, the data index of the corresponding target data in the target database is sorted according to the data content of the dimension column, and the index sorting result of the target data is obtained; wherein in the index sorting result, each data index is the sorting result obtained by sorting according to the sorting request, and the sorting order of each target data does not change. Among them, the terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0062] In an exemplary embodiment, as shown in Figure 2A , a data sorting method is provided, which is applied to Figure 1 the computer device in the example for illustration, including the following steps S201 to S202. Among them:

[0063] S201 determines the sorting strategy of the sorting request in response to the sorting request of any dimension column in the target database.

[0064] Among them, the target database refers to a database system that stores target data and its associated data index, wherein the target data contains at least one dimension column and one measure column, and the data index has a stable mapping relationship with the target data. The target database includes at least one target data and a data index having a mapping relationship with the target data.

[0065] Among them, the dimension column refers to the attribute column in the target data used for sorting operation, and its data content is used as the basis for sorting, which is usually classified or descriptive data. The measure column refers to the column attribute contained in the target data, which is used for calculation or aggregation operation, and is usually used for statistical, summation, counting and other measurement type data processing (such as summation, counting, etc., and the calculation type can be configured through the aggregation type field).

[0066] Among them, the sorting request refers to the operation instruction initiated by the user or the system for sorting any dimension column in the target database, which contains the dimension column identifier to be sorted and the sorting direction.

[0067] The sorting strategy refers to the sorting rule configuration determined according to the sorting request, including a set of parameters such as the dimension column to be sorted, the sorting order (ascending / descending), and possible sorting algorithm selection.

[0068] In some embodiments, in response to a sorting request for any dimension column in the target database, the sorting request is parsed to obtain the sorting strategy.

[0069] S202 uses a sorting strategy to sort the data index of the corresponding target data in the target database according to the data content of the dimension column, and obtains the index sorting result of the target data.

[0070] The target data refers to the original data records stored in the target database, which contain at least one dimension column and one or more optional metric columns, and maintain a fixed arrangement order at the physical storage level.

[0071] Among them, the data index refers to a lightweight sequence of identifiers that establishes a one-to-one mapping relationship with the target data. It serves as an indirect addressing carrier for accessing the target data and does not contain actual data content itself.

[0072] The index sorting result refers to the ordered index sequence obtained by rearranging the data indexes based on a specified sorting strategy. This sequence reflects the logical sorting relationship of the target data on a specific dimension column and does not affect the physical storage order of the target data. In the index sorting result, each data index is a sorting result obtained according to the sorting request, and the sorting order of each target data remains unchanged.

[0073] In some embodiments, for any dimension column, when the sorting strategy is ascending, the data index of the corresponding target data is sorted according to the data content of that dimension column in ascending order, to obtain the index sorting result of the target data. When the sorting strategy is descending, the data index of the corresponding target data is sorted according to the data content of that dimension column in descending order, to obtain the index sorting result of the target data.

[0074] For example, taking date as the dimension column, when the sorting strategy is from now to the past, the data indexes corresponding to the target data with earlier dates are sorted first, and the data indexes corresponding to the target data with later dates are sorted last, so as to sort the data indexes of the corresponding target data in the target database and obtain the index sorting result of the target data.

[0075] For example, Figure 2BThe shown ordering result schematic diagram, before the target data is sorted, the order between the row number (i.e. data index) and the column data (i.e. target data) is the original order; after the target data is sorted, the row number (i.e. data index) is sorted according to the sorting request, and the column data (i.e. target data) maintains the original order, but the mapping relationship between the data index and the target data still exists, so the target data corresponding to the data index can still be found based on the data index.

[0076] The above data sorting method, by constructing a separation mechanism of data index and actual data, only sorts the lightweight data index when responding to the sorting request, and keeps the storage order of the target data unchanged. This design makes the system not need to move or copy the actual data at each sorting time, fundamentally avoids the memory overhead and performance loss caused by data duplication in the traditional sorting method, thereby significantly improving the sorting efficiency; at the same time, due to the flexibility and low cost characteristics of index sorting, the system can quickly respond to the sorting demand of any combination of different dimension columns, greatly enhancing the flexibility of multi-dimensional data sorting.

[0077] Figure 3 A flowchart of the query result display step in one embodiment. The above embodiment is refined in this embodiment, including the following steps:

[0078] S301, in response to a query request for the index sorting result, each data index matched with the query request is taken as a first index.

[0079] The query request is an operation instruction initiated for the index sorting result, which requires to obtain the visualization data result of a specific range or condition. The first index is a subset of data indexes matched with the query condition, which is filtered from the index sorting result in response to the query request.

[0080] In some embodiments, in response to the query request for the index sorting result, the query request is parsed to obtain each data index matched with the query request, and the corresponding data index is taken as the first index.

[0081] S302, display the target data having a mapping relationship with each first index to display the query result.

[0082] In an optional embodiment, the target data having a mapping relationship with each first index is directly displayed to display the query result.

[0083] In another optional embodiment, from the target database, the target data having a mapping relationship with the corresponding first index is obtained; each target data is sorted according to the sorting order of each first index to obtain a query sorting result; and the query sorting result is displayed to display the query result.

[0084] Exemplarily, first, corresponding target data is accurately extracted from the target database according to the first index set and through a preset mapping relationship; subsequently, the extracted target data is logically rearranged in strict accordance with the established sorting order of the first index, to generate a query sorting result with a specific sequential structure; finally, the result is rendered and displayed through a visual interface, thereby completing the complete data output process from index query to result presentation.

[0085] In the above embodiment, by establishing the mapping relationship between the index and the data, the sorted index sequence is located first during the query, and the actual data is then obtained through the reverse index. This secondary addressing mechanism not only retains the data order brought by sorting, but also realizes the decoupling of the query result and the underlying storage, so that the system can quickly respond to the query requirements under different sorting perspectives without changing the physical data distribution, effectively improving the flexibility of data display and the query response efficiency.

[0086] Figure 4 A flowchart of a data processing result display step in an embodiment. In this embodiment, the above embodiment is refined, including the following steps:

[0087] S401 In response to a data processing request for an index sorting result, determine each second index matched with the data processing request, and the data processing strategy corresponding to each second index.

[0088] The data processing request refers to an instruction or request issued by a user or system to a data processing module, requiring a specific operation (such as query, update, analysis, conversion, etc.) to be performed on specific data, and usually includes data identification, operation type, processing parameters, and result return requirements, etc. The data processing strategy includes at least one metric column to be processed.

[0089] The data processing strategy refers to a set of rules, methods or processes adopted by the system or algorithm for the data processing request, used to determine how to efficiently and accurately perform data processing operations (such as selecting a processing path, allocating computing resources, optimizing a query plan, applying data filtering or aggregation rules, etc.) to meet performance, cost, consistency, etc. goals.

[0090] In some embodiments, in response to a data processing request for an index sorting result, at least one second index is parsed from the data processing request, and a data processing strategy for the corresponding second index is determined. Exemplarily, the data processing strategy can be to perform summation processing on metric column 1 and metric column 2 in second index 1, and to perform difference processing on metric column 3 and metric column 4 in second index 2. The specific data processing strategy is not limited in this embodiment.

[0091] S402, for each second index, obtaining target data corresponding to the second index from the target database.

[0092] In some embodiments, for each second index, target data corresponding to the second index is found from the target database.

[0093] S403, based on the data processing strategy corresponding to the second index, performing data processing on the data content of the corresponding metric column in the target data to obtain the data processing result of the second index.

[0094] The data processing result is a final data set or state feedback generated according to the data of different metric columns in the target data and the preset processing rule (such as calculation, analysis, conversion, aggregation, etc.) after execution, which usually includes processed data content, state identifier (such as success / failure), meta information (such as timestamp, data volume), etc.

[0095] In some embodiments, based on the data processing strategy corresponding to the second index, the metric column to be processed is determined; and data processing is performed on the data content of the corresponding metric column in the target data to obtain the data processing result of the second index.

[0096] S404, displaying the data processing result of each second index.

[0097] In an optional embodiment, the data processing result of each second index is directly displayed.

[0098] In an optional embodiment, the data processing result corresponding to each second index is sorted according to the sorting order of the second index to obtain a data sorting result; and the data sorting result is displayed to display the data processing result of each second index.

[0099] For example, the sorting order of each second index is used to sort the data processing result corresponding to the second index to obtain a data sorting result; and the data sorting result is displayed in a display interface to display the data processing result of each second index.

[0100] In the above embodiments, by associating the data processing operation with the sorting index, only the target data corresponding to the index is processed for the specific metric column based on the obtained sorted index. This mechanism not only maintains the consistency of the data perspective of the sorting result, but also realizes the accurate control of the range of data processing, avoiding unnecessary data traversal and waste of computing resources, thereby significantly improving the pertinence and execution efficiency of data processing while maintaining the sorting effect.

[0101] Figure 5Fig. 1 is a flowchart illustrating a process of target data storage in an embodiment. In this embodiment, the above embodiment is refined, including the following steps:

[0102] S501 obtaining at least one target data to be sorted.

[0103] It should be noted that each target data set containing multiple target data can be imagined as a table (DataTable) composed of rows (DataRow) and columns (DataColumn), and the data is organized by columns, and since the data types of the columns are the same, a container can be used to store the data; each row can be identified by its row number, and the row number is saved in a separate container, and the specific content of each column can be located by the row number. When performing sorting of different dimensions, only the row numbers need to be traversed, the values of the sorting columns are located by the row numbers, the sizes are compared, and the sorting results (true / false) are returned. In this way, only the data in the row number container needs to be moved, and the real data in each column remains unchanged. In this way, the movement of the data actually involved in the sorting is avoided. The cost is an additional indirect value acquisition process, but the data is stored continuously and can be obtained directly by offset, which is very small.

[0104] In some embodiments, obtaining at least one target data to be sorted can convert the target data to be sorted into a target data table containing target data to update the target data. For example, define which columns of target data, column names of each column, data types, and dimension types, as shown in the following Table 1 target data table.

[0105] Table 1 Target data table

[0106]

[0107] It should be noted that the above table defines different attributes of the columns of a data source, in which the column types are divided into dimension columns (dim) and measure columns (measure), the dimension columns are used for sorting, and the measure columns are used for calculation, and the type of calculation can be configured by the aggregation type field, such as sum, count, etc.

[0108] S502 determining the data index of the corresponding target data according to the arrangement order of each target data.

[0109] In which, there is a mapping relationship between the target data and the corresponding data index.

[0110] In some embodiments, a container (such as a vector in C++) is configured for each column in the configuration table to hold the target data, and a hidden column named _row_id_ is added, which is of int type and corresponds to an internal container storing the data index of the corresponding target data.

[0111] S503 stores the data index and the target data in the form of a dynamic array in the target database.

[0112] In the above embodiments, by establishing a stable mapping relationship between the target data and the data index, and using a dynamic array form for unified storage, the physical storage order of the original data is maintained, and an independent lightweight index layer is built. This storage structure lays the foundation for subsequent sorting operations, enabling the system to complete various sorting tasks by only operating on the index array without moving the actual data, thereby achieving the unity of data storage stability and sorting flexibility at the data structure level, providing a basic guarantee for efficient sorting.

[0113] Figure 6 A flowchart of the data addition step in one embodiment. In this embodiment, the above embodiment is refined, including the following steps:

[0114] S601 responds to the data addition request of the target database and obtains the added data.

[0115] S602 sequentially adds the added data to the target database.

[0116] S603 generates the data index of the added data according to the data index order of the target data to complete the data addition request of the target database.

[0117] In some embodiments, during the process of sequentially loading the added data into the target database, a new row is added to the target database to store the added data, and the added data is added to the new row in the target database. If it is empty, it is filled with a default value. _row_id_ is filled according to the self-increasing logic, i.e., the data index of the added data is generated according to the data index order of the target data.

[0118] In the above embodiments, by sequentially adding the added data to the target database and automatically generating the corresponding data index according to the existing index order, the consistent mapping relationship between the index and the data is maintained while maintaining the continuous storage of the data. This mechanism not only ensures that the added data can be immediately integrated into the existing sorting system, but also avoids the reconstruction of the index structure or large-scale data migration caused by data insertion, thereby realizing the efficiency of dynamic expansion of data and the low overhead of index maintenance on the premise of ensuring data integrity.

[0119] It should be understood that although each step in the flowchart involved in each embodiment as described above is shown in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless explicitly stated herein, there is no strict order limitation for the execution of these steps, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps.

[0120] Based on the same inventive concept, the embodiments of the present application also provide a data sorting device for implementing the above-mentioned data sorting method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more data sorting device embodiments provided below can refer to the limitations of the data sorting method described above, which will not be repeated here.

[0121] In one exemplary embodiment, as shown in Figure 7 A data sorting device is provided, comprising a strategy module 701 and a sorting module 702, wherein:

[0122] The strategy module 701 is configured to determine a sorting strategy of a sorting request in response to the sorting request for any dimension column in a target database; the target database comprises at least one target data and a data index having a mapping relationship with the target data; the target data comprises at least one dimension column;

[0123] The sorting module 702 is configured to sort the data index of the corresponding target data in the target database according to the data content of the dimension column based on the sorting strategy, to obtain an index sorting result of the target data;

[0124] In the index sorting result, each data index is the sorting result obtained by sorting according to the sorting request, and the sorting order of each target data does not change

[0125] In some embodiments, the data sorting device further comprises a query module configured to, in response to a query request for the index sorting result, take each data index matching the query request as a first index; and display the target data having a mapping relationship with each first index to display a query result.

[0126] In some embodiments, the query module is further configured to: acquire target data corresponding to the first indexes from the target database; sort the target data according to the sorting order of the first indexes to obtain a query sorting result; and display the query sorting result to display the query result.

[0127] In some embodiments, the data sorting apparatus further comprises a processing module configured to: in response to a data processing request for the index sorting result, determine second indexes matched with the data processing request and data processing strategies corresponding to the second indexes; the data processing strategies comprise at least one to-be-processed metric column; acquire target data corresponding to the second indexes from the target database; perform data processing on data contents of corresponding metric columns in the target data based on the data processing strategies corresponding to the second indexes to obtain data processing results of the second indexes; and display the data processing results of the second indexes.

[0128] In some embodiments, the processing module is further configured to: sort the data processing results corresponding to the second indexes according to the sorting order of the second indexes to obtain a data sorting result; and display the data sorting result to display the data processing results of the second indexes.

[0129] In some embodiments, the data sorting apparatus further comprises a storage module configured to: acquire at least one target data to be sorted; determine data indexes of the target data according to the arrangement order of the target data; the target data and the data indexes have a mapping relationship; and store the data indexes and the target data in the target database in the form of a dynamic array.

[0130] In some embodiments, the storage module is further configured to: in response to a data addition request for the target database, acquire addition data; add the addition data to the target database in sequence; and generate data indexes of the addition data according to the data index order of the target data to complete the data addition request for the target database.

[0131] The modules in the data sorting apparatus described above can be realized by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the modules.

[0132] In an exemplary embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in FIG. 1. Figure 8As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to realize a data sorting method.

[0133] Those skilled in the art can understand that, Figure 8 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0134] In one embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to realize the steps in each of the above method embodiments.

[0135] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by the processor to realize the steps in each of the above method embodiments.

[0136] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by the processor to realize the steps in each of the above method embodiments.

[0137] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0138] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0139] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.

[0140] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A data sorting method, characterized in that, The method includes: In response to a sorting request for any dimension column in a target database, a sorting strategy for the sorting request is determined; the target database includes at least one target data and a data index that has a mapping relationship with the target data; the target data includes at least one dimension column; Based on the sorting strategy, the data index of the corresponding target data in the target database is sorted according to the data content of the dimension column to obtain the index sorting result of the target data; In the index sorting results, each data index is a sorting result obtained by sorting according to the sorting request, and the sorting order of each target data has not changed.

2. The method according to claim 1, characterized in that, The method further includes: In response to a query request for the sorted results of the index, each data index that matches the query request is used as the first index; Display the target data that has a mapping relationship with each of the first indexes to show the query results.

3. The method according to claim 2, characterized in that, The step of displaying target data that has a mapping relationship with each of the first indexes to display query results includes: From the target database, obtain the target data that has a mapping relationship with the corresponding first index; The target data are sorted according to the sorting order of each of the first indexes to obtain the query sorting result; Display the sorted query results to show the query results.

4. The method according to claim 1, characterized in that, The target data also includes at least one metric column; the method further includes: In response to a data processing request for the index sorting results, each second index matching the data processing request is determined, and a data processing strategy corresponding to each second index is determined; the data processing strategy includes at least one metric column to be processed. For each second index, retrieve target data that has a mapping relationship with the second index from the target database; Based on the data processing strategy corresponding to the second index, the data content of the corresponding metric column in the target data is processed to obtain the data processing result of the second index; Displays the data processing results for each second index.

5. The method according to claim 4, characterized in that, The display of the data processing results for each second index includes: According to the sorting order of each of the second indices, the data processing results corresponding to the respective second indices are sorted to obtain the data sorting results; The data sorting results are displayed to show the data processing results for each second index.

6. The method according to any one of claims 1-5, characterized in that, The method further includes: Obtain at least one target data item to be sorted; The data index of each target data is determined according to the order in which the target data is arranged; there is a mapping relationship between the target data and the corresponding data index. The data index and the target data are stored in the target database as a dynamic array.

7. The method according to claim 6, characterized in that, The method further includes: In response to a request to add data to the target database, retrieve the newly added data; Add the newly added data sequentially to the target database; The data index of the newly added data is generated according to the data index order of the target data to complete the data addition request to the target database.

8. A data sorting device, characterized in that, The device includes: A strategy module is used to determine a sorting strategy for a sorting request in response to a sorting request for any dimension column in a target database; the target database includes at least one target data and a data index that has a mapping relationship with the target data; the target data includes at least one dimension column; The sorting module is used to sort the data index of the corresponding target data in the target database according to the data content of the dimension column based on the sorting strategy, so as to obtain the index sorting result of the target data; In the index sorting results, each data index is a sorting result obtained by sorting according to the sorting request, and the sorting order of each target data has not changed.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.