A data processing method, device, medium and computing equipment

By dynamically allocating the cache space of each bucket on the classification chip, according to the classification category and data size of the data to be processed, the problem of excessive storage space occupation and resource waste in the existing technology is solved, and the utilization efficiency of the storage space is improved.

CN118331748BActive Publication Date: 2024-09-27ZHONGHAO XINYING (HANGZHOU) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410753789.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-09-27
Estimated Expiration
2044-06-12

AI Technical Summary

Technical Problem

The existing classification method using external storage space leads to the problem of excessive storage space and waste of resources. Especially when a fixed size cache space is pre-allocated on the classification chip, the data required for each classification cannot be effectively utilized. Waste of storage space caused by different sizes.

Method used

By obtaining the bucketing information of the data to be processed, the cache space required for each bucket is dynamically determined, and a cache space of corresponding size is allocated on the preset memory. The cache space is dynamically allocated according to the classification category and data size of the data to be processed, which avoids Fixed size storage space allocation.

Benefits of technology

It effectively avoids the occupation of storage space and waste of resources, avoids the increase in the size of classification chips, and improves the utilization efficiency of storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331748B
    Figure CN118331748B
Patent Text Reader

Abstract

The present application discloses a data processing method, device, medium and computing equipment, which relate to the field of data processing. The method includes: obtaining bucket information of data to be processed, the bucket information includes the number of buckets of the data to be processed and the cache space required for each bucket; based on the size of the cache space required for each bucket, allocating a corresponding size of cache space to each bucket from a preset memory; based on the cache space allocated to each bucket, distributing multiple load data. When classifying the data to be processed, the present application determines the number of buckets according to the target number of classifications, and then allocates corresponding cache space to each bucket from a preset memory. Compared with the prior art method of setting additional storage space on the chip when the chip leaves the factory, and allocating a fixed size of cache space to each bucket when leaving the factory, the present application can avoid the occupation and waste of storage space, and can also avoid increasing the size of the classification chip.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a data processing method, medium and computing device. Background Art

[0002] In the process of model training, buckets on classification chips (such as tensor processing unit, abbreviated as TPU) are often used to classify training data. The more buckets there are on the classification chip, the faster the classification speed. When faced with a large amount of data, the storage space of the classification chip itself cannot accommodate all the classification and sorting records, so external storage space is often used for classification.

[0003] At present, in the classification method using external storage space, additional storage space is often added to the classification chip when it leaves the factory, and a fixed cache space is pre-allocated for each bucket. However, in order to increase the classification speed, more buckets are often set on the classification chip. Therefore, the storage space pre-allocated for each bucket of the classification chip when it leaves the factory will occupy a large amount of storage space, and the additional large storage space on the classification chip will also increase the size of the classification chip; in addition, the size of the data to be classified each time is different, and each bucket of the classification chip is not required to be used in full each time classification, so the storage space pre-allocated for each bucket cannot be used, which will cause a waste of storage space resources. Summary of the invention

[0004] The main purpose of this application is to propose a data processing method, device, medium and computing equipment, aiming to solve the problems of storage space occupation and resource waste caused by the current classification method using external storage space.

[0005] To achieve the above objectives, the present application proposes a data processing method, comprising:

[0006] Obtaining bucket information of the data to be processed, the bucket information including the number of buckets of the data to be processed and the cache space required for each bucket, the data to be processed including multiple load data, and any load data corresponds to a target bucket;

[0007] Based on the size of the cache space required by each bucket, a cache space of a corresponding size is allocated to each bucket from a preset memory;

[0008] The multiple load data are distributed based on the cache space allocated to each bucket.

[0009] In the embodiment of the present application, the bucket information is determined based on the following method:

[0010] Obtaining classification instructions for the data to be processed;

[0011] Parsing the classification instruction to determine the target number of classification categories of the data to be processed and the data size of the data to be processed;

[0012] The target number of classification categories of the data to be processed is used as the number of buckets;

[0013] Based on the data size of the data to be processed and the number of buckets, the cache space required for each bucket is determined.

[0014] In the embodiment of the present application, allocating a cache space of a corresponding size to each bucket from a preset memory based on the size of the cache space required by each bucket includes:

