Data sorting method and related device

By loading multidimensional data in the GPU and optimizing the sorting instructions with AlphaDev, the problem of slow data sorting speed in the prior art is solved, and more efficient data sorting and processing performance is achieved.

CN119807484APending Publication Date: 2025-04-11SHENZHEN FANGYU ZHIYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311304096.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing data sorting method is slow to execute in high-speed data transmission occasions, and it is difficult to meet the real-time requirements.

Method used

Load the multi-dimensional pending data to be sorted into the GPU, use the sorting resource optimization model in AlphaDev to predict the target thread, and start multiple target threads in the GPU to execute the optimization sorting instructions, split the data into an ordered short sequence, and finally merge it into an ordered long sequence.

Benefits of technology

Through GPU parallel processing and AlphaDev optimization instructions, the efficiency and performance of data sorting are significantly improved, especially in high-dimensional data processing scenarios for large utilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807484A_ABST
    Figure CN119807484A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data sorting method and a related device. The method comprises the following steps: loading to-be-sorted multi-dimensional to-be-processed data into a GPU (Graphic Processing Unit); predicting by adopting a sorting resource optimization model in AlphaDev to obtain a to-be-started target thread in the GPU; the target thread is determined by attribute information of the multi-dimensional data to be processed; starting a plurality of target threads in the GPU to execute the optimized sorting instruction so as to split the multi-dimensional to-be-processed data into a plurality of groups of ordered short sequences; the optimized sorting instruction at least comprises an exchange movement instruction and / or a copy movement instruction reconstructed based on AlphaDev; and combining the multiple groups of ordered short sequences to obtain an ordered long sequence corresponding to the multi-dimensional data to be processed. According to the method and the device, the AlphaDev is applied to the GPU, so that the optimization of the data sorting scene is realized, the data sets with different scales and different data distribution characteristics can be efficiently processed, particularly the high-dimensional data processing scene of a large-scale practical program, the performance of the data processing scene is greatly improved, and the data processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing. More specifically, the embodiments of the present application relate to a data sorting method and related devices. Background Art

[0002] In the field of data processing, data sorting is one of the basic problems. Data sorting is to arrange data in a certain order so as to find some data change characteristics or trends from the data sequence and find clues to solve the problem. In addition, data sorting can also facilitate other processing processes such as data query, error correction, and classification.

[0003] In the related art, data sorting generally adopts methods such as bubble sort, selection sort, quick sort, shell sort, etc. These existing sorting methods are slow to execute and are difficult to meet the real-time requirements in situations of high-speed data transmission such as compression and data processing.

[0004] In summary, there is an urgent need to provide a data sorting solution to solve the above-mentioned technical problems existing in related technologies. Summary of the invention

[0005] In this context, the embodiments of the present application hope to provide a data sorting method and related devices to achieve more efficient data sorting, which not only helps to improve data sorting efficiency, but also helps to comprehensively improve data processing performance.

[0006] In a first aspect of the embodiments of the present application, a data sorting method is provided, comprising:

[0007] Load the multidimensional data to be sorted into the GPU;

[0008] The sorting resource optimization model in AlphaDev is used to predict the target thread to be started in the GPU; the target thread is determined by the attribute information of the multi-dimensional data to be processed, and the attribute information includes at least one of the number of dimensions, the type of dimension, and the total amount of data;

[0009] Initiate multiple target threads in the GPU to execute optimized sorting instructions to split the multi-dimensional data to be processed into multiple groups of ordered short sequences; the optimized sorting instructions at least include: exchange move instructions and / or copy move instructions reconstructed based on AlphaDev;

[0010] Merge multiple groups of ordered short sequences to obtain the ordered long sequences corresponding to the multi-dimensional data to be processed.

[0011] In a second aspect of the embodiments of the present application, a data sorting device is provided, the device comprising:

[0012] An acquisition module, for acquiring, in response to an interactive instruction to a user interface, an original multidimensional data sorting resource to be processed; the original multidimensional data sorting resource includes a graphic object called by the interactive instruction, and the graphic object includes a picture object and / or a text object;

[0013] A construction module is used to construct a tree model corresponding to the original multidimensional data sorting resource; each node in the tree model corresponds to each graphic object in the original multidimensional data sorting resource, and the connection relationship between each node in the tree model is associated with the corresponding graphic object;

[0014] The generation module is used to generate a multidimensional data sorting bitmap based on the tree model, so as to display each graphic object in the user interface through the multidimensional data sorting bitmap.

[0015] In a third aspect of the embodiments of the present application, a computing device is provided, the computing device comprising:

[0016] at least one processor, memory, and input-output unit;

[0017] The memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the data sorting method of the first aspect.

[0018] In a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which includes instructions. When the instructions are executed on a computer, the computer executes the data sorting method of the first aspect.