[0015] Determine the starting address of the available storage space from the preset memory;

[0016] Using the starting address of the available storage space as the starting cache address corresponding to the bucket in the first order in the required buckets;

[0017] Based on the starting cache address corresponding to the bucket of this sequence and the cache space size corresponding to the bucket of this sequence, the ending cache address corresponding to the bucket of this sequence is determined, and the ending cache address corresponding to the bucket of the previous sequence is used as the starting cache address corresponding to the bucket of the next sequence.

[0018] In the embodiment of the present application, classifying the plurality of load data based on the cache space allocated to each bucket includes:

[0019] Reading any one of the plurality of load data as the load data to be classified;

[0020] Determining a target bucket corresponding to the load data to be classified based on the word element in the load data to be classified;

[0021] The load data to be classified is written into the cache space corresponding to the target bucket.

[0022] In the embodiment of the present application, before writing the load data to be classified into the cache space corresponding to the target bucket, the data processing method further includes:

[0023] Determine a current write-back address of a target bucket corresponding to the payload data to be classified.

[0024] In the embodiment of the present application, after writing the load data to be classified into the cache space corresponding to the target bucket, the data processing method further includes:

[0025] Based on the current write-back address of the target bucket and the data size of the currently written payload data, the current write-back address of the target bucket is updated.

[0026] In an embodiment of the present application, the data processing method further includes using a starting cache address corresponding to any bucket as a current write-back address when the load data is first written into the bucket.

[0027] In the embodiment of the present application, after writing the load data to be classified into the cache space corresponding to the target bucket, the data processing method further includes:

[0028] Determining whether all of the plurality of load data have been classified;

[0029] If not, continue reading the load data to be classified;

[0030] If so, determine the number of payload data written in the cache space corresponding to each bucket, and generate a data header for each payload data in the cache space corresponding to each bucket, the data header at least including the number of payload data in the corresponding cache space.

[0031] The present application also provides a data processing device, including:

[0032] An acquisition module, the acquisition module is used to acquire bucket information of the data to be processed, the bucket information includes the number of buckets of the data to be processed and the cache space required for each bucket, the data to be processed includes multiple load data, and any load data corresponds to a target bucket;

[0033] A processing module, the processing module is used to allocate a corresponding size of cache space to each bucket from a preset memory based on the size of the cache space required by each bucket;

[0034] The multiple load data are distributed based on the cache space allocated to each bucket.

[0035] In the embodiment of the present application, the processing module is also used for:

[0036] Obtaining classification instructions for the data to be processed;

[0037] Parsing the classification instruction to determine the target number of classification categories of the data to be processed and the data size of the data to be processed;

[0038] The target number of classification categories of the data to be processed is used as the number of buckets;

[0039] Based on the data size of the data to be processed and the number of buckets, the cache space required for each bucket is determined.

[0040] In the embodiment of the present application, the processing module is also used for:

[0041] Determine the starting address of the available storage space from the preset memory;

[0042] Using the starting address of the available storage space as the starting cache address corresponding to the bucket in the first order in the required buckets;

[0043] Based on the starting cache address corresponding to the bucket of this sequence and the cache space size corresponding to the bucket of this sequence, the ending cache address corresponding to the bucket of this sequence is determined, and the ending cache address corresponding to the bucket of the previous sequence is used as the starting cache address corresponding to the bucket of the next sequence.

[0044] In the embodiment of the present application, the processing module is also used for:

[0045] Reading any one of the plurality of load data as the load data to be classified;

[0046] Determining a target bucket corresponding to the load data to be classified based on the word element in the load data to be classified;

[0047] The load data to be classified is written into the cache space corresponding to the target bucket.

[0048] In the embodiment of the present application, before writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further used to:

[0049] Determine a current write-back address of a target bucket corresponding to the payload data to be classified.

[0050] In the embodiment of the present application, after writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further used to:

[0051] Based on the current write-back address of the target bucket and the data size of the currently written payload data, the current write-back address of the target bucket is updated.

[0052] In an embodiment of the present application, the processing module is further used to: use the starting cache address corresponding to any bucket as the current write-back address when the load data is written to the bucket for the first time.

[0053] In the embodiment of the present application, after writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further used to:

[0054] Determining whether all of the plurality of load data have been classified;

[0055] If not, continue reading the load data to be classified;

[0056] If so, determine the number of payload data written in the cache space corresponding to each bucket, and generate a data header for each payload data in the cache space corresponding to each bucket, the data header at least including the number of payload data in the corresponding cache space.

[0057] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements any of the above-described methods when executed by a processor.

[0058] An embodiment of the present application further provides a computing device, the computing device comprising a processor, the processor being configured to implement any of the above-described methods when executing a computer program stored in a memory.

[0059] In the embodiment of the present application, each time the data to be processed is classified, the number of buckets is determined according to the target number of classification categories of the data to be processed, and then the corresponding cache space is allocated to each bucket from the preset memory. Compared with the method in the prior art of setting additional storage space on the classification chip when the classification chip leaves the factory, and allocating a fixed size of cache space to each bucket when it leaves the factory, the method of the present application can avoid the occupation of storage space and waste of resources, and can also avoid increasing the size of the classification chip. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.

[0061] Figure 1 A step diagram of a data processing method in an embodiment of the present application;

[0062] Figure 2 A flowchart of a data processing method in an embodiment of the present application;

[0063] Figure 3 A module diagram of a data processing device in an embodiment of the present application;

[0064] Figure 4 A module diagram of a computer-readable storage medium in an embodiment of the present application;

[0065] Figure 5 A module diagram of a computing device in one embodiment of the present application.

[0066] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0067] 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.

[0068] Those skilled in the art know that the embodiments of the present application can be implemented as a system, device, 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.

[0069] According to the implementation manner of the present application, a data processing method, apparatus, medium and computing device are proposed.

[0070] 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.

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

[0072] Exemplary Methods

[0073] like Figure 1 As shown, the embodiment of the present application proposes a data processing method, comprising the following steps S100-S300:

[0074] Step S100: Obtain bucket information of the data to be processed, wherein the bucket information includes the number of buckets of the data to be processed and the cache space required for each bucket. The data to be processed includes multiple load data, and any load data corresponds to a target bucket.

[0075] In an embodiment of the present application, the data to be processed includes a data header and multiple load data, wherein the load data is the core data of the data to be processed, which is the actual data when the data to be processed is transmitted, and the data header includes the number information of the load data. Classifying the data to be processed is to classify each load data.

[0076] In the embodiment of the present application, the bucket information of the data to be processed can be determined based on the following steps S110-S140:

[0077] Step S110: Obtain classification instructions for the data to be processed.

[0078] In the embodiment of the present application, the data to be processed can generally be classified based on a data classification chip, and the data classification chip is, for example, a tensor processing unit, abbreviated as TPU. In the embodiment of the present application, taking the data classification chip as a TPU classification chip as an example, the classification instruction can be sent by the user, and the classification instruction refers to an instruction for the user to classify the data to be processed.

[0079] Step S120: parsing the classification instruction to determine the target number of classification categories of the data to be processed and the data size of the data to be processed.

[0080] In the embodiment of the present application, the data to be processed is pre-stored in the memory, and the classification instruction includes the storage location of the data to be processed, the data size, and the information of the number of categories into which the user wishes to classify the data to be processed. For example, the user wishes to classify the data to be processed into 3 categories, or wishes to classify the data to be processed into 5 categories. Therefore, in the embodiment of the present application, by parsing the classification instruction, the storage location of the data to be processed, the data size, and the information of the number of categories into which the user wishes to classify the data to be processed can be determined.

[0081] Step S130: taking the target number of the classification categories of the data to be processed as the number of buckets.

[0082] In the embodiment of the present application, after parsing the classification instruction to obtain the number of categories into which the user wants to classify the data to be processed (i.e., the target number of categories of the data to be processed), the target number of categories of the data to be processed can be used as the number of buckets. For example, if the target number of categories is 10, it means that the user wants to classify the data to be processed into 10 categories, and the number of buckets required is 10, i.e., the number of buckets is 10.

[0083] Step S140: Based on the data size of the data to be processed and the number of buckets, determine the cache space required for each bucket.