[0019] In the implementation mode of the present application, a data sorting method and related device are provided. In the implementation mode of the present application, the multidimensional data to be sorted are loaded into the GPU; the sorting resource optimization model in AlphaDev is used to predict the target thread to be started in the GPU; the target thread is determined by the attribute information of the multidimensional data to be processed; multiple target threads are started in the GPU to execute the optimized sorting instruction to split the multidimensional data to be processed into multiple groups of ordered short sequences; the optimized sorting instruction at least includes: the exchange move instruction and / or the copy move instruction reconstructed based on AlphaDev; multiple groups of ordered short sequences are merged to obtain the ordered long sequence corresponding to the multidimensional data to be processed.

[0020] In the implementation mode of the present application, the data sorting scenario is optimized by applying AlphaDev to the GPU, so as to more efficiently process the sorting of data sets of different scales and different data distribution characteristics, especially the high-dimensional data processing scenarios of large-scale utilities, thereby greatly improving the performance of the data processing scenarios and improving data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become readily understood. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, wherein:

[0022] Figure 1 A flowchart of a data sorting method provided in one embodiment of the present application;

[0023] Figure 2 A schematic diagram of the principle of a data sorting method provided in one embodiment of the present application;

[0024] Figure 3 A schematic diagram of the principle of a data sorting method provided by another embodiment of the present application;

[0025] Figure 4 A schematic diagram of a data sorting scenario provided in an embodiment of the present application;

[0026] Figure 5 A schematic diagram of a training network provided in an embodiment of the present application;

[0027] Figure 6 A schematic diagram of a training scenario provided in an embodiment of the present application;

[0028] Figure 7 A schematic diagram of an original code example provided for an embodiment of the present application;

[0029] Figure 8 A schematic diagram of an optimized code example provided in an embodiment of the present application;

[0030] Fig. 9 A schematic diagram of a data sorting scenario provided by another embodiment of the present application;

[0031] Fig.10 A schematic diagram of the structure of a data sorting device provided in one embodiment of the present application;

[0032] Fig.11 A schematic diagram of the structure of a medium in an embodiment of the present application is schematically shown;

[0033] Fig.12 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown schematically.

[0034] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0035] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present application, and are not intended to limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0036] Those skilled in the art know that the embodiments of the present application can be implemented as a system, device, equipment, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0037] In the field of data processing, data sorting is one of the basic problems. Data sorting is to arrange data in a certain order so as to find some data change characteristics or trends from the data sequence and find clues to solve the problem. In addition, data sorting can also facilitate other processing processes such as data query, error correction, and classification.

[0038] In the related art, data sorting generally adopts methods such as bubble sort, selection sort, quick sort, shell sort, etc. These existing sorting methods are slow to execute and are difficult to meet the real-time requirements in situations of high-speed data transmission such as compression and data processing.

[0039] In summary, a new solution needs to be designed to solve the above technical problems.

[0040] As Google uses its own open source artificial intelligence tools (such as AlphaDev) in the main C++ library to design new sorting algorithms, algorithms designed through reinforcement learning are added to the C++ library for the first time, achieving a major leap in the computer field through artificial intelligence.

[0041] Currently, AlphaDev can be used to optimize and design the code in various program applications, breaking through the long-standing unupdated parts of the sorting library and greatly improving the performance of the application. However, in related technologies, the codes optimized and designed by AlphaDev are all programs running on the CPU, and there is currently no application of AlphaDev in GPU program computing scenarios.

[0042] In order to overcome the above-mentioned technical problems existing in the existing data sorting scheme and expand the application scenarios of AlphaDev, according to the implementation methods of the present application, a data sorting method and related devices are proposed. In the implementation methods of the present application, first, it is necessary to load the multidimensional data to be sorted into the GPU, so that the GPU can more efficiently call multiple threads for subsequent data processing processes. Then, the sorting resource optimization model in AlphaDev is used to predict the target thread to be started in the GPU. The sorting resource optimization model can comprehensively screen out the processing resources that match the current data to be processed, that is, the target thread, in combination with the attribute information of the multidimensional data to be processed, so that the processing resources and the data to be processed are more matched, and the overall data processing efficiency is further improved. Then, multiple target threads are started in the GPU to execute the optimized sorting instructions to split the multidimensional data to be processed into multiple groups of ordered short sequences. The optimized sorting instructions used here include at least: exchange move instructions and / or copy move instructions reconstructed based on AlphaDev. AlphaDev can optimize traditional GPU instructions, improve the computing performance of the instructions as a whole, and also help to improve the overall data processing efficiency. Finally, multiple groups of ordered short sequences are merged to obtain the ordered long sequences corresponding to the multi-dimensional data to be processed.

[0043] In the implementation of the present application, AlphaDev is applied to the data sorting scenario of the GPU, and the optimization of the data sorting scenario is achieved through the sorting resource optimization model and the reconstructed optimized sorting instructions. Compared with the data sorting method in the related art, the present application can allocate more matching processing resources (i.e., target threads) and corresponding processing methods (i.e., optimized sorting instructions) for data sets of different scales and different data distribution characteristics, thereby making the implementation process of sorting data sets of different scales and different data distribution characteristics more efficient, especially for high-dimensional data processing scenarios of large-scale utilities, greatly improving the performance of data processing scenarios and improving data processing efficiency.