[0084] In the embodiment of the present application, after determining the data size of the data to be processed and the target number of classification categories, the cache space corresponding to each bucket can be determined based on experience. The cache space corresponding to each bucket is used to cache the load data corresponding to each category. When the target number of classification categories is large, the cache space corresponding to each bucket is correspondingly small. When the target number of classification categories is small, the cache space corresponding to each bucket is correspondingly large. The specific setting can be based on experience.

[0085] Step S200: Based on the size of the cache space required by each bucket, a cache space of a corresponding size is allocated to each bucket from a preset memory.

[0086] In the embodiment of the present application, a cache space of a corresponding size may be allocated to each bucket through the following steps S210-S230:

[0087] Step S210: determining the starting address of the available storage space from the preset memory.

[0088] In an embodiment of the present application, the preset memory may be the storage space of the classification chip itself, or may be other storage devices outside the classification chip. For example, when the amount of data to be processed is small, the storage space of the classification chip itself is sufficient to cache all the sorting records of the data to be processed. At this time, the starting address of the available storage space can be directly determined in the storage space of the classification chip itself. If the amount of data to be processed is large, the storage space of the classification chip itself is insufficient to cache all the sorting records of the data to be processed. At this time, the sorting records of the data to be processed can be cached to other memories outside the classification chip, that is, the starting address of the available storage space is determined on other memories outside the classification chip. Among them, the sorting record refers to the cached data of each load data in the data to be processed when the data to be processed is classified, as well as the cached data that is inevitably generated during the classification process.

[0089] In addition, other memories outside the classification chip do not have to be set on the classification chip when it leaves the factory, but any storage device that can communicate with the classification chip can be used. Compared with the prior art, the memory is already set on the classification chip when the classification chip leaves the factory, and the preset memory mentioned in the present application does not need to be set on the classification chip when the classification chip leaves the factory, but any memory that can communicate with it independently of the classification chip can be used, so the size of the classification chip will not be increased. In addition, since the data processing method in the embodiment of the present application can utilize an external memory that communicates with the classification chip, there is no restriction on the data size of the processed data to be processed.

[0090] Step S220: using the starting address of the available storage space as the starting cache address corresponding to the bucket in the first order in the required buckets.

[0091] In an embodiment of the present application, the starting cache address corresponding to the first-ranked bucket is first determined. In step S210, the starting address of the available storage space in the classification chip itself or in the memory outside the classification chip is determined. In step S220, the starting address can be used as the starting cache address corresponding to the first-ranked bucket.

[0092] Step S230: Based on the starting cache address corresponding to the bucket of this order and the cache space size corresponding to the bucket of this order, determine the ending cache address corresponding to the bucket of this order, and use the ending cache address corresponding to the bucket of the previous order as the starting cache address corresponding to the bucket of the next order.

[0093] In step S230, the end cache address corresponding to the first-ranked bucket is first determined. In step S140, the cache space corresponding to each bucket is determined. Based on the start cache address of the first-ranked bucket determined in step S220, the cache space corresponding to the first-ranked bucket is added on this basis to obtain the end cache address of the first-ranked bucket. After the end cache address corresponding to the first-ranked bucket is determined, the start cache address and end cache address corresponding to each other bucket can be determined according to the cache space corresponding to each other bucket.

[0094] For example, after determining the end cache address of the bucket with the first priority, the end cache address of the bucket with the first priority is used as the start cache address of the bucket with the second priority, and on this basis, the cache space corresponding to the bucket with the second priority is increased to obtain the end cache address corresponding to the bucket with the second priority. Then, the end cache address of the bucket with the second priority is used as the start cache address of the bucket with the third priority, and on this basis, the cache space corresponding to the bucket with the third priority is increased to obtain the end cache address corresponding to the bucket with the third priority. By analogy, the end cache address of the bucket with the previous priority is used as the start cache address of the bucket with the next priority, and the cache space of the next priority is increased to obtain the start and end cache addresses of each bucket.

[0095] Step S300: Classifying the plurality of load data based on the cache space allocated to each bucket.