[0044] The technical solution provided in the embodiments of the present application can be implemented by a server and / or a terminal device. It should be noted that the server involved in the embodiments of the present application can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, big data and artificial intelligence platforms.

[0045] The terminal device involved in the embodiments of the present application may be a device that provides voice and / or data connectivity to a user, a handheld device with a wireless connection function, or other processing devices connected to a wireless modem. For example, a mobile phone (or "cellular" phone) and a computer with a mobile terminal, for example, may be a portable, pocket-sized, handheld, computer-built-in or vehicle-mounted mobile device that exchanges voice and / or data with a wireless access network. For example, Personal Communication Service (PCS) phones, cordless phones, Session Initiation Protocol (SIP) phones, Wireless Local Loop (WLL) stations, Personal Digital Assistants (PDAs) and other devices.

[0046] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0047] The principles and spirit of the present application are explained in detail below with reference to several representative implementations of the present application.

[0048] Reference below Figure 1 , Figure 1 A data sorting method provided in an embodiment of the present application is provided by the present application, comprising:

[0049] Step S101, loading the multi-dimensional data to be sorted into the GPU.

[0050] In an embodiment of the present application, the multidimensional data that needs to be sorted is referred to as multidimensional data to be processed. It is understandable that the multidimensional data to be processed can come from the same data set or from different data sets. Different data sets can be stored in different storage spaces, for example, they can be data sets in different folders on a disk. For example, data sets of different dimensions are stored in 7 folders on a disk, including 1 dimension, 2 dimensions, 4 dimensions, 6 dimensions, 8 dimensions, 10 dimensions, and 11 dimensions. Each dimensional data set contains about one million elements. Alternatively, different data sets can also be data sets stored in different cloud nodes.

[0051] It is worth noting that the multidimensional data to be processed can come from data sets of multiple dimensions in the target scene, and the data set of each dimension stores the application data corresponding to each dimension in the target scene. In practical applications, the target scene can be various scenes based on cloud computing, such as online shopping scenes, supply chain management scenes such as product manufacturing and transportation. It can also be various data processing scenes, such as encrypted data processing, data transmission, data matrix calculation, etc. Of course, it can also be other scenes that are not limited in this application.

[0052] The data sets of multiple dimensions are related to the target scenario. In an optional example, it is assumed that the multi-dimensional data to be processed is personal credit score data, wherein the personal credit score data contains data of 11 dimensions. Optionally, a vector of the 11-dimensional data can also be obtained by performing a modulo operation on these data. An example of the specific process is as follows:

[0053] age gender marriage culture Household Residential unit industry Years job title income 3 2 4 4 2 5 3 8 8 4 12

[0054] The above table is a personal credit score table for a certain user, which contains 11 scoring items, that is, data of 11 dimensions. For example, by summing up each scoring item, the personal credit score of the user is obtained as follows: 3+2+4+4+2+5+3+8+8+4+12=55.

[0055] In another example, in a job evaluation ranking scenario, assume that a data set needs to be divided into five levels, where data items in the data set of the same level do not need to be sorted.

[0056] In the above scenario, it is necessary to score the user based on his / her performance in the following 10 work difficulty scoring indicators. Thus, a modulo operation is performed on the scoring item of each user, and the modulo operation result is compared with the pre-set 5 level intervals (0-20, 20-40, 40-60, 60-80, 80-100), and finally the level interval to which each user belongs is determined.

[0057] Each level range corresponds to a different level of work difficulty, such as (0-20, 20-40, 40-60, 60-80, 80-100). The five level ranges correspond to difficulty levels 1 to 5 from low to high. Suppose a user's scores are shown in the following table:

[0058]

[0059] Then, the sum of the user's scores is: 6+9+6+6+7+6.5+4+5+8+9=66.5. Based on this, the user's corresponding work score belongs to the level range of 60-80, and the work difficulty level is level 4.

[0060] In step S101, the multidimensional data to be processed is loaded into the GPU. Figure 2 As shown, the implementation is as follows:

[0061] S201, identifying attribute information of a data set to be sorted stored in a disk. The data to be sorted includes data to be processed in multiple dimensions stored in multiple disks.

[0062] S202: Load the to-be-sorted data set into a shared memory of a matching GPU according to at least one of the number of dimensions, storage path, and data volume.

[0063] Through steps S201 to S202, multi-dimensional data to be processed can be loaded into the GPU, thereby providing a basis for subsequent use of the GPU to process the data.