[0096] In the embodiment of the present application, the data to be processed may be classified based on the following steps S310-S330:

[0097] Step S310: reading any one of the plurality of load data as the load data to be classified.

[0098] In step S200, cache space is allocated to each required bucket, and the starting cache address of the cache space corresponding to each bucket is determined. In step S310, each load data can be read according to the storage address of the data to be processed determined in step S100.

[0099] Step S320: Determine a target bucket corresponding to the load data to be classified based on the word elements in the load data to be classified.

[0100] In the embodiment of the present application, each payload data contains a word element, which contains the characteristics of the classification category to which it belongs. Therefore, the classification chip can determine which category the payload data belongs to based on the word element in the payload data, and then determine the bucket corresponding to the payload data, that is, the target bucket corresponding to the payload data.

[0101] Step S330: writing the load data to be classified into the cache space corresponding to the target bucket.

[0102] In step S320, the target bucket corresponding to the acquired load data to be classified is determined, and in step S330, the load data to be classified can be written into the cache space corresponding to the target bucket.

[0103] Among them, for the cache space corresponding to each bucket, the starting cache address corresponding to each bucket has been determined in step S200. Therefore, when the cache space corresponding to any bucket writes load data for the first time, the starting cache address of the cache space corresponding to the bucket is the write-back address of the first write of load data to the bucket.

[0104] After the load data is written into the cache space corresponding to any bucket, if the load data is written into the cache space corresponding to the same bucket again, the write-back address will change because the load data has already been written into the cache space. Therefore, in the embodiment of the present application, before writing the load data to be classified into the cache space corresponding to the target bucket, the data processing method further includes: determining the current write-back address of the target bucket corresponding to the load data to be classified.

[0105] In the embodiment of the present application, initially, the starting cache address corresponding to any bucket can be used as the current write-back address when the load data is first written to the bucket. Then, in the subsequent process, when a load data is written to the cache address corresponding to any target bucket, the current write-back address of the target bucket is updated once, so that the current write-back address of the target bucket can be known each time the load data is written to the cache space corresponding to the target bucket.

[0106] In an embodiment of the present application, the current write-back address of the target bucket may be updated based on the following method: based on the current write-back address of the target bucket and the data size of the currently written load data, the current write-back address of the target bucket is updated.

[0107] Among them, taking the first-ranked bucket as the target bucket as an example, when the load data is written to the cache space corresponding to the first-ranked bucket for the first time, it can be written based on the initial cache address of the first-ranked bucket. After writing, the size of the written load data is added to the initial cache address of the first-ranked bucket to obtain the write-back address when the load data is written to the cache space corresponding to the first-ranked bucket again, that is, the update of the current write-back address is completed, and the updated write-back address is the current write-back address for writing the load data to the cache space corresponding to the first-ranked bucket next time.

[0108] After the current write-back address of the target bucket corresponding to the to-be-classified payload data is determined, the to-be-classified payload data may be written into the cache space corresponding to the target bucket based on the current write-back address of the target bucket.

[0109] In the embodiment of the present application, after writing the load data to be classified into the cache space corresponding to the target bucket, the data processing method further includes:

[0110] Determining whether all of the plurality of load data have been classified;

[0111] If not, continue reading the load data to be classified;

[0112] If so, determine the number of payload data written in the cache space corresponding to each bucket, and generate a data header for each payload data in the cache space corresponding to each bucket, the data header at least including the number of payload data in the corresponding cache space.

[0113] Among them, the total number of load data to be classified can be determined based on the data header in the data to be processed. In the embodiment of the present application, the load data that has been written into the cache space of the bucket can be counted. After each load data is written into the cache space corresponding to any bucket, the count is increased by one and compared with the total number of load data. If the counted number is less than the total number of load data, the load data to be classified continues to be read. If the counted number is equal to the total number of load data, it means that all load data have been classified. At this time, a data header can be generated for each load data in the cache space corresponding to each bucket. The data header of the cache space corresponding to each bucket contains the number of load data in the cache space.

[0114] In the embodiment of the present application, each time the data to be processed is classified, the number of buckets is determined according to the target number of classification categories of the data to be processed, and then the corresponding cache space is allocated to each bucket from the preset memory. Compared with the method in the prior art of setting additional storage space on the classification chip when the classification chip leaves the factory, and allocating a fixed size of cache space to each bucket when it leaves the factory, the method of the present application can avoid the occupation of storage space and waste of resources, and can also avoid increasing the size of the classification chip.

[0115] Exemplary Devices

[0116] This exemplary embodiment provides a data processing device, such as Figure 3 As shown, in an embodiment of the present application, the data processing device includes:

[0117] An acquisition module, the acquisition module is used to acquire bucket information of the data to be processed, the bucket information includes the number of buckets of the data to be processed and the cache space required for each bucket, the data to be processed includes multiple load data, and any load data corresponds to a target bucket;

[0118] A processing module, the processing module is used to allocate a corresponding size of cache space to each bucket from a preset memory based on the size of the cache space required by each bucket;

[0119] The multiple load data are distributed based on the cache space allocated to each bucket.

[0120] In the embodiment of the present application, the processing module is also used for:

[0121] Obtaining classification instructions for the data to be processed;

[0122] Parsing the classification instruction to determine the target number of classification categories of the data to be processed and the data size of the data to be processed;

[0123] The target number of classification categories of the data to be processed is used as the number of buckets;

[0124] Based on the data size of the data to be processed and the number of buckets, the cache space required for each bucket is determined.

[0125] In the embodiment of the present application, the processing module is also used for:

[0126] Determine the starting address of the available storage space from the preset memory;

[0127] Using the starting address of the available storage space as the starting cache address corresponding to the bucket in the first order in the required buckets;

[0128] Based on the starting cache address corresponding to the bucket of this sequence and the cache space size corresponding to the bucket of this sequence, the ending cache address corresponding to the bucket of this sequence is determined, and the ending cache address corresponding to the bucket of the previous sequence is used as the starting cache address corresponding to the bucket of the next sequence.

[0129] In the embodiment of the present application, the processing module is also used for:

[0130] Reading any one of the plurality of load data as the load data to be classified;

[0131] Determining a target bucket corresponding to the load data to be classified based on the word element in the load data to be classified;

[0132] The load data to be classified is written into the cache space corresponding to the target bucket.

[0133] In the embodiment of the present application, before writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further used to:

[0134] Determine a current write-back address of a target bucket corresponding to the payload data to be classified.

[0135] In the embodiment of the present application, after writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further used to:

[0136] Based on the current write-back address of the target bucket and the data size of the currently written payload data, the current write-back address of the target bucket is updated.

[0137] In an embodiment of the present application, the processing module is further used to: use the starting cache address corresponding to any bucket as the current write-back address when the load data is written to the bucket for the first time.

[0138] In the embodiment of the present application, after writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further used to:

[0139] Determining whether all of the plurality of load data have been classified;

[0140] If not, continue reading the load data to be classified;

[0141] If so, determine the number of payload data written in the cache space corresponding to each bucket, and generate a data header for each payload data in the cache space corresponding to each bucket, the data header at least including the number of payload data in the corresponding cache space.

[0142] In the embodiment of the present application, each time the data to be processed is classified, the number of buckets is determined according to the target number of classification categories of the data to be processed, and then the corresponding cache space is allocated to each bucket from the preset memory. Compared with the method in the prior art of setting additional storage space on the classification chip when the classification chip leaves the factory, and allocating a fixed size of cache space to each bucket when it leaves the factory, the method of the present application can avoid the occupation of storage space and waste of resources, and can also avoid increasing the size of the classification chip.

[0143] Exemplary Media

[0144] After introducing the method, medium and system of the exemplary embodiments of the present application, next, reference is made to Figure 4 For a description of the computer-readable storage medium of the exemplary embodiment of the present application, please refer to Figure 4 , the computer-readable storage medium shown is a CD 70, on which a computer program (i.e., a program product) is stored. When the computer program is executed by the processor, each step recorded in the above method implementation is implemented, for example, obtaining bucket information of the data to be processed, the bucket information includes the number of buckets of the data to be processed and the cache space required for each bucket, the data to be processed includes multiple load data, and any load data corresponds to a target bucket; based on the size of the cache space required for each bucket, a cache space of a corresponding size is allocated to each bucket from a preset memory; based on the cache space allocated to each bucket, the multiple load data are distributed. The specific implementation of each step is not repeated here. 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 described one by one here.