[0064] Compared with the data sorting method using CPU processing in the related art, GPU can open more threads. This is because, in terms of improving computing efficiency, the CPU usually focuses on how to reduce the delay problem of a single thread itself, while the GPU will make full use of bandwidth through multi-threaded concurrent processing, reduce overall delay, and offset bandwidth efficiency issues. Furthermore, the instruction operation of the GPU can be programmed and encapsulated by the function library of the graphics card computing platform (Compute Unified Device Architecture, CUDA). CUDA will use the parallel processing capabilities of the GPU to enable the GPU to have higher computing efficiency and throughput than the CPU. CUDA can also manage multiple GPUs, thereby achieving higher computing performance by increasing the number of GPUs, thereby meeting the parallel computing requirements of various application scenarios for different data sets. CUDA also provides a more advanced programming interface, so that the GPU can perform more complex parallel computing in various application scenarios. The specific application of CUDA can be found in the following embodiments, which will not be expanded here.

[0065] Step S102, using the sorting resource optimization model in the artificial intelligence system (AlphaDev) to predict the target thread to be started in the GPU.

[0066] In the embodiment of the present application, the target thread is determined by the attribute information of the multi-dimensional data to be processed. The attribute information of the multi-dimensional data to be processed includes at least one of: the number of dimensions, the type of dimension, and the total amount of data.

[0067] Among them, AlphaDev is an innovative intelligent algorithm tool, which is mainly used to use reinforcement learning to mine enhanced computer algorithms. AlphaDev has two core components: learning algorithm and representation function. Among them, the learning algorithm is mainly expanded on the powerful AlphaZero, and can be combined with deep reinforcement learning (DRL) and random search optimization algorithm to perform massive instruction searches to improve the efficiency of algorithm execution. The representation function is based on the attention mechanism sequence model (Transformer), which can be used to assemble the underlying structure of the program and express it as a special sequence. The advantage of AlphaDev lies in code assembly, which can be used to find missing parts in the code for optimization, as well as to balance the correctness and distribution of the hash algorithm.

[0068] Step S103, starting multiple target threads in the GPU to execute the optimized sorting instruction to split the multi-dimensional data to be processed into multiple groups of ordered short sequences.

[0069] Specifically, when GPU is used to perform sorting operations, the parallelization and vectorization characteristics of GPU operations in the process of high-dimensional data operation and processing are utilized. That is, more operation units and higher bandwidth are provided in the GPU to perform these parallel and vectorized operations, so various optimized instructions can be used to perform more optimized matrix operations on the multi-dimensional data to be processed. In other words, the same or similar operations can be performed on multiple data at the same time. Combining AlphaDev can further optimize the sorting function of the above instructions and the corresponding resource allocation.

[0070] In the embodiment of the present application, in order to improve the data sorting efficiency, multiple target threads can be used to perform preliminary sorting processing on the multi-dimensional data to be processed. Figure 3 As shown, an optional embodiment of step S103 can be implemented as the following steps:

[0071] Step S301 , starting multiple target threads through the CUDA interface, performing a modulo operation on the multi-dimensional data to be processed, and obtaining a data vector matrix corresponding to the multi-dimensional data to be processed.

[0072] The data vector matrix includes one-dimensional data vectors corresponding to each data to be processed.

[0073] Step S302 , using each target thread, executes an optimized sorting instruction on a unit number of one-dimensional data vectors in the data vector matrix to obtain multiple groups of ordered short sequences, so as to implement preliminary sorting processing.

[0074] The optimized sorting instruction is used to start the unit matrix operation. In the embodiment of the present application, the optimized sorting instruction at least includes: a swap move instruction and / or a copy move instruction reconstructed based on AlphaDev.

[0075] In practical applications, the optimized sorting instruction and the identity matrix operation initiated by the optimized sorting instruction are obtained by reconstructing the CUDA kernel function based on AlphaDev.

[0076] Specifically, the present invention proposes a sorting algorithm based on AlphaDev design, which is optimized on GPU instructions to design a more efficient sorting algorithm, the main contents of which include: instruction optimization, two key instructions - AlphaDevSwap Move, AlphaDev Copy Move; combined with the characteristics of GPU multi-thread concurrency, GPU multi-threading is used to find the modulus of each data vector, so that the data set to be sorted is converted into a one-dimensional data set to be sorted.

[0077] For example, assume that the data set to be sorted includes: (23, 36, 67, 68, 43), (34, 56, 6, 34, 55), (34, 5, 78, 121, 87).

[0078] For the above set, the GPU uses one thread to control the conversion process of a set of vectors, that is, three data to be sorted are taken as a group, and the groups are configured into the corresponding threads for vector set summation and simplification processing to obtain a one-dimensional data set to be sorted (237, 185, 325). Then, the GPU uses the data exchange instructions and copy instructions designed by AlphaDev to process the one-dimensional data set to be sorted (237, 185, 325) to obtain an ordered data set (185, 237, 325). The optimized sample code of the data exchange instructions and copy instructions in the above steps is as follows: Figure 8 shown.

[0079] In an optional implementation, the step of reconstructing the CUDA kernel function based on AlphaDev to obtain the optimized sorting instruction and the unit matrix operation initiated by the optimized sorting instruction can be implemented as follows:

[0080] The CUDA kernel function library is subjected to DRL and random search optimization processing to search for target instructions; the assembly program code of the target instruction is subjected to feature extraction through the Transformer layer to obtain a target feature sequence; the target feature sequence is trained into an optimized feature sequence through an optimization strategy network model; and the optimized sorting instruction and the unit matrix operation initiated by the optimized sorting instruction are constructed based on the optimized feature sequence.

[0081] The number of units is determined by the resource configuration information of the sorting resource optimization model. For example, the number of units can be set to 3. Figure 4 Taking the multi-thread sorting scenario shown as an example, from a microscopic point of view, each thread is responsible for sorting three data, and obtains multiple groups of ordered short sequences to achieve preliminary sorting processing. That is, thread 1 is responsible for sorting three data identified as 24, 123, and 14, and thread 2 is responsible for sorting three data identified as 13, 12, and 235.

[0082] After step S103, the state value function after executing the optimization sorting instruction and / or the performance evaluation parameter obtained based on the execution result of the optimization sorting instruction are obtained. Then, the state value function value and / or the performance evaluation parameter are feedback-adjusted through the policy network model so that the state value function value is close to the preset improvement target value.

[0083] In the embodiment of the present application, AlphaDev is used to optimize the operation instructions of the GPU in the underlying architecture, thereby further optimizing the multi-dimensional data sorting process executed in the upper architecture, improving the performance of the data sorting algorithm, and realizing an intelligent screening and sorting method for multi-dimensional data features. In order to achieve the above technical effects, in the embodiment of the present application, the instruction search reinforcement learning method is also used to achieve the alchemy technical effect. Among them, reinforcement learning is mainly aimed at the policy network, which can be implemented as follows Figure 5 In the network model shown in Figure 1, we assume that the state value function is:

[0084] V π (s t )=E A [Q π (s t , A)]=Σπ(a|s t )·Q π (s t , a)

[0085] Among them, Vπ(st) represents the state value function, that is, the value of executing action A using the policy π function in state st. EA is the expectation of the value obtained under all actions in the state. Further, optionally, a neural network can be used to implement the policy network π(a|s;θ), so as to simulate and approximate π(a|st), so the state value function is expressed as follows:

[0086] V(s t ;θ)=∑π(a|s t ;θ)Q π (s t , a)

[0087] Assuming the state is S, the better the policy network is, the larger the V value is. By improving the parameter θ, V(s;θ) can be made larger. Based on the above idea, the objective function can be defined as V(s t ; θ) expectation: J(θ)=Es[V(s t ; θ)]. Here, the expectation is related to the state S, and the goal is to improve θ so that the larger J(θ), the better the performance.

[0088] In an alternative example, AlphaDev in training is used in the production algorithm as follows Figure 6 As shown in the figure: In process A, the input is the vectorization of the current program state St, which is input into the AlphaDev neural network for matrix operations, and the output is the vectorized instruction, so the instruction is regarded as the algorithm (denoted as Algorithm) under the state at time t. Then, in process B, the random numbers to be sorted are used as input to the algorithm (denoted as Algorithm) produced by AlphaDev in process A to obtain the sorting result, which is used for the correct sorting comparison to obtain the accuracy rate as the reward score R t Based on the mechanism that the higher the score, the better, the back propagation principle is used to modify the parameters of the AlphaDev neural network and continuously iterate to a higher score R t (This value has no upper limit). Thus, through the above training of AlphaDev, Figure 7 The original CUDA sort operation code example shown is optimized to Figure 8 The optimized CUDA operation code example is shown.

[0089] Step S104: merging multiple groups of ordered short sequences to obtain ordered long sequences corresponding to the multi-dimensional data to be processed.

[0090] In an optional embodiment, a merge sort method can be used to merge multiple groups of ordered short sequences. Specifically, multiple target threads are paired in pairs; the paired multiple groups of ordered short sequences are reorganized so that a group of ordered short sequences with larger element values ​​pointed to by the start position pointer in each pair is arranged after another group of ordered short sequences to obtain multiple groups of intermediate sequences; the multiple groups of intermediate sequences are paired again in pairs, and the reorganization step is performed until the multiple groups of ordered short sequences are merged into one group of ordered long sequences.

[0091] by Fig. 9 Taking another multi-threaded sorting scenario shown as an example, from a macro perspective, after preliminary sorting processing from a micro perspective, assuming that 128 groups of ordered short sequences are obtained, then we can further utilize the advantages of GPU multi-threading, set each thread to be responsible for a group of sequences, and use the merge sort method to pair multiple groups of ordered short sequences in pairs and merge them into the final ordered sequence.

[0092] In the embodiment of the present application, in order to improve the utilization efficiency of processing resources (i.e., target threads), further optionally, after obtaining multiple sets of intermediate sequences, the target threads that are not occupied after the reorganization and sorting in the GPU are released according to the multiple sets of intermediate sequences obtained by reorganization. For example, the target threads are released after the matrix operation is completed, or some of the merged target threads are released.

[0093] Further optionally, after step S104, the ordered long sequence corresponding to the multi-dimensional data to be processed is stored in the global memory through CUDA.