[0145] Exemplary Computing Devices

[0146] After introducing the methods, systems, and media of the exemplary embodiments of the present application, reference is now made to Figure 5 A computing device according to an exemplary embodiment of the present application.

[0147] Figure 5 A block diagram of an exemplary computing device 80 suitable for implementing embodiments of the present application is shown. The computing device 80 may be a computer system or a server. Figure 5 The computing device 80 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.

[0148] like Figure 5 As shown, the components of the computing device 80 may include, but are not limited to: one or more processors or processing units 801 , a system memory 802 , and a bus 803 connecting various system components (including the system memory 802 and the processing unit 801 ).

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

[0150] The system storage 802 may include computer system readable media in the form of volatile storage, such as random access memory (RAM) 8021 and / or cache memory 8022. The computing device 70 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the ROM 8023 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 is not shown in the Figure 5 As shown in FIG. 8 , 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 the bus 803 via one or more data medium interfaces. The system storage 802 may include at least one program product, which has a set (e.g., at least one) of program modules, which are configured to perform the functions of each embodiment of the present application.

[0151] A program / utility 8025 having a set (at least one) of program modules 8024 may be stored, for example, in system memory 802, and such program modules 8024 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 8024 generally perform the functions and / or methods of the embodiments described herein.

[0152] The computing device 80 may also communicate with one or more external devices 804 (e.g., a keyboard, a pointing device, a display, etc.). Such communication may be performed via an input / output (I / O) interface. In addition, the computing device 80 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 806. Figure 5 As shown, the network adapter 806 communicates with other modules (such as the processing unit 801, etc.) of the computing device 80 via the bus 803. It should be understood that although Figure 5 Not shown, other hardware and / or software modules may be used in conjunction with computing device 80 .

[0153] The processing unit 801 executes various functional applications and data processing by running the program stored in the system memory 802, for example, obtaining the bucket information of the data to be processed, the bucket information includes the number of buckets of the data to be processed and the cache space required for each bucket, the data to be processed includes multiple load data, and any load data corresponds to a target bucket; based on the size of the cache space required for each bucket, a cache space of a corresponding size is allocated to each bucket from a preset memory; based on the cache space allocated to each bucket, the multiple load data are distributed. The specific implementation of each step is not repeated here. It should be noted that although several units / modules or sub-units / sub-modules of the computing device are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to the embodiment of the present application, the features and functions of two or more units / modules described above can be concretized in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be concretized.

[0154] 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.

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

[0156] In the several embodiments provided in the present application, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. The system embodiments described above are only 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 the system or unit can be electrical, mechanical or other forms.

[0157] 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.

[0158] 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.

[0159] 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 can be executed 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. The computer software product is stored in a storage medium, including several instructions for a computing device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0160] 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.

[0161] 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 processing method, applied to a data classification chip, comprising: Obtaining bucket information of the data to be processed, the bucket information including the number of buckets of the data to be processed and the cache space required for each bucket, the data to be processed including multiple load data, and any load data corresponds to a target bucket; Based on the size of the cache space required by each bucket, a cache space of a corresponding size is allocated to each bucket from a preset memory; the preset memory is not set on the data classification chip, and is in communication connection with the data classification chip; Distributing the plurality of load data based on the cache space allocated to each bucket; The bucket information is determined based on the following method: Obtaining classification instructions for the data to be processed; Parsing the classification instruction to determine the target number of classification categories of the data to be processed and the data size of the data to be processed; The target number of classification categories of the data to be processed is used as the number of buckets; Determine the cache space required for each bucket based on the data size of the data to be processed and the number of buckets; The method of allocating a cache space of a corresponding size to each bucket from a preset memory based on the size of the cache space required by each bucket includes: Determine the starting address of the available storage space from the preset memory; Using the starting address of the available storage space as the starting cache address corresponding to the bucket in the first order in the required buckets; Based on the starting cache address corresponding to the bucket of this sequence and the cache space size corresponding to the bucket of this sequence, the ending cache address corresponding to the bucket of this sequence is determined, and the ending cache address corresponding to the bucket of the previous sequence is used as the starting cache address corresponding to the bucket of the next sequence.