[0094] In the implementation of the present application, through the above steps S101 to S104, AlphaDev is applied to the data sorting scenario of the GPU, and the optimization of the data sorting scenario is achieved through the sorting resource optimization model and the reconstructed optimized sorting instructions. Compared with the data sorting method in the related art, the present application can allocate more matching processing resources (i.e., target threads) and corresponding processing methods (i.e., optimized sorting instructions) for data sets of different scales and different data distribution characteristics, thereby making the implementation process of sorting data sets of different scales and different data distribution characteristics more efficient, especially in the high-dimensional data processing scenario of large-scale utilities, greatly improving the performance of the data processing scenario and improving data processing efficiency.

[0095] After introducing the method of the exemplary embodiment of the present application, next, refer to Fig.10 A data sorting device according to an exemplary embodiment of the present application is described. The data sorting device may be provided in a data sorting device, and the device includes:

[0096] A loading module 1001 is used to load the multi-dimensional data to be sorted and processed into the GPU;

[0097] Prediction module 1002, used to predict a target thread to be started in the GPU using the sorting resource optimization model in AlphaDev; the target thread is determined by the attribute information of the multi-dimensional data to be processed;

[0098] The first sorting module 1003 is used to start multiple target threads in the GPU to execute optimized sorting instructions to split the multi-dimensional data to be processed into multiple groups of ordered short sequences; the optimized sorting instructions at least include: exchange move instructions and / or copy move instructions reconstructed based on AlphaDev;

[0099] The second sorting module 1004 is used to merge multiple groups of ordered short sequences to obtain an ordered long sequence corresponding to the multi-dimensional data to be processed.

[0100] As an optional implementation manner, the first sorting module 1003 is specifically configured to:

[0101] Start multiple target threads through the CUDA interface, perform a modulus operation on the multi-dimensional data to be processed, and obtain a data vector matrix corresponding to the multi-dimensional data to be processed; the data vector matrix includes a one-dimensional data vector corresponding to each data to be processed;

[0102] Using each target thread, executing an optimized sorting instruction on a unit number of one-dimensional data vectors in the data vector matrix to obtain a plurality of groups of ordered short sequences, so as to implement a preliminary sorting process;

[0103] Among them, the optimized sorting instruction is used to start the unit matrix operation; the optimized sorting instruction includes at least an exchange move instruction and / or a copy move instruction; the optimized sorting instruction and the unit matrix operation started by the optimized sorting instruction are obtained based on the reconstruction of the CUDA kernel function by AlphaDev; the number of units is determined by the resource configuration information of the sorting resource optimization model.

[0104] As an optional implementation, when the first sorting module 1003 reconstructs the CUDA kernel function based on AlphaDev to obtain the optimized sorting instruction and the unit matrix operation started by the optimized sorting instruction, it is specifically used to:

[0105] Perform deep reinforcement learning (DRL) and random search optimization on the CUDA kernel library to search for target instructions;

[0106] Extract features from the assembly program code of the target instruction through the Transformer layer to obtain the target feature sequence;

[0107] The target feature sequence is trained into an optimized feature sequence through an optimization strategy network model;

[0108] The optimization sorting instruction and the identity matrix operation initiated by the optimization sorting instruction are constructed based on the optimization feature sequence.

[0109] As an optional implementation, the device further includes an evaluation module, which is used for the first sorting module 1003 to start multiple target threads in the GPU to execute the optimization sorting instruction, so as to split the multi-dimensional data to be processed into multiple groups of ordered short sequences, and then obtain the state value function after executing the optimization sorting instruction, and / or the performance evaluation parameter obtained based on the execution result of the optimization sorting instruction;

[0110] The state value function value and / or performance evaluation parameters are feedback-adjusted through the policy network model so that the state value function value approaches the preset improvement target value.

[0111] As an optional implementation manner, the second sorting module 1004 is specifically configured to:

[0112] Pair multiple target threads in pairs;

[0113] Reorganize the multiple groups of ordered short sequences after pairing so that the group of ordered short sequences with larger element values ​​pointed to by the starting position pointer in each pairing is arranged after the other group of ordered short sequences, thereby obtaining multiple groups of intermediate sequences;

[0114] The multiple groups of intermediate sequences are re-paired in pairs and a recombination step is performed until the multiple groups of ordered short sequences are merged into one group of ordered long sequences.

[0115] As an optional embodiment, the device also includes a reallocation module, which is used to reorganize the multiple groups of ordered short sequences after pairing in the second sorting module 1004, so that a group of ordered short sequences with larger element values ​​pointed to by the starting position pointer in each pairing is arranged after another group of ordered short sequences, and after obtaining multiple groups of intermediate sequences, release the target threads that are not occupied after the reorganization and sorting in the GPU according to the multiple groups of intermediate sequences obtained by the reorganization.

[0116] As an optional implementation, the device also includes a storage module, which is used to merge multiple groups of ordered short sequences in the second sorting module 1004 to obtain the ordered long sequence corresponding to the multidimensional data to be processed, and then store the ordered long sequence corresponding to the multidimensional data to be processed in the global memory through CUDA.

[0117] As an optional implementation, the loading module 1001 is specifically used for:

[0118] Identify attribute information of a data set to be sorted stored in a disk; the data to be sorted includes data to be processed in multiple dimensions stored in multiple disks;

[0119] The data set to be sorted is loaded into the shared memory of the matching GPU according to at least one of the number of dimensions, the storage path, and the data volume.

[0120] In the embodiment of the present application, AlphaDev is applied to the data sorting scenario of the GPU through the data sorting device, and the optimization of the data sorting scenario is achieved through the sorting resource optimization model and the reconstructed optimized sorting instructions. Compared with the data sorting method in the related art, the present application can allocate more matching processing resources (i.e., target threads) and corresponding processing methods (i.e., optimized sorting instructions) for data sets of different scales and different data distribution characteristics, thereby making the implementation process of sorting data sets of different scales and different data distribution characteristics more efficient, especially for high-dimensional data processing scenarios of large-scale utilities, greatly improving the performance of data processing scenarios and improving data processing efficiency.

[0121] After introducing the devices, methods and apparatus of the exemplary embodiments of the present application, next, reference is made to Fig.11 The computer-readable storage medium of the exemplary embodiment of the present application is described. The computer-readable storage medium can be set in the data sorting device. Please refer to Fig.11 , the computer-readable storage medium shown is a CD 110, on which a computer program (i.e., a program product) is stored. When the computer program is executed by the processor, it will implement the steps recorded in the above method implementation, for example, loading the multidimensional data to be sorted into the GPU; using the sorting resource optimization model in AlphaDev to predict the target thread to be started in the GPU; the target thread is determined by the attribute information of the multidimensional data to be processed; starting multiple target threads in the GPU to execute optimized sorting instructions to split the multidimensional data to be processed into multiple groups of ordered short sequences; the optimized sorting instructions at least include: exchange move instructions and / or copy move instructions reconstructed based on AlphaDev; merging multiple groups of ordered short sequences to obtain ordered long sequences corresponding to the multidimensional data to be processed; the specific implementation method of each step will not be repeated here.

[0122] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.

[0123] After introducing the devices, methods, media and apparatus of the exemplary embodiments of the present application, reference is now made to Fig.12 For the computing device for data sorting according to the exemplary embodiment of the present application, the computing device may be arranged in a data sorting device.

[0124] Fig.12 A block diagram of an exemplary computing device 120 suitable for implementing embodiments of the present application is shown. The computing device 120 may be a computer system or a server. Fig.12 The computing device 120 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0125] like Fig.12 As shown, the components of computing device 120 may include, but are not limited to: one or more processors or processing units 1201, a system memory 1202, and a bus 1203 connecting different system components (including system memory 1202 and processing unit 1201).

[0126] The computing device 120 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computing device 120, including volatile and nonvolatile media, removable and non-removable media.

[0127] System memory 1202 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 12021 and / or cache memory 12022. Computing device 120 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, ROM 12023 may be used to read and write non-removable, non-volatile magnetic media ( Fig.12 is not shown in the Fig.12 As shown in FIG. 1 , a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) can be provided. In these cases, each drive can be connected to bus 1203 via one or more data medium interfaces. System memory 1202 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of each embodiment of the present application.

[0128] A program / utility 12025 having a set (at least one) of program modules 12024 may be stored, for example, in system memory 1202, and such program modules 12024 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 12024 generally perform the functions and / or methods of the embodiments described herein.

[0129] The computing device 120 may also communicate with one or more external devices 1204 (e.g., a keyboard, a pointing device, a display, etc.). Such communication may be performed via an input / output (I / O) interface 605. In addition, the computing device 120 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1206. Fig.12 As shown, the network adapter 1206 communicates with other modules (such as the processing unit 1201, etc.) of the computing device 120 via the bus 1203. It should be understood that although Fig.12 Not shown, other hardware and / or software modules may be used in conjunction with computing device 120 .

[0130] The processing unit 1201 executes various functional applications and data processing by running the program stored in the system memory 1202, for example, loading the multidimensional data to be sorted into the GPU; using the sorting resource optimization model in AlphaDev to predict the target thread to be started in the GPU; the target thread is determined by the attribute information of the multidimensional data to be processed; starting multiple target threads in the GPU to execute the optimized sorting instruction to split the multidimensional data to be processed into multiple groups of ordered short sequences; the optimized sorting instruction at least includes: the exchange move instruction and / or the copy move instruction reconstructed based on AlphaDev; merging multiple groups of ordered short sequences to obtain the ordered long sequence corresponding to the multidimensional data to be processed. The specific implementation method of each step is not repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the data sorting device are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the implementation of the present application, the features and functions of two or more units / modules described above can be concretized in one unit / module. On the contrary, the features and functions of one unit / module described above may be further divided into multiple units / modules to be embodied.

[0131] In the description of the present application, it should be noted that the terms "first", "second" and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0132] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0133] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0136] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0137] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

[0138] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

Claims