2. The data processing method according to claim 1, wherein classifying the plurality of load data based on the cache space allocated to each bucket comprises: Reading any one of the plurality of load data as the load data to be classified; Determining a target bucket corresponding to the load data to be classified based on the word element in the load data to be classified; The load data to be classified is written into the cache space corresponding to the target bucket.

3. The data processing method according to claim 2, before writing the load data to be classified into the cache space corresponding to the target bucket, the data processing method further comprises: Determine a current write-back address of a target bucket corresponding to the payload data to be classified.

4. The data processing method according to claim 2, after writing the load data to be classified into the cache space corresponding to the target bucket, the data processing method further comprises: Based on the current write-back address of the target bucket and the data size of the currently written payload data, the current write-back address of the target bucket is updated.

5. The data processing method as described in claim 2 further includes using the starting cache address corresponding to any bucket as the current write-back address when the load data is written to the bucket for the first time.

6. The data processing method according to claim 2, after writing the load data to be classified into the cache space corresponding to the target bucket, the data processing method further comprises: Determining whether all of the plurality of load data have been classified; If not, continue reading the load data to be classified; If so, determine the number of payload data written in the cache space corresponding to each bucket, and generate a data header for each payload data in the cache space corresponding to each bucket, the data header at least including the number of payload data in the corresponding cache space.

7. A data processing device, applied to a data classification chip, comprising: An acquisition module, the acquisition module is used to acquire bucket information of the data to be processed, the bucket information includes the number of buckets of the data to be processed and the cache space required for each bucket, the data to be processed includes multiple load data, and any load data corresponds to a target bucket; A processing module, the processing module is used to allocate a corresponding size of cache space to each bucket from a preset memory based on the size of the cache space required by each bucket; the preset memory is not set on the data classification chip, and is in communication connection with the data classification chip; Distributing the plurality of load data based on the cache space allocated to each bucket; The processing module is also used for: Obtaining classification instructions for the data to be processed; Parsing the classification instruction to determine the target number of classification categories of the data to be processed and the data size of the data to be processed; The target number of classification categories of the data to be processed is used as the number of buckets; Determine the cache space required for each bucket based on the data size of the data to be processed and the number of buckets; The processing module is further configured to determine the cache space required for each bucket based on: Determine the starting address of the available storage space from the preset memory; Using the starting address of the available storage space as the starting cache address corresponding to the bucket in the first order in the required buckets; Based on the starting cache address corresponding to the bucket of this sequence and the cache space size corresponding to the bucket of this sequence, the ending cache address corresponding to the bucket of this sequence is determined, and the ending cache address corresponding to the bucket of the previous sequence is used as the starting cache address corresponding to the bucket of the next sequence.

8. The data processing device according to claim 7, wherein the processing module is further configured to: Reading any one of the plurality of load data as the load data to be classified; Determining a target bucket corresponding to the load data to be classified based on the word element in the load data to be classified; The load data to be classified is written into the cache space corresponding to the target bucket.

9. The data processing device according to claim 8, before writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further used to: Determine a current write-back address of a target bucket corresponding to the payload data to be classified.

10. The data processing device according to claim 8, after writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further configured to: Based on the current write-back address of the target bucket and the data size of the currently written payload data, the current write-back address of the target bucket is updated.

11. The data processing device according to claim 8, wherein the processing module is further used to: use the starting cache address corresponding to any bucket as the current write-back address when the load data is written to the bucket for the first time.

12. The data processing device according to claim 8, after writing the load data to be classified into the cache space corresponding to the target bucket, the processing module is further used to: Determining whether all of the plurality of load data have been classified; If not, continue reading the load data to be classified; If so, determine the number of payload data written in the cache space corresponding to each bucket, and generate a data header for each payload data in the cache space corresponding to each bucket, the data header at least including the number of payload data in the corresponding cache space.

13. A computer-readable storage medium comprising instructions, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 6.

14. A computing device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.