1. A data sorting method, characterized in that: The method comprises: Loading the multidimensional data to be sorted into the graphics processing unit GPU; The sorting resource optimization model in the artificial intelligence system AlphaDev is used to predict the target thread to be started in the GPU; the target thread is determined by the attribute information of the multi-dimensional data to be processed; Initiate multiple target threads in the GPU to execute optimized sorting instructions to split the multi-dimensional data to be processed into multiple groups of ordered short sequences; the optimized sorting instructions at least include: exchange move instructions and / or copy move instructions reconstructed based on AlphaDev; Multiple groups of ordered short sequences are merged to obtain ordered long sequences corresponding to the multi-dimensional data to be processed.

2. The data sorting method according to claim 1, characterized in that: The step of starting multiple target threads in the GPU to execute the optimized sorting instruction to split the multi-dimensional data to be processed into multiple groups of ordered short sequences includes: Start multiple target threads through the CUDA interface of the graphics card computing platform, perform a modulus operation on the multi-dimensional data to be processed, and obtain a data vector matrix corresponding to the multi-dimensional data to be processed; the data vector matrix includes a one-dimensional data vector corresponding to each data to be processed; Using each target thread, executing an optimized sorting instruction on a unit number of one-dimensional data vectors in the data vector matrix to obtain a plurality of groups of ordered short sequences, so as to implement a preliminary sorting process; Among them, the optimized sorting instruction is used to start the unit matrix operation; the optimized sorting instruction and the unit matrix operation started by the optimized sorting instruction are based on the reconstruction of the CUDA kernel function by AlphaDev; the number of units is determined by the resource configuration information of the sorting resource optimization model.

3. The data sorting method according to claim 2, characterized in that: The step of reconstructing the CUDA kernel function based on AlphaDev to obtain the optimized sorting instruction and the unit matrix operation initiated by the optimized sorting instruction includes: Perform deep reinforcement learning (DRL) and random search optimization on the CUDA kernel library to search for target instructions; The assembly program code of the target instruction is extracted through the attention mechanism Transformer layer to obtain the target feature sequence; The target feature sequence is trained into an optimized feature sequence through an optimization strategy network model; The optimization sorting instruction and the identity matrix operation initiated by the optimization sorting instruction are constructed based on the optimization feature sequence.

4. The data sorting method according to claim 3, characterized in that: After starting multiple target threads in the GPU to execute the optimized sorting instruction to split the multi-dimensional data to be processed into multiple groups of ordered short sequences, the method further includes: Obtaining a state value function after executing the optimization sorting instruction, and / or a performance evaluation parameter obtained based on the execution result of the optimization sorting instruction; The state value function value and / or performance evaluation parameters are feedback-adjusted through the policy network model so that the state value function value approaches the preset improvement target value.

5. The data sorting method according to claim 2, characterized in that: The merging of multiple groups of ordered short sequences to obtain an ordered long sequence corresponding to the multi-dimensional data to be processed includes: Pair multiple target threads in pairs; Recombining the multiple groups of ordered short sequences after pairing so that a group of ordered short sequences with a larger element value pointed to by the start position pointer in each pairing is arranged after another group of ordered short sequences, thereby obtaining multiple groups of intermediate sequences; The multiple groups of intermediate sequences are re-paired in pairs and a recombination step is performed until the multiple groups of ordered short sequences are merged into one group of ordered long sequences.

6. The data sorting method according to claim 5, characterized in that: After the multiple groups of ordered short sequences after the reorganization pairing are completed, so that the group of ordered short sequences with larger element values ​​pointed to by the starting position pointer in each pairing is arranged after another group of ordered short sequences, and multiple groups of intermediate sequences are obtained, the method further comprises: According to the multiple groups of intermediate sequences obtained by reorganization, the target threads that are not occupied after the reorganization and sorting in the GPU are released.

7. The data sorting method according to claim 1, characterized in that: After merging the multiple groups of ordered short sequences to obtain the ordered long sequence corresponding to the multi-dimensional data to be processed, the method further includes: The ordered long sequence corresponding to the multi-dimensional data to be processed is stored in the global memory through CUDA.

8. A data sorting device, characterized in that: The device comprises: A loading module is used to load the multi-dimensional data to be sorted into the GPU; A prediction module, used to predict a target thread to be started in the GPU using a sorting resource optimization model in AlphaDev; the target thread is determined by attribute information of the multi-dimensional data to be processed; A first sorting module is used to start multiple target threads in the GPU to execute optimized sorting instructions to split the multi-dimensional data to be processed into multiple groups of ordered short sequences; the optimized sorting instructions at least include: exchange move instructions and / or copy move instructions reconstructed based on AlphaDev; The second sorting module is used to merge multiple groups of ordered short sequences to obtain an ordered long sequence corresponding to the multi-dimensional data to be processed.

9. A computing device, characterized in that The computing device comprises: at least one processor, memory, and input-output unit; The memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the data sorting method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computer, enable the computer to execute the data sorting method according to any one of claims 1 to 7.