WO2022170569A1 - Data processing method and apparatus - Google Patents

Data processing method and apparatus Download PDF

Info

Publication number
WO2022170569A1
WO2022170569A1 PCT/CN2021/076545 CN2021076545W WO2022170569A1 WO 2022170569 A1 WO2022170569 A1 WO 2022170569A1 CN 2021076545 W CN2021076545 W CN 2021076545W WO 2022170569 A1 WO2022170569 A1 WO 2022170569A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
data block
data
compressed
compression
Prior art date
Application number
PCT/CN2021/076545
Other languages
French (fr)
Chinese (zh)
Inventor
黄永兵
黄韬
姜伟鹏
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202180067859.2A priority Critical patent/CN116368796A/en
Priority to PCT/CN2021/076545 priority patent/WO2022170569A1/en
Publication of WO2022170569A1 publication Critical patent/WO2022170569A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to a data processing method and apparatus.
  • AI Artificial Intelligence
  • digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
  • artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and enable machines to perceive, reason and make decisions.
  • the embodiment of the present invention provides a data processing method, which can reduce the data compression time and improve the data compression performance.
  • a first aspect of the embodiments of the present invention provides a data processing method, which is characterized by comprising: selecting a first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block; a first model associated with a reference data block; based on the compression model, compress the first data block to generate a first compressed data block, and the compression model is obtained according to the first model; generate a first compressed data packet, the first compressed data
  • the package includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
  • the first model may be directly stored in the form of the first model, or the first model may be a similar model of the first model and the difference between the similar model and the first model
  • the data is stored in the form of data, wherein the first model can be obtained by processing the similar model of the first model and the difference data between the similar model and the first model.
  • the compression model is not necessarily equal to the first model, and in the case of using the first model to compress the first data block, the compression model is equal to the first model, or , in the case of compressing the first data block by using the model after the optimization or training of the first model, the compression model is the model after optimization or training.
  • selecting the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block includes, based on the first data block to be compressed
  • the first reference data block is selected according to the content similarity with each pre-stored reference data block.
  • the similarity between the first data block and the reference data block may be calculated based on various similarity algorithms, for example, the similarity algorithm includes a Jaccard similarity algorithm, a Cosine similarity algorithm, and the like.
  • the training time of the model is reduced, thereby reducing the data compression time.
  • the first data block is compressed based on the compression model to generate the first compressed data block.
  • the compression model is used to predict the unit data in the first data block.
  • Occurrence probability According to the occurrence probability of the unit data in the first data block, the first data block is compressed to generate the first compressed data block.
  • the first data block is compressed based on the compression model to generate the first compressed data block, and the compression model is obtained according to the first model, specifically: using the first model As the compression model, the first data block is compressed to generate the first compressed data block.
  • the similarity between the first data block to be compressed and the first reference data block is high, for example, when the similarity between the first data block to be compressed and the first reference data block is greater than a threshold, the first model is used as the compression model , compressing the first data block without retraining the model, reducing the training time of the model and improving the data compression performance.
  • the compressed model information includes the first model or an identifier of the first model.
  • the first data block is compressed based on the compression model to generate the first compressed data block, and the compression model is obtained according to the first model, specifically: using the second model
  • the compression model the first data block is compressed to generate the first compressed data block
  • the second model is obtained by training the first model using part of the data in the first data block.
  • the prediction accuracy of the model is improved, since the first data block and the first reference data block have Therefore, the training process takes less time and improves the data compression performance.
  • the compressed model information includes any one of the following: the second model; the identifier of the second model; the identifier of the first model, and the difference between the second model and the first model data.
  • an identifier of the second model may be included in the compressed model information.
  • the multiple reference data blocks include at least one of the following data blocks: compressed data blocks, data blocks of different data types, and data blocks of different time points in a period.
  • the compressed data block may be a compressed data block within a recent period of time, wherein the length of the time period may be flexibly determined according to the size of the storage space.
  • As a temporally adjacent data block to the to-be-compressed data block it may have a greater similarity with the to-be-compressed data block.
  • Different types of data include, for example, pictures, text, databases, etc., and data blocks at different time points in the cycle It is a data block at several time points in a cycle in a scenario where the data changes periodically.
  • the number of stored reference data blocks can be flexibly determined according to the size of the storage space.
  • reference data blocks By selecting reference data blocks from the dimensions of time and space, it is easier to obtain reference data blocks that are more similar to the data blocks to be compressed, thereby reducing model training time.
  • the method provided in the first aspect of the present application further includes: storing the first data block as a reference data block, storing compression model information, and storing the stored first data block with the stored Compressed model information associative storage.
  • the compressed model itself can be stored as the compressed model information, or the difference data between the compressed model and other stored similar models and the identifier of the similar model can be stored as the compressed model information.
  • storing the stored first data block in association with the stored compression model information means that when the stored first data block is found, the stored compression model can be further found, but it is not limited to associating the stored first data block with the stored compression model information stored together.
  • the method provided by the first aspect of the present application is executed by a computing device, and the computing device includes a neural network processor, and the neural network processor is based on a compression model.
  • the data block is compressed to generate a first compressed data block.
  • the model compression process is accelerated, and the duration of data compression is reduced.
  • the method provided by the first aspect of the present application further includes: obtaining a first compressed data packet; obtaining a compression model according to compression model information in the first compressed data packet; The compression model decompresses the first compressed data block in the first compressed data packet to obtain the first data block.
  • a second aspect of the present application provides a data processing apparatus, including a processing unit and a storage unit, the storage unit stores executable code, and the processing unit is configured to execute the executable code to achieve: based on the first data block to be compressed and the pre-stored the similarity of each reference data block, select the first reference data block; obtain the first model associated with the first reference data block; compress the first data block based on the compression model, generate the first compressed data block, and compress the model To obtain according to the first model; generate a first compressed data packet, the first compressed data packet includes a first compressed data block and compression model information, and the compression model information is obtained according to the compression model.
  • the processing unit is configured to execute executable code to compress the first data block based on the compression model to generate the first compressed data block.
  • the processing unit uses in executing the executable code to achieve: predicting the occurrence probability of the unit data in the first data block based on the compression model; compressing the first data block according to the occurrence probability of the unit data in the first data block to generate a first compressed data block.
  • the processing unit is configured to execute the executable code to compress the first data block based on the compression model to generate the first compressed data block, and the compression model is based on the first data block.
  • the obtaining of the model is specifically: the processing unit is configured to execute the executable code to implement using the first model as the compression model, compress the first data block, and generate the first compressed data block.
  • the processing unit is configured to execute the executable code to compress the first data block based on the compression model to generate the first compressed data block, and the compression model is based on the first data block.
  • the model is obtained, specifically: the processing unit is configured to execute the executable code to implement the use of the second model as the compression model, compress the first data block, and generate the first compressed data block, and the second model uses the first data block. Part of the data is obtained by training the first model.
  • the processing unit is further configured to execute executable codes to implement: storing the first data block as a reference data block, storing compression model information, and storing the first data block stored with the storage Compressed model information for associative storage.
  • the processing unit includes a neural network processor; and the processing unit is configured to execute executable codes to implement compression of the first data block based on the compression model to generate the first compressed data piece.
  • the neural network processor is configured to execute the executable code to compress the first data block based on the compression model to generate the first compressed data block.
  • the processing unit is further configured to execute executable code to achieve: obtaining the first compressed data packet; obtaining the compression model according to the compression model information in the first compressed data packet; Decompress the first compressed data block in the first compressed data packet by using the compression model to obtain the first data block.
  • a third aspect of the present application provides a data processing apparatus, comprising: a selection unit for selecting a first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block; an acquisition unit for obtaining a first model associated with the first reference data block; a compression unit, configured to compress the first data block based on the compression model to generate a first compressed data block, and the compression model is obtained according to the first model; the generating unit, It is used to generate a first compressed data packet, where the first compressed data packet includes a first compressed data block and compression model information, and the compression model information is obtained according to the compression model.
  • the compression unit is specifically configured to: predict the occurrence probability of the unit data in the first data block based on the compression model; according to the occurrence probability of the unit data in the first data block , compress the first data block to generate the first compressed data block.
  • the compression unit is specifically configured to: use the first model as the compression model, compress the first data block, and generate the first compressed data block.
  • the compression unit is specifically configured to: adopt the second model as the compression model, compress the first data block, and generate the first compressed data block, and the second model uses the first data block as the compression model to compress the first data block. Part of the data in a data block is obtained by training the first model.
  • the apparatus provided in the third aspect of the present application further includes: a storage unit, configured to store the first data block as a reference data block, store compression model information, and store the first data block as a reference data block. Data blocks are stored in association with stored compression model information.
  • the apparatus provided by the third aspect of the present application includes a neural network processor; the compression unit is deployed in the neural network processor.
  • the obtaining unit is further configured to obtain the first compressed data packet, and obtain the compression model according to the compression model information in the first compressed data packet.
  • the third aspect of the present application provides The apparatus further includes a decompression unit, configured to decompress the first compressed data block in the first compressed data packet by using the compression model to obtain the first data block.
  • a fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed in a computer or a processor, the computer or processor is caused to execute the above-mentioned first the method described in the aspect.
  • a fifth aspect of the present application provides a computer program product, characterized in that, when the computer program product runs in a computer or a processor, the computer or processor is caused to execute the method described in the first aspect.
  • Fig. 1 shows a schematic diagram of an artificial intelligence main frame
  • FIG. 2 is a schematic diagram of a system architecture provided by an embodiment of the present invention.
  • Fig. 3 is the structural schematic diagram of RNN model
  • Fig. 4 is the model prediction schematic diagram of RNN model
  • FIG. 5 is a hardware structure diagram of an NPU chip provided by an embodiment of the present invention.
  • FIG. 6 is an architecture diagram of a storage system provided by an embodiment of the present invention.
  • FIG. 7 is a flowchart of a data compression method provided by an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a data block-model pre-stored in a storage node
  • FIG. 9 is a schematic diagram of a process of data compression based on an AI model
  • FIG. 10 is a schematic diagram of a process of encoding a data block by a compression module
  • Figure 11 is a schematic diagram of the process of data decompression based on the AI model
  • FIG. 12 is an architectural diagram of a data processing apparatus according to an embodiment of the present invention.
  • FIG. 13 is an architectural diagram of a data processing apparatus provided by an embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram of a data processing apparatus provided by an embodiment of the present invention.
  • FIG. 15 is a terminal-cloud system architecture provided by an embodiment of the present invention.
  • Figure 1 shows a schematic diagram of an artificial intelligence main frame, which describes the overall workflow of an artificial intelligence system and is suitable for general artificial intelligence field requirements.
  • the "intelligent information chain” reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, data has gone through the process of "data-information-knowledge-wisdom".
  • the "IT value chain” from the underlying infrastructure of artificial intelligence, information (providing and processing technology implementation) to the industrial ecological process of the system reflects the value brought by artificial intelligence to the information technology industry.
  • the artificial intelligence main frame includes the following main components:
  • the infrastructure provides computing power support for artificial intelligence systems, realizes communication with the outside world, and supports through the basic platform.
  • the infrastructure includes: sensors for communicating with the outside; intelligent chips (Central processing unit (CPU), graphics processing unit (Graphics processing unit, GPU), neural-network process unit (Neural-network process unit, NPU), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (Field Programmable Gate Array, FPGA) and other hardware acceleration chips), used to provide computing power; basic platform, including distributed computing framework and Network and other related platform guarantees and support can include cloud storage and computing, interconnection networks, etc.
  • the sensor communicates with the outside to obtain data, and provides the data to the intelligent chip in the distributed computing system provided by the basic platform for calculation.
  • the data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence.
  • the data involves graphics, images, voice, and text, as well as IoT data from traditional devices, including business data from existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
  • Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.
  • machine learning and deep learning can perform symbolic and formalized intelligent information modeling, extraction, preprocessing, training, etc. on data.
  • Reasoning refers to the process of simulating human's intelligent reasoning method in a computer or intelligent system, using formalized information to carry out machine thinking and solving problems according to the reasoning control strategy, and the typical function is search and matching.
  • Decision-making refers to the process of making decisions after reasoning about intelligent information, usually providing functions such as classification, sorting, and prediction.
  • some general capabilities can be formed based on the results of the data processing, which can be algorithms or general systems, such as translation, text analysis, computer vision processing, speech recognition, and image recognition. and many more.
  • Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, and the productization of intelligent information decision-making and implementation of applications. Its application areas mainly include: intelligent manufacturing, intelligent transportation, Smart home, smart medical care, smart security, autonomous driving, safe city, smart terminals, etc.
  • an embodiment of the present invention provides a system architecture 200 .
  • the data collection device 260 is used to collect AI model sample data and store it in the database 230 , and the training device 220 generates the target model/rule 201 based on the sample data maintained in the database 230 .
  • the AI model includes, for example, a neural network model.
  • the neural network model is a network structure that imitates the behavioral characteristics of animal neural networks for information processing, and is also referred to as artificial neural networks (ANN).
  • the neural network model includes, for example, at least one of a variety of neural network models such as Convolutional Neural Network (CNN), Deep Neural Networks (DNN), and Recurrent Neural Network (RNN).
  • CNN Convolutional Neural Network
  • DNN Deep Neural Networks
  • RNN Recurrent Neural Network
  • a sort of The structure of the neural network model is composed of a large number of nodes (or neurons) connected to each other, and the purpose of processing information is achieved by learning and training the input information based on a specific operation model.
  • a neural network model includes an input layer, a hidden layer and an output layer.
  • the input layer is responsible for receiving input signals
  • the output layer is responsible for outputting the calculation results of the neural network
  • the hidden layer is responsible for learning, training and other computing processes. It is the memory unit of the network.
  • the memory function is represented by a weight matrix, usually each neuron corresponds to a weight coefficient.
  • the work of each layer in a neural network model can be expressed mathematically to describe which, is the input vector of the layer, y is the output value (or output vector) of the layer, and a, W, and b are the model parameters included in the layer.
  • the input vector of the input layer of the model is the input feature vector of the model
  • each element in the input feature vector is the feature value of the object to be predicted
  • the output value output by the output layer of the model is the predicted value of the model
  • the predicted value indicates The prediction result of the object to be predicted.
  • the work of each layer in the neural network model can be understood as completing the transformation from the input space to the output space through five operations on the input space (set of input vectors). These five operations include: 1. Dimension/reduction; 2.
  • the purpose of training the neural network model is to finally obtain the weight matrix of all layers of the trained neural network (the weight matrix formed by the vectors W of many layers). Therefore, the training process of the neural network is essentially learning the way to control the spatial transformation, and more specifically, learning the weight matrix.
  • the training device 220 can compare the predicted value of the current network with the desired target value, and update the weight vector of each layer of the neural network according to the difference between the two, so as to make the neural network
  • the output of the model is as close as possible to the value that is really expected to be predicted. For example, if the predicted value of the neural network model is larger than the target value, the weight vector of the model is adjusted so that the predicted value of the model decreases, and vice versa, and so on continuously until the desired target value is obtained. (ie ground truth or label value) target model/rule 201.
  • a loss function or objective function can be predefined, which are important equations for measuring the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value of the loss function (loss), the greater the difference, then the training of the neural network model becomes the process of reducing the loss as much as possible.
  • the target model/rule 201 obtained by training the device 220 can be applied in different systems or devices.
  • the execution device 210 is configured with an I/O interface 212 for data interaction with external devices, and a “user” can input data to the I/O interface 212 through the client device 240 .
  • the execution device 210 can call data, codes, etc. in the data storage system 250 , and can also store data, instructions, etc. in the data storage system 250 .
  • the calculation module 211 uses the target model/rule 201 to process the input data to output the processing result. Finally, the I/O interface 212 returns the processing result to the client device 240, which is provided to the user.
  • the execution device 210 may also include an associated function module (the associated function module 213 and the associated function module 214 are schematically shown in FIG. 2 ), which may perform associated processing based on the processing result of the computing module 211 to output the processing result. associated results.
  • the training device 220 can generate corresponding target models/rules 201 based on different data for different targets, so as to provide users with better results.
  • the user may manually specify input data in execution device 210 , eg, operating in an interface provided by I/O interface 212 .
  • the client device 240 can automatically input data to the I/O interface 212 and obtain the result. If the client device 240 automatically inputs data and needs to obtain the user's authorization, the user can set the corresponding permission in the client device 240 .
  • the user can view the result output by the execution device 210 on the client device 240, and the specific presentation form can be a specific manner such as display, sound, and action.
  • the client device 240 can also act as a data collection terminal to store the collected sample data in the database 230.
  • FIG. 2 is only a schematic diagram of a system architecture provided by an embodiment of the present invention, and the positional relationship between the devices, devices, modules, etc. shown in the figure does not constitute any limitation.
  • the data storage The system 250 is an external memory relative to the execution device 210 , and in other cases, the data storage system 250 may also be located in the execution device 210 .
  • the training device 220 and the execution device 210 may be the same computing device.
  • the training device 220 is a platform server. After the target model 201 is trained, the platform server acts as the execution device 210 to provide services for users. Processing services.
  • the embodiments of the present invention relate to a solution for lossless data compression combined with an AI model.
  • Data lossless compression refers to a technical method that reduces the amount of original data to reduce storage space and improve the efficiency of transmission, storage and processing without losing useful information.
  • the basic idea of the data compression algorithm is to replace the repeated characters in the data with shorter coding symbols; the higher the probability of characters appearing, the shorter the coding symbols.
  • the occurrence probability of the unit data in the original data block is predicted by the AI model, so that the original data block can be compressed based on the probability output by the AI model through the entropy coding algorithm.
  • the AI model may be, for example, any one of the above-mentioned models such as the CNN model, the DNN model, the RNN model, and the like.
  • the RNN model is more suitable for processing sequence data.
  • the RNN model can predict the occurrence probability of the unit data arranged at the rear based on the unit data arranged at the front in the data block. Therefore, compared with models such as the CNN model, the RNN model can with higher accuracy.
  • an RNN model will be used as an example for description, wherein the RNN model includes many extended models, such as a long short-term memory (Long Short-Term Memory, LSTM) model, a gate recurrent unit network (Gate Recurrent Unit, GRU) Models, etc. These extended models can also be called RNN models.
  • LSTM Long Short-Term Memory
  • GRU Gate Recurrent Unit
  • FIG. 3 is a schematic diagram of the structure of the RNN model.
  • the RNN model is also a neural network model, including an input layer, a multi-layer hidden layer (one layer is schematically shown in FIG. 3 ) and an output layer, and each neural layer includes a plurality of neurons.
  • the neurons in the hidden layer of the RNN model are not only fully connected to the previous layer, but also include arrows pointing to themselves and arrows pointing to other neurons in this layer.
  • the arrow pointing to itself and the arrow pointing to other neurons indicate that the neuron also acquires the memory of the model about the previous input data when performing the current calculation, so as to calculate the output data based on the current input data and the previous input data.
  • FIG. 4 is a schematic diagram of model prediction of the RNN model.
  • x t-1 , x t , x t+1 are the model inputs at time t-1, time t and time t+1, respectively
  • o t-1 , o t , o t+1 are respectively at time t-1
  • Model output at time t-1, time t and time t+1 in addition, S t-1 , S t , and S t+1 are the model memory at time t-1, time t and time t+1, respectively.
  • the model memory S t can be calculated and obtained by the following formula (1):
  • U and W are model parameters
  • the f() function is an activation function in the neural network, such as a tanh function.
  • the model output o t is calculated and obtained by the following formula (2):
  • the RNN model is used to predict the occurrence probability of characters in a sentence
  • the RNN model will not be used for each character input.
  • the probability of the next word will be predicted based on the previously entered word.
  • the RNN model will predict the probability of the next word as "person” based on the correlation with the previous word.
  • the occurrence probability of the "person” can be expressed as P(person
  • the RNN model can be trained based on a loss function, which includes the parameters U, V, and W, so that the values of the parameters U, V, and W can be adjusted based on the loss function to make the output of the RNN model (i.e. the predicted value) is continuously decreasing relative to the label value.
  • a loss function which includes the parameters U, V, and W
  • the values of the parameters U, V, and W can be adjusted based on the loss function to make the output of the RNN model (i.e. the predicted value) is continuously decreasing relative to the label value.
  • the true probability of occurrence of the word " ⁇ ” after "I am Chinese” in the text can be found in advance as the label value, and "I am Chinese” can be used as the label value.
  • the five words “Chinese” are input into the RNN model in turn, and the RNN model outputs the predicted value of the occurrence probability of the word " ⁇ ", and substitutes the predicted value of the occurrence probability of the word " ⁇ ” and the label value into the loss function to adjust the parameters U, V,
  • the value of W makes the prediction value of the RNN model for the word "people” in "I am Chinese” closer to the label value.
  • the RNN model is trained multiple times by using multiple samples to make the model converge, so that the probability of occurrence of each word in the text can be predicted by sequentially inputting each word in the text into the trained RNN model.
  • FIG. 5 is a hardware structure diagram of an NPU chip provided by an embodiment of the present invention. Both the model prediction and model training of the RNN model described above with reference to FIG. 4 can be implemented in the NPU chip shown in FIG. 5 .
  • the neural network processor NPU is mounted on the main CPU as a co-processor, and the main CPU assigns tasks.
  • the core part of the NPU is the arithmetic circuit 503, which is controlled by the controller 504 to extract the matrix data in the memory and perform multiplication operations.
  • the arithmetic circuit 503 includes multiple processing units (Process Engine, PE). In some implementations, arithmetic circuit 503 is a two-dimensional systolic array. The arithmetic circuit 503 may also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 503 is a general-purpose matrix processor.
  • PE Processing Unit
  • arithmetic circuit 503 is a two-dimensional systolic array. The arithmetic circuit 503 may also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 503 is a general-purpose matrix processor.
  • the bus interface unit (Bus Interface Unit, BIU) 510 is used for the interaction between the bus and the memory unit access controller (Direct Memory Access Controller, DMAC) 505 and the instruction fetch memory (Instruction Fetch Buffer) 509.
  • DMAC Direct Memory Access Controller
  • Instruction Fetch Buffer Instruction Fetch Buffer
  • the instruction fetch memory 509 obtains instructions from the external memory through the bus interface unit 510, and the DMAC 505 obtains the original data of the input matrix A or the weight matrix B from the external memory through the bus interface unit 510.
  • the DMAC 505 is mainly used to transfer the input data in the external memory DDR to the unified memory 506, or to transfer the weight data (for example, the weight matrix B) to the weight memory 502, or to transfer the input data (for example, the input matrix A) to the input memory 501.
  • the operation circuit 503 can read the corresponding data of the weight matrix B from the weight memory 502 and buffer it on each PE in the operation circuit 503 .
  • the operation circuit 503 reads the data of the input matrix A and the weight matrix B from the input memory 501 to perform matrix operation, and stores the partial result or the final result of the matrix C outputted by the operation in the accumulator 508 .
  • Unified memory 506 may be used to store input data and/or output data.
  • the vector calculation unit 507 includes a plurality of operation processing units, and further processes the output of the operation circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc., if necessary.
  • the vector calculation unit 507 is mainly used for non-convolutional/full connection layer (Full connecting layer, FCL) network calculation in the neural network, such as pooling (Pooling), batch normalization (Batch Normalization), local response normalization (Local Response normalization) Response Normalization) and so on.
  • FCL non-convolutional/full connection layer
  • vector computation unit 507 may store the processed output vectors to unified buffer 506 .
  • vector computation unit 507 may apply a nonlinear function to the output of arithmetic circuit 503 to generate activation values.
  • vector computation unit 507 generates normalized values, merged values, or both.
  • the output vector processed by the vector computing unit 507 can be used as an activation input to the arithmetic circuit 503, eg, for use in subsequent layers in a neural network.
  • An instruction fetch buffer 509 connected to the controller 504 is used to store instructions used by the controller 504 .
  • the unified memory 506, the input memory 501, the weight memory 502 and the instruction fetch memory 509 are all on-chip memories. External memory is independent of the NPU hardware architecture.
  • the operation of each layer in the RNN model shown in FIG. 3 may be performed by the operation circuit 503 or the vector calculation unit 507 .
  • model training takes a long time, which makes data compression more time-consuming and has poor compression performance.
  • an embodiment of the present invention proposes a data compression scheme, which utilizes the correlation of data blocks in time and/or space dimensions, and uses the AI prediction model of similar data blocks as the initial model of the current data block to be compressed, so as to be used for Data compression is performed.
  • the data compression scheme of the embodiment of the present invention saves the model training time of the AI model and shortens the time-consuming of data compression.
  • the data compression solutions in the embodiments of the present invention can be applied to storage systems and/or storage products, for example, small data block compression can be used in scenarios such as databases and virtualization. It can be understood that the solutions of the embodiments of the present invention are not limited to being used in storage systems, but can be applied to any other scenarios that require data compression. compression. The following description will take the storage system as an example.
  • FIG. 6 is an architecture diagram of a storage system provided by an embodiment of the present invention.
  • the storage system includes a computing node 61 , a storage node 62 and a storage medium 63 .
  • the computing node 61 and the storage node 62 may be physical servers, or may also be virtual entities, such as virtual machines and containers, which are abstracted based on general hardware resources.
  • the storage medium 63 is, for example, a storage medium such as a solid state disk (Solid State Disk, SSD), a hard disk drive (HDD), a storage class memory (Storage class memory, SCM), and the storage medium 63 may be a storage medium
  • the storage medium local to the node may also be a distributed storage medium connected to the storage node.
  • the computing node 61 may perform data access to the storage node 62, such as writing data, reading data, and the like. Specifically, the computing node 61 can send a write request to the storage node 62 to write data.
  • the data to be written in the write request can be, for example, various types of data such as images, databases, and texts, and the data to be written is also the data to be compressed. .
  • the storage node 62 calculates the similarity between the data to be written in the write request and each pre-stored reference data block through the similarity analysis module 621, and selects a reference data block with the highest similarity, and obtains a reference data block with the highest similarity.
  • the selected reference data block is associated with the AI model (ie, the probability prediction model), and the AI model is provided to the probability prediction module 622 as the initial AI model of the data to be written.
  • the probability prediction module 622 predicts the occurrence probability of unit data (eg, characters) in the data to be written based on the initial AI model, and outputs the occurrence probability of each character to the compression module 623 .
  • the compression module 623 compresses the data to be written based on the occurrence probability of each character in the data to be written, obtains a compressed data packet of the data to be written, and stores the compressed data packet in the storage medium, except that in the compressed data packet In addition to the compressed data of the data to be written, it also includes relevant information of the AI model used to compress the data to be written. After storing the compressed data of the data to be written into the storage medium, the storage node records the correspondence between the data to be written and the storage address of the compressed data, so that the computing node can read the data to be written.
  • the storage node 62 may also include a decompression module 624.
  • the storage node 62 may read the compressed data packet from the storage medium 63, and obtain the data for decompression based on the compressed data packet.
  • the probability prediction module 622 and the decompression module 624 decompress the compressed data based on the AI model, so as to obtain the written data and return it to the computing node 61 .
  • the above-mentioned similarity analysis module 621, probability prediction module 622, compression module 623 and decompression module 624 may be in the form of software, hardware or firmware.
  • the similarity analysis module 621 , the compression module 623 and the decompression module 624 may be deployed in the main CPU in FIG. 5 , that is, the similarity analysis module 621 , the compression module 623 and the decompression module are executed by the main CPU.
  • the operation performed by the compression module 624, the probability prediction module 622 may be deployed in the NPU in FIG. 5, that is, the operation performed by the probability prediction module 622 is performed by the NPU.
  • the similarity analysis module 621, the compression module 623 and the decompression module 624 are not limited to be deployed in the main CPU in FIG. 5, and the probability prediction module 622 is not limited to be deployed in the NPU in FIG.
  • the specific device configuration is deployed.
  • the unit data is not limited to characters, for example, the unit data may be an image or part of data in a database. What is common to data such as images, databases, and texts is that they are all represented by binary numbers in the storage system. Therefore, unit data in these different types of data can be uniformly set as binary numbers with a predetermined length.
  • the predetermined length is, for example, one byte, that is, 8 bits, so that the total number of the unit data is 256 in total from 0 to 255. It can be understood that the predetermined length is not limited to one byte, but can be set according to the needs of specific scenarios, for example, it can also be set to two bytes, etc. According to different unit data lengths, the total number of unit data is also Change accordingly. By setting the unit data in this way, different types of data can be processed consistently by the same system.
  • FIG. 7 is a flowchart of a data compression method provided by an embodiment of the present invention, and the method includes:
  • Step S701 selecting a reference data block from a plurality of reference data blocks based on the similarity between the data block to be compressed and each pre-stored reference data block;
  • Step S702 acquiring the AI model associated with the selected reference data block
  • Step S703 compressing the data block based on the compression model to generate a compressed data block, the compression model is obtained according to the AI model associated with the selected reference data block;
  • Step S704 generating a compressed data package, where the compressed data package includes compressed data blocks and compression model information.
  • the method shown in FIG. 7 may be performed by the storage node 62 shown in FIG. 6 .
  • the storage node 62 After receiving the write request from the computing node 61, the storage node 62 performs data compression on the to-be-written data of the write request by using the method shown in FIG. 7 .
  • the storage node 62 can compress the to-be-written data of the write request as a data block, or the storage node 62 can also divide the to-be-written data into multiple data blocks of a specified size (for example, 8KB or 32KB, etc.) Data blocks are compressed individually.
  • a reference data block is selected from the plurality of reference data blocks based on the similarity between the data block to be compressed and each pre-stored reference data block.
  • Step S701 can be performed by the similarity analysis module 621 in FIG. 6 .
  • the storage node 62 may pre-store multiple reference data blocks and an AI model associated with each reference data block locally or in a storage space such as a storage medium or the cloud, where the AI model is a probability prediction model for the associated reference data block.
  • FIG. 8 is a schematic diagram of a reference data block-model pre-stored in a storage node. As shown in FIG. 8 , multiple reference data block-model groups can be pre-stored. FIG. 8 schematically shows the first group, the second group and the third group, each group including a specific type of reference data block, for example, the first group, the second group and the third group are schematically shown.
  • One group includes the most recently compressed data blocks as reference data blocks, the second group includes data blocks of different types of data as reference data blocks, and the third group includes data blocks at different time points in the cycle as reference data blocks.
  • the most recently compressed data block as a temporally adjacent data block to the to-be-compressed data block, may have a greater similarity with the to-be-compressed data block. Therefore, in the first group, the most recently compressed data block can be Stored as a reference data block.
  • the different types of data include, for example, pictures, texts, databases, etc.
  • the network structures, levels, and weights of AI models corresponding to data blocks of different types of data are quite different, and the AI models corresponding to data blocks of the same type of data are similar.
  • data blocks of different types of data can be stored as reference data blocks in the second group.
  • the data blocks at different time points in the cycle are data blocks at several time points in a cycle in a scenario where data changes periodically.
  • the computing node 61 may correspond to a food delivery application (Application, APP), and the APP can write transaction data to the storage node 62, and the transaction data is periodically cycled in units of days.
  • the data blocks of transaction data at three time points in the evening are data blocks that are quite different from each other, and the transaction data in the morning of different days may have a high degree of similarity.
  • the data blocks at three time points in the evening are stored as reference data blocks. In each group in FIG.
  • a rectangular box is used to represent a reference data block, and the numbers in the rectangular box represent the number of the reference data block, such as reference data block 1, reference data block 2, and the square box is used to represent the reference data block 1 and the reference data block 2.
  • the AI model associated with the data block, the number in the box is used to represent the number of the AI model, such as AI model 1, AI model 2, where, for example, the reference data block and AI model with the same number are the associated reference data block-AI
  • a model pair for example, reference data block 1 is associated with AI model 1.
  • the AI model associated with the reference data block may be directly stored in the form of the AI model, or may be stored in the form of a similar model of the AI model and the difference data between the similar model and the AI model.
  • a model is, for example, a model associated with another reference data block having a higher degree of similarity to the reference data block.
  • reference data blocks in the above is only illustrative, rather than restrictive, and different reference data block groups can be set according to different storage scenarios.
  • a data block that may have a greater similarity with the data block to be compressed is stored as a reference data block.
  • the storage node 62 may update the pre-stored reference data block. For example, after each data block is compressed, the reference data blocks and corresponding models in the first group in Figure 8 are updated so that a certain number (eg, 5-10) of the most recently compressed data blocks remain in the group. After each data block is compressed, the reference data blocks of the same type in the second group are updated. After each data block is compressed, the reference data block at the same time point in the cycle in the third group is updated.
  • a certain number eg, 5-10
  • the similarity analysis module 621 may select a reference data block with higher similarity based on the similarity between the original data block and the reference data block (eg, content similarity, data similarity, etc.).
  • the similarity analysis module 621 can calculate the similarity between the original data block and the reference data block based on various similarity algorithms, such as Jaccard similarity algorithm, Cosine similarity algorithm, etc. Wait.
  • Jaccard similarity J(A, B) can be calculated by the following formula (3):
  • the symbol ⁇ means to obtain the intersection of set A and set B
  • the symbol ⁇ means to obtain the union of set A and set B.
  • the similarity analysis module 621 may calculate the similarity between the original data block and each reference data block, so as to select the reference data block with the highest similarity. In another embodiment, the similarity analysis module 621 may select a corresponding reference data block group based on the characteristics of the original data block, and calculate the similarity between the original data block and each reference data block in the reference data block group, Thus, the reference data block with the highest similarity in the group is selected. For example, if the data block to be compressed is text-type data, the similarity analysis module 621 may select the reference data block with the highest similarity with the original data block from the second group in FIG. 8 .
  • Step S702 acquiring the AI model associated with the selected reference data block.
  • the similarity analysis module 621 can obtain the AI model corresponding to the reference data block based on the association relationship between the reference data block and the AI model, and provide the AI model as the initial AI model of the original data block. to the probability prediction module 622.
  • step S703 the data block is compressed based on the compression model obtained according to the AI model associated with the selected reference data block to generate a compressed data block.
  • a compression model can be obtained from the probability prediction module 622 in FIG. 6 based on the initial AI model, and the occurrence probability of unit data in the data block to be compressed can be predicted by the compression model.
  • the probability prediction module 622 is in the form of software, the probability prediction module 622 is the code for realizing the probability prediction of the unit data in the data block based on the above-mentioned initial AI model. The code can be processed by the NPU in Figure 5 to perform this step.
  • the initial AI model can be directly used as the corresponding original data block.
  • AI models i.e. compressed models
  • the initial AI model can be further trained by obtaining partial data from the original data block until the model converges, and the training obtained
  • the AI model is used as a compressed model to make probabilistic predictions on this raw data block.
  • the model training process reference may be made to the above description of the training process of the RNN model.
  • part of the data in the original data block can be obtained by the NPU; a predetermined number of unit data in the partial data are input into the initial AI model to output the lower part of the predetermined number of unit data. The probability of occurrence of a unit of data.
  • the storage node 62 can train the initial AI model through the NPU according to the output of the initial AI model and the actual occurrence probability (ie the label value) of the next unit data of the predetermined number of unit data, so as to Get a trained AI model.
  • the model training will quickly make the model converge, so it takes less model training time.
  • the storage node 62 may use the compression model through the NPU to perform prediction of the occurrence probability of each unit data in the original data block, so as to be used based on each The occurrence probability of the unit data performs data compression on the original data block.
  • FIG. 9 is a schematic diagram of a process of data compression based on a compression model.
  • the length of the unit data in the data block is 1 byte. As mentioned above, since 1 byte has 8 bits in total, 1 byte can represent 256 unit data from 0 to 255. Assuming that the data block is text, and the 256 units of data are 256 characters. The text data block will be used as an example for description below. It can be understood that if the data block is an image and other types of data blocks, the processing process is the same. of.
  • the compression module when compressing the original data block, the first byte (ie, the first character) in the data block is first input into the compression module, which compresses the data based on, for example, an arithmetic coding algorithm, so The compression module needs to obtain the occurrence probability of each character in the data block to perform data compression based on the occurrence probability. Since there are no other characters before the first character in the data block, the AI model cannot predict the probability that the first character depends on the previous characters. Therefore, it can be preset that 256 characters have an average probability of occurrence ( That is, 1/256), so the compression module can encode the first character in the data block based on this average probability. It can be understood that this embodiment of the present invention is not limited to the above.
  • the occurrence probability of the 256 characters may be different. Therefore, the data block may be The first character is input into the compression model, and the occurrence probability of each character of 256 characters is output by the compression model, and the probability is output to the compression module.
  • the compression module may determine the occurrence probability of the first character based on the respective occurrence probability of the 256 characters, and encode the first character based on the occurrence probability.
  • the compression module While the compression module encodes the first character, the first character is also input to the compression model, so that the compression model predicts the respective 256 characters in the second byte of the original data block based on the first character. Depending on the appearance probability of the first character, after performing probability prediction, the compression model outputs the predicted appearance probability of each character corresponding to the second byte depending on the first character to the compression module.
  • the second character in the data block After the first character in the data block is input to the compression module, the second character in the data block is input into the compression module, and the compression module determines the second character in the data block based on the predicted probability of each character received from the compression model The probability of occurrence of , and encode the second character based on the probability of occurrence.
  • N characters in the data block can be encoded, thereby finally obtaining the compressed data block of the data block.
  • the compression model outputs the respective occurrence probabilities of 256 characters that depend on the previous character. It can be understood that the embodiment of the present invention is not limited to this. For example, it can be preset. For each byte in the original data block, the compression model outputs the respective probabilities of occurrence of 256 characters depending on the first two characters, the occurrence probability depending on the first three characters, and so on.
  • the compression model is preset to output 256 characters for each byte in the original data block, each of which depends on the occurrence probability of its first two characters, when the first character in the original data block is input to the compression model After that, the compression model outputs the occurrence probability of each of the 256 characters that depends on the first character.
  • the compression model outputs the 256 characters that depend on the first character.
  • the probability of occurrence of the first character and the second character when the third character in the original data block is input to the compression model, the compression model outputs the respective probabilities of occurrence of the second and third characters depending on the 256 characters ,and many more.
  • the compression module 623 in FIG. The blocks are compressed to generate compressed data blocks.
  • the compression module 623 can compress the data block based on the occurrence probability of the unit data in the data block through various entropy coding algorithms, for example, the entropy coding algorithm includes arithmetic coding algorithm, asynchronous numerical system algorithm, Huffman coding algorithm, etc. Arithmetic coding algorithms will be described herein as an example.
  • the data block to be compressed includes three characters a, b, and c arranged in sequence.
  • the character a is input into the compression module, and the average probability of 256 characters is input into the compression module.
  • the 256 characters are arranged in sequence in advance in the compression module, so that the probability interval corresponding to each character can be easily determined based on the probability of each character.
  • a is arranged in the 1st position of 256 characters
  • b is arranged in the 2nd position
  • c is arranged in the 3rd position.
  • Fig. 10 is a schematic diagram of the process of encoding the data block "abc" by the compression module.
  • the compression module After the compression module receives the probability of character a and character a (1/256), according to the arrangement position of character a in the 256 characters, the first interval of length 1 in the line segment with length 1/256 is ( 0, 0.004) is determined as the current coding interval, as shown in the left side of Fig. 10, where 1/256 is approximated as 0.004.
  • the character a When the character a is input into the compression module, the character a is also input into the compression model, and after the character a is input into the compression module, the second character b in the data block is input into the compression module.
  • the compression model After the compression model receives the character a, it is assumed that the probability of predicting each character that appears after a is a: 1/4, b: 2/4, c: 1/4, that is, the division characters a, b, and The probability of occurrence of other characters of c is 0.
  • the compression module divides the above-determined coding interval (0, 0.004) into corresponding characters a, b, and c based on the occurrence probability of the second character b in the data block and the arrangement position of character b in the 256 characters.
  • the character b While the character b is input into the compression module, the character b is also input into the compression model, and after the character b is input into the compression module, the third character c in the data block is input into the compression module.
  • the compression model predicts the occurrence probability of each character after character b based on the previous character (character b), assuming that the predicted probability of each character appearing after b is a: 1/5, b: 2/5, c: 2/5 , that is, the occurrence probability of other characters other than characters a, b, and c in the 256 characters is 0.
  • step S704 a compressed data package of the data block to be compressed is generated, and the compressed data package includes the compressed data block and compression model information.
  • the storage node 62 may generate a compressed data packet (also referred to as a compressed data block) of the data block to be compressed based on the compressed data block and the relevant information of the compression model used to compress the original data block. compressed package), so that the compressed data block can be decompressed through the compressed package to obtain the original data block.
  • a compressed data packet also referred to as a compressed data block
  • the storage node 62 may generate a compressed data packet (also referred to as a compressed data block) of the data block to be compressed based on the compressed data block and the relevant information of the compression model used to compress the original data block. compressed package), so that the compressed data block can be decompressed through the compressed package to obtain the original data block.
  • an identifier eg, number
  • the compressed data block and the initial AI model may also be included in the compressed data package.
  • the AI model can be obtained through the identifier of the initial AI model in the compressed data package for decompression.
  • the identifier of the AI model in the compressed data package it is not necessary to include the AI model (that is, all parameters of the AI model), thereby reducing the storage space required for storing the compressed data package, and greatly increasing the data compression rate, wherein,
  • the data compression rate is calculated by the following formula (4):
  • the post-training AI model the AI model obtained by training (hereinafter referred to as the post-training AI model) is used as the compression model for compressing the original data block
  • the post-training AI model and the initial AI model can be calculated first.
  • the storage node 62 may store the compressed data packet in the storage medium 63, and record the correspondence between the original data block and the storage address of the compressed data packet.
  • the computing node 61 may send the write data read request to the storage node 62 .
  • the storage node 62 determines the storage address of at least one compressed data packet corresponding to the write data, reads the compressed data packet, and uses the compression model for compressing the data block in the compressed data packet. information, obtain the compression model for compressing the data block, and use the compression model to decompress the compressed data block in the compressed data packet to obtain the original written data and return it to the computing node 61 .
  • FIG. 11 is a schematic diagram of a process of data decompression based on a compression model.
  • the storage node 62 obtains the compressed data block of the original data block from the compressed data packet.
  • the compressed data block is 0.0023, and is based on The compression model information for compressing the original data block in the compressed data package is obtained, and the compression model for compressing the original data block is obtained.
  • the probability of the first character of the original data block can be preset to be the average probability of 256 characters (that is, 1/256 ⁇ 0.004), and the storage node 62 inputs 0.0023 and the average probability to the decompression module, and Similarly to the compression module, the decompression module has pre-sorted 256 characters, wherein in the interval (0, 1), the interval (0, 0.004) is the interval corresponding to the character a, and the decompression module determines that the compressed data 0.0023 is in the interval (0, 0.004), so it can be determined that the first character of the original data is character a.
  • the compression model inputs the predicted probabilities of characters a, b, and c to the decompression module.
  • the decompression module can determine the sequence of the predetermined characters a, b, and c.
  • the character a The corresponding interval is the interval (0, 0.001) in the interval (0, 0.004) determined above, the interval corresponding to the character b is the interval (0.001, 0.003) in the interval (0, 0.004), and the interval corresponding to the character c is the interval The interval (0.003, 0.004) in (0, 0.004).
  • the compressed data block 0.0023 falls into the interval (0.001, 0.003) corresponding to the character b. Therefore, the decompression module can determine that the second character in the original data block is the character b.
  • the predicted character b is input into the compression model, so that the compression model can predict the prediction probability of each character corresponding to the third byte.
  • the decompression module can determine that in the above determined interval (0.001, 0.003), the character a corresponds to the interval (0.001, 0.0014), the character b corresponds to the interval (0.0014, 0.0022), and the character c corresponds to the interval (0.001, 0.0014).
  • the interval (0.0022, 0.003) since the compressed data block 0.0023 falls into the interval (0.0022, 0.003) corresponding to the character c, the decompression module can determine that the third character of the original data block is the character c.
  • the storage node 62 After the decompression module sequentially outputs all characters (ie, abc) of the original data block, the storage node 62 completes the process of decompressing the compressed data block, and obtains the original data block. After that, the storage node 62 returns the original data block obtained by decompressing the data to the application node 61 as a response to the above read request.
  • the data processing scheme of the embodiment of the present invention is described above by taking the process of compressing and decompressing stored data in the storage system as an example. With this scheme, the data compression time can be saved and the data compression rate can be greatly improved. It can be understood that the data processing solutions in the embodiments of the present invention are not limited to being used in storage nodes as described above, but can be used in other scenarios and other devices.
  • the user's mobile terminal can save the original data after compressing the original data through the data compression scheme of the embodiment of the present invention, thereby saving the data storage time of the mobile terminal and improving the user's use experience.
  • FIG. 12 is an architectural diagram of a data processing apparatus provided by an embodiment of the present invention.
  • the data processing apparatus is configured to execute the data processing method shown in FIG. 7 .
  • Executable code is stored in the cell,
  • the processing unit 1201 is configured to execute the executable code to implement: selecting the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block; acquiring the first reference data block associated with the first reference data block model; compressing the first data block based on the compression model to generate a first compressed data block, the compression model is obtained according to the first model; generating a first compressed data packet, the first compressed data packet includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
  • the processing unit 1201 is configured to execute executable code to implement, based on a compression model, compress the first data block to generate a first compressed data block, and the compression model is based on the first data block.
  • the processing unit 1201 is configured to execute executable code to implement: using the first model as a compression model, compressing the first data block, and generating a first compressed data block.
  • the processing unit 1201 is configured to execute executable code to implement, based on a compression model, compress the first data block to generate a first compressed data block, and the compression model is based on the first data block.
  • Obtaining a model specifically: the processing unit 1201 is configured to execute executable code to implement using the second model as a compression model, compress the first data block, and generate a first compressed data block, and the second model is obtained by using Part of the data in the first data block is obtained by training the first model.
  • the processing unit 1201 is further configured to execute executable code to implement: storing the first data block as a reference data block, storing compression model information, and associating the stored first data block with the stored compression model information storage.
  • the processing unit 1201 includes a neural network processor 1203; the processing unit 1201 is configured to execute executable codes to implement compression of the first data block based on the first model, specifically: a neural network processor 1203 is used for executing the executable code to implement the compression of the first data block based on the first model.
  • the processing unit 1201 is further configured to execute executable code to achieve: obtaining the first compressed data packet; obtaining the compression model according to the compression model information in the first compressed data packet; The first compressed data block in a compressed data packet is decompressed to obtain the first data block.
  • FIG. 13 is an architectural diagram of a data processing apparatus provided by an embodiment of the present application.
  • the data processing apparatus is configured to execute the data processing method shown in FIG. 7 , and the data processing apparatus includes:
  • a selection unit 131 configured to select the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block;
  • an obtaining unit 132 configured to obtain the first model associated with the first reference data block
  • a compression unit 133 configured to compress the first data block based on a compression model to generate a first compressed data block, and the compression model is obtained according to the first model;
  • the generating unit 134 is configured to generate a first compressed data packet, where the first compressed data packet includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
  • the compressing unit 133 is specifically configured to: predict the occurrence probability of the unit data in the first data block based on the compression model; according to the occurrence probability of the unit data in the first data block probability, and compressing the first data block to generate a first compressed data block.
  • the compression unit 133 is specifically configured to: adopt the second model as a compression model, compress the first data block, and generate a first compressed data block, and the second model uses the Part of the data in the first data block is obtained by training the first model.
  • the data processing apparatus further includes: a storage unit 135, configured to store the first data block as a reference data block, and store compression model information, where the stored first data block is stored in association with the stored compression model information .
  • the data processing apparatus includes a neural network processor; the compression unit 133 is deployed in the neural network processor.
  • the obtaining unit 132 is further configured to obtain the first compressed data packet, and obtain the compression model according to the relevant information of the compression model in the first compressed data packet
  • the data processing apparatus further includes a decompression unit 136 , which is used to decompress the first compressed data block in the first compressed data packet by using the compression model to obtain the first data block.
  • each unit in the data processing apparatus shown in FIG. 13 may have the form of software, hardware, or firmware, which is not limited in this embodiment of the present invention.
  • the present application further provides a computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed in a computer or a processor, the computer or processor is caused to execute the description in the above referenced drawings. Methods.
  • the present application also provides a computer program product, which, when the computer program product is executed in a computer or a processor, causes the computer or the processor to execute the method described above with reference to the figures.
  • FIG. 14 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention.
  • the data processing apparatus may include a processor 110 , an internal memory 120 , a connection module 130 , a display 140 and an interface module 150 .
  • the data processing apparatus may also include other modules or components, such as audio modules, etc., which are not shown in FIG. 14 . It can be understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the data processing apparatus. In other embodiments of the present application, the data processing apparatus may include more or less components than those shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a GPU, an image signal processor (image signal processor, ISP), a CPU , at least one of video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or NPU, etc.
  • CPU, ISP, NPU and GPU are schematically shown in processor 110 in FIG. 14 , which can be connected via a bus.
  • different processing units may be independent devices, or may be integrated in one or more processors.
  • the processor 110 may be a chip or chipset.
  • the application processor may be the CPU.
  • a memory may also be provided in the processor 110 for storing instructions and data. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated memory accesses outside the processor 110 are avoided, reducing the latency of the processor 110, thereby increasing the efficiency of the system.
  • Internal memory 120 also called main memory, may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes various functional applications and data processing of the data processing apparatus by executing the instructions stored in the internal memory 120 .
  • the internal memory 120 may include a program storage area and a data storage area. Wherein, the storage program area can store the operating system, the code of the application program, etc. For example, as shown in FIG. 14, the program storage area of the internal memory 120 stores the following modules for executing the method shown in FIG.
  • the selection module 121 for selecting the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block; the obtaining module 122 is used to obtain the first model associated with the first reference data block; the compression module 123, for compressing the first data block based on a compression model to generate a first compressed data block, where the compression model is obtained according to the first model; a generating module 124, for generating a first compressed data packet , the first compressed data packet includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
  • the internal memory 120 may include random access memory (Random Access Memory, RAM), such as double-rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random Access Memory, DDR Memory), and may also include non-volatile memory, such as At least one disk storage device, flash memory device, universal flash storage (universal flash storage, UFS), etc.
  • RAM Random Access Memory
  • DDR Memory Double-rate synchronous dynamic random access memory
  • non-volatile memory such as At least one disk storage device, flash memory device, universal flash storage (universal flash storage, UFS), etc.
  • connection module 130 may be used for wired connection and wireless local area networks (wireless local area networks, WLAN) and the like.
  • the display screen 140 is used to display text, images, videos, and the like.
  • the display screen 140 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light).
  • the interface module 150 includes, for example, various interfaces such as an external memory interface and a USB interface.
  • an embodiment of the present invention provides a terminal-cloud system architecture 300 .
  • the execution device 210 is implemented by one or more servers, and optionally, cooperates with other data processing devices, such as data storage, routers, load balancers and other devices; the execution device 210 may be arranged on a physical site, or distributed in multiple locations. on a physical site.
  • the execution device 210 may use the data in the data storage system 250, or invoke the program code in the data storage system 250 to implement the method shown in FIG. 7 .
  • a user may operate respective user devices (e.g., local device 301 and local device 302) to interact with execution device 210.
  • Each local device may represent any computing device, such as a personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box, gaming console, etc.
  • Each user's local device can interact with the execution device 210 through any communication mechanism/standard communication network, which can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
  • any communication mechanism/standard communication network which can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
  • one or more aspects of the execution device 210 may be implemented by each local device, for example, the local device 301 may provide the execution device 210 with local data or feedback calculation results.
  • the local device 301 implements the functions of the execution device 210 and provides services for its own users, or provides services for the users of the local device 302 .
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line, or wireless (eg, infrared, wireless, microwave, etc.) means.
  • the computer-readable storage medium may be a computer Any available medium that can be accessed or a data storage device such as a server, data center, etc., that contains one or more of the available mediums integrated.
  • the disclosed apparatus and method may be implemented in other manners without exceeding the scope of the present application.
  • the above-described embodiments are only illustrative.
  • the division of the modules or units is only a logical function division.
  • multiple units or components may be combined. Either it can be integrated into another system, or some features can be omitted, or not implemented.
  • the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units .
  • Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A data processing method and apparatus in the field of artificial intelligence. The method comprises: selecting a first reference data block on the basis of the similarity between a data block to be compressed and each pre-stored reference data block; obtaining a first model associated with the first reference data block; and obtaining a compression model according to the first model, compressing, on the basis of the compression model, the data block to be compressed to generate a compressed data block, and generating a compressed data packet comprising the compressed data block and compression model information. The data processing method reduces the data compression duration, and improves the data compression performance.

Description

数据处理方法和装置Data processing method and device 技术领域technical field
本申请涉及人工智能技术领域,具体涉及一种数据处理方法和装置。The present application relates to the technical field of artificial intelligence, and in particular, to a data processing method and apparatus.
背景技术Background technique
人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。换句话说,人工智能是计算机科学的一个分支,它企图了解智能的实质,使机器具有感知、推理与决策的功能。Artificial Intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and enable machines to perceive, reason and make decisions.
近年来,出现了结合AI模型进行数据压缩的方案。但是,由于需要时间对AI模型进行训练,结合AI模型进行数据压缩的方案往往存在数据压缩的时间长,压缩性能较差的问题。In recent years, schemes for data compression combined with AI models have emerged. However, since it takes time to train the AI model, the data compression scheme combined with the AI model often has the problem of long data compression time and poor compression performance.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种数据处理方法,使得可以减少数据压缩的时长,提高数据压缩性能。The embodiment of the present invention provides a data processing method, which can reduce the data compression time and improve the data compression performance.
本发明实施例的第一方面提供一种数据处理方法,其特征在于,包括:基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块;获取与第一参考数据块相关联的第一模型;基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,压缩模型为根据第一模型获得;生成第一压缩数据包,第一压缩数据包中包括第一压缩数据块和压缩模型信息,压缩模型信息为根据压缩模型获得。A first aspect of the embodiments of the present invention provides a data processing method, which is characterized by comprising: selecting a first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block; a first model associated with a reference data block; based on the compression model, compress the first data block to generate a first compressed data block, and the compression model is obtained according to the first model; generate a first compressed data packet, the first compressed data The package includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
在本申请第一方面的一种可能的实现方式中,第一模型可以直接以第一模型的形式存储,或者第一模型可以以第一模型的相似模型及该相似模型与第一模型的差异数据的形式存储,其中,通过对第一模型的相似模型及该相似模型与第一模型的差异数据进行处理可获取第一模型。In a possible implementation manner of the first aspect of the present application, the first model may be directly stored in the form of the first model, or the first model may be a similar model of the first model and the difference between the similar model and the first model The data is stored in the form of data, wherein the first model can be obtained by processing the similar model of the first model and the difference data between the similar model and the first model.
在本申请第一方面的一种可能的实现方式中,压缩模型与第一模型不一定等同,在使用第一模型对第一数据块进行压缩的情况中,压缩模型与第一模型等同,或者,在使用对第一模型进行优化或训练后的模型对第一数据块进行压缩的情况中,该压缩模型为优化或训练后的模型。In a possible implementation manner of the first aspect of the present application, the compression model is not necessarily equal to the first model, and in the case of using the first model to compress the first data block, the compression model is equal to the first model, or , in the case of compressing the first data block by using the model after the optimization or training of the first model, the compression model is the model after optimization or training.
在本申请第一方面的一种可能的实现方式中,基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块包括,基于待压缩的第一数据块与预存的各个参考数据块的内容相似度,选择第一参考数据块。可基于各种相似度算法来计算第一数据块与参考数据块的相似度,所述相似度算法例如包括杰卡德(Jaccard)相似度算法、余弦(Cosine)相似度算法等。In a possible implementation manner of the first aspect of the present application, selecting the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block includes, based on the first data block to be compressed The first reference data block is selected according to the content similarity with each pre-stored reference data block. The similarity between the first data block and the reference data block may be calculated based on various similarity algorithms, for example, the similarity algorithm includes a Jaccard similarity algorithm, a Cosine similarity algorithm, and the like.
通过选择与待压缩的数据块相似度最高的参考数据块,并基于与该参考数据块对应的模型进行对待压缩数据块的数据压缩,减少了训练模型的时间,从而减少了数据 压缩的时长。By selecting the reference data block with the highest similarity with the data block to be compressed, and compressing the data block to be compressed based on the model corresponding to the reference data block, the training time of the model is reduced, thereby reducing the data compression time.
在本申请第一方面的一种可能的实施方式中,基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,具体为,基于压缩模型预测第一数据块中的单位数据的出现概率;根据第一数据块中的单位数据的出现概率,对第一数据块进行压缩,生成第一压缩数据块。通过基于压缩模型预测第一数据块中的单位数据的出现概率,减少了训练模型的时长,提高了数据压缩性能。In a possible implementation manner of the first aspect of the present application, the first data block is compressed based on the compression model to generate the first compressed data block. Specifically, the compression model is used to predict the unit data in the first data block. Occurrence probability: According to the occurrence probability of the unit data in the first data block, the first data block is compressed to generate the first compressed data block. By predicting the occurrence probability of the unit data in the first data block based on the compression model, the training time of the model is reduced, and the data compression performance is improved.
在本申请第一方面的一种可能的实施方式中,基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,压缩模型为根据第一模型获得,具体为:采用第一模型作为压缩模型,对第一数据块进行压缩,生成第一压缩数据块。当待压缩的第一数据块与第一参考数据块的相似度较高时,例如,待压缩的第一数据块与第一参考数据块的相似度大于阈值时,使用第一模型作为压缩模型,对第一数据块进行压缩,无需对模型进行再训练,减少了训练模型的时长,提高了数据压缩性能。In a possible implementation of the first aspect of the present application, the first data block is compressed based on the compression model to generate the first compressed data block, and the compression model is obtained according to the first model, specifically: using the first model As the compression model, the first data block is compressed to generate the first compressed data block. When the similarity between the first data block to be compressed and the first reference data block is high, for example, when the similarity between the first data block to be compressed and the first reference data block is greater than a threshold, the first model is used as the compression model , compressing the first data block without retraining the model, reducing the training time of the model and improving the data compression performance.
在本申请第一方面的一种可能的实施方式中,压缩模型信息包括第一模型或者第一模型的标识。通过在压缩模型信息中包括第一模型的标识,减少了压缩数据包的数据量,节省了存储空间,提高了压缩率。In a possible implementation manner of the first aspect of the present application, the compressed model information includes the first model or an identifier of the first model. By including the identifier of the first model in the compressed model information, the data volume of the compressed data packet is reduced, the storage space is saved, and the compression rate is improved.
在本申请第一方面的一种可能的实施方式中,基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,压缩模型为根据第一模型获得,具体为:采用第二模型作为压缩模型,对第一数据块进行压缩,生成第一压缩数据块,第二模型通过使用第一数据块中的部分数据训练第一模型获得。In a possible implementation of the first aspect of the present application, the first data block is compressed based on the compression model to generate the first compressed data block, and the compression model is obtained according to the first model, specifically: using the second model As the compression model, the first data block is compressed to generate the first compressed data block, and the second model is obtained by training the first model using part of the data in the first data block.
通过使用第一数据块中的部分数据训练第一模型以获取用于对第一数据块进行压缩的第二模型,提高了模型的预测准确度,由于第一数据块与第一参考数据块具有较大的相似度,因此该训练过程耗时较短,提高了数据压缩性能。By using part of the data in the first data block to train the first model to obtain the second model for compressing the first data block, the prediction accuracy of the model is improved, since the first data block and the first reference data block have Therefore, the training process takes less time and improves the data compression performance.
在本申请第一方面的一种可能的实施方式中,压缩模型信息包括以下任一项:第二模型;第二模型的标识;第一模型的标识、及第二模型与第一模型的差异数据。其中,在将第一数据块作为参考数据块与第二模型关联地存储的情况中,可以在压缩模型信息中包括第二模型的标识。通过在压缩模型信息中包括第一模型的标识以及第二模型与第一模型的差异数据,减少了压缩数据包的数据量,节省了存储空间,提高了压缩率。In a possible implementation of the first aspect of the present application, the compressed model information includes any one of the following: the second model; the identifier of the second model; the identifier of the first model, and the difference between the second model and the first model data. Wherein, in the case where the first data block is stored as a reference data block in association with the second model, an identifier of the second model may be included in the compressed model information. By including the identifier of the first model and the difference data between the second model and the first model in the compressed model information, the data volume of the compressed data packet is reduced, the storage space is saved, and the compression rate is improved.
在本申请第一方面的一种可能的实施方式中,多个参考数据块包括以下至少一种数据块:压缩的数据块、不同数据类型的数据块、周期的不同时间点的数据块。其中,压缩的数据块可以为最近一段时间内压缩的数据块,其中,时间段的长度可根据存储空间的大小灵活确定。作为与待压缩数据块的时间上相邻的数据块,有可能与待压缩数据块具有较大的相似度,不同类型数据例如包括图片、文本、数据库等类型,周期中不同时间点的数据块为在数据进行周期性变化的场景中在一个周期中的若干时间点的数据块。可以根据存储空间的大小,灵活确定存储的参考数据块的数量。In a possible implementation manner of the first aspect of the present application, the multiple reference data blocks include at least one of the following data blocks: compressed data blocks, data blocks of different data types, and data blocks of different time points in a period. The compressed data block may be a compressed data block within a recent period of time, wherein the length of the time period may be flexibly determined according to the size of the storage space. As a temporally adjacent data block to the to-be-compressed data block, it may have a greater similarity with the to-be-compressed data block. Different types of data include, for example, pictures, text, databases, etc., and data blocks at different time points in the cycle It is a data block at several time points in a cycle in a scenario where the data changes periodically. The number of stored reference data blocks can be flexibly determined according to the size of the storage space.
通过从时间和空间的维度选取参考数据块,更便于获取与待压缩数据块相似度更高的参考数据块,从而减少模型训练的耗时。By selecting reference data blocks from the dimensions of time and space, it is easier to obtain reference data blocks that are more similar to the data blocks to be compressed, thereby reducing model training time.
在本申请第一方面的一种可能的实施方式中,本申请第一方面提供的方法还包括:存储第一数据块作为参考数据块,存储压缩模型信息,存储的第一数据块与存储的压 缩模型信息关联存储。其中,可存储压缩模型自身作为压缩模型信息,或者可存储压缩模型与已存储的其它相似模型的差异数据和该相似模型的标识作为压缩模型信息。另外,存储的第一数据块与存储的压缩模型信息关联存储指在找到存储的第数据块时,能够进一步找到存储的压缩模型,但不限于将存储的第一数据块与存储的压缩模型信息存储在一起。In a possible implementation manner of the first aspect of the present application, the method provided in the first aspect of the present application further includes: storing the first data block as a reference data block, storing compression model information, and storing the stored first data block with the stored Compressed model information associative storage. Wherein, the compressed model itself can be stored as the compressed model information, or the difference data between the compressed model and other stored similar models and the identifier of the similar model can be stored as the compressed model information. In addition, storing the stored first data block in association with the stored compression model information means that when the stored first data block is found, the stored compression model can be further found, but it is not limited to associating the stored first data block with the stored compression model information stored together.
通过在每次压缩数据之后更新参考数据块,从而便于为后续的待压缩数据块提供相似度较高的参考数据块。By updating the reference data block after each compression of data, it is convenient to provide reference data blocks with higher similarity for subsequent data blocks to be compressed.
在本申请第一方面的一种可能的实施方式中,本申请第一方面提供的方法由计算设备执行,该计算设备中包括神经网络处理器,该神经网络处理器基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块。In a possible implementation manner of the first aspect of the present application, the method provided by the first aspect of the present application is executed by a computing device, and the computing device includes a neural network processor, and the neural network processor is based on a compression model. The data block is compressed to generate a first compressed data block.
通过使用神经网络处理器处理第一模型的运行,加速了模型压缩过程,减少了数据压缩的时长。By using the neural network processor to process the running of the first model, the model compression process is accelerated, and the duration of data compression is reduced.
在本申请第一方面的一种可能的实施方式中,本申请第一方面提供的方法还包括:获取第一压缩数据包;根据第一压缩数据包中的压缩模型信息,获取压缩模型;通过压缩模型对第一压缩数据包中的第一压缩数据块进行解压缩,获取第一数据块。In a possible implementation manner of the first aspect of the present application, the method provided by the first aspect of the present application further includes: obtaining a first compressed data packet; obtaining a compression model according to compression model information in the first compressed data packet; The compression model decompresses the first compressed data block in the first compressed data packet to obtain the first data block.
本申请第二方面提供一种数据处理装置,包括处理单元和存储单元,存储单元中存储有可执行代码,处理单元用于执行可执行代码以实现:基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块;获取与第一参考数据块相关联的第一模型;基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,压缩模型为根据第一模型获得;生成第一压缩数据包,第一压缩数据包中包括第一压缩数据块和压缩模型信息,压缩模型信息为根据压缩模型获得。A second aspect of the present application provides a data processing apparatus, including a processing unit and a storage unit, the storage unit stores executable code, and the processing unit is configured to execute the executable code to achieve: based on the first data block to be compressed and the pre-stored the similarity of each reference data block, select the first reference data block; obtain the first model associated with the first reference data block; compress the first data block based on the compression model, generate the first compressed data block, and compress the model To obtain according to the first model; generate a first compressed data packet, the first compressed data packet includes a first compressed data block and compression model information, and the compression model information is obtained according to the compression model.
在本申请第二方面的一种可能的实现方式中,处理单元用于执行可执行代码以实现基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,具体为,处理单元用于执行可执行代码以实现:基于压缩模型,预测第一数据块中的单位数据的出现概率;根据第一数据块中的单位数据的出现概率,对第一数据块进行压缩,生成第一压缩数据块。In a possible implementation manner of the second aspect of the present application, the processing unit is configured to execute executable code to compress the first data block based on the compression model to generate the first compressed data block. Specifically, the processing unit uses in executing the executable code to achieve: predicting the occurrence probability of the unit data in the first data block based on the compression model; compressing the first data block according to the occurrence probability of the unit data in the first data block to generate a first compressed data block.
在本申请第二方面的一种可能的实现方式中,处理单元用于执行可执行代码以实现基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,压缩模型为根据第一模型获得,具体为:处理单元用于执行可执行代码以实现采用第一模型作为压缩模型,对第一数据块进行压缩,生成第一压缩数据块。In a possible implementation manner of the second aspect of the present application, the processing unit is configured to execute the executable code to compress the first data block based on the compression model to generate the first compressed data block, and the compression model is based on the first data block. The obtaining of the model is specifically: the processing unit is configured to execute the executable code to implement using the first model as the compression model, compress the first data block, and generate the first compressed data block.
在本申请第二方面的一种可能的实现方式中,处理单元用于执行可执行代码以实现基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,压缩模型为根据第一模型获得,具体为:处理单元用于执行可执行代码以实现采用第二模型作为压缩模型,对第一数据块进行压缩,生成第一压缩数据块,第二模型通过使用第一数据块中的部分数据训练第一模型获得。In a possible implementation manner of the second aspect of the present application, the processing unit is configured to execute the executable code to compress the first data block based on the compression model to generate the first compressed data block, and the compression model is based on the first data block. The model is obtained, specifically: the processing unit is configured to execute the executable code to implement the use of the second model as the compression model, compress the first data block, and generate the first compressed data block, and the second model uses the first data block. Part of the data is obtained by training the first model.
在本申请第二方面的一种可能的实现方式中,处理单元还用于执行可执行代码以实现:存储第一数据块作为参考数据块,存储压缩模型信息,存储的第一数据块与存储的压缩模型信息关联存储。In a possible implementation manner of the second aspect of the present application, the processing unit is further configured to execute executable codes to implement: storing the first data block as a reference data block, storing compression model information, and storing the first data block stored with the storage Compressed model information for associative storage.
在本申请第二方面的一种可能的实现方式中,处理单元包括神经网络处理器;处 理单元用于执行可执行代码以实现基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块。具体为:神经网络处理器用于执行可执行代码以实现基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块。In a possible implementation manner of the second aspect of the present application, the processing unit includes a neural network processor; and the processing unit is configured to execute executable codes to implement compression of the first data block based on the compression model to generate the first compressed data piece. Specifically, the neural network processor is configured to execute the executable code to compress the first data block based on the compression model to generate the first compressed data block.
在本申请第二方面的一种可能的实现方式中,处理单元还用于执行可执行代码以实现:获取第一压缩数据包;根据第一压缩数据包中的压缩模型信息,获取压缩模型;通过压缩模型对第一压缩数据包中的第一压缩数据块进行解压缩,获取第一数据块。In a possible implementation manner of the second aspect of the present application, the processing unit is further configured to execute executable code to achieve: obtaining the first compressed data packet; obtaining the compression model according to the compression model information in the first compressed data packet; Decompress the first compressed data block in the first compressed data packet by using the compression model to obtain the first data block.
本申请第三方面提供一种数据处理装置,包括:选择单元,用于基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块;获取单元,用于获取与第一参考数据块相关联的第一模型;压缩单元,用于基于压缩模型,对第一数据块进行压缩,生成第一压缩数据块,压缩模型为根据第一模型获得;生成单元,用于生成第一压缩数据包,第一压缩数据包中包括第一压缩数据块和压缩模型信息,压缩模型信息为根据压缩模型获得。A third aspect of the present application provides a data processing apparatus, comprising: a selection unit for selecting a first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block; an acquisition unit for obtaining a first model associated with the first reference data block; a compression unit, configured to compress the first data block based on the compression model to generate a first compressed data block, and the compression model is obtained according to the first model; the generating unit, It is used to generate a first compressed data packet, where the first compressed data packet includes a first compressed data block and compression model information, and the compression model information is obtained according to the compression model.
在本申请第三方面的一种可能的实现方式中,压缩单元具体用于:基于压缩模型,预测第一数据块中的单位数据的出现概率;根据第一数据块中的单位数据的出现概率,对第一数据块进行压缩,生成第一压缩数据块。In a possible implementation manner of the third aspect of the present application, the compression unit is specifically configured to: predict the occurrence probability of the unit data in the first data block based on the compression model; according to the occurrence probability of the unit data in the first data block , compress the first data block to generate the first compressed data block.
在本申请第三方面的一种可能的实现方式中,压缩单元具体用于:采用第一模型作为压缩模型,对第一数据块进行压缩,生成第一压缩数据块。In a possible implementation manner of the third aspect of the present application, the compression unit is specifically configured to: use the first model as the compression model, compress the first data block, and generate the first compressed data block.
在本申请第三方面的一种可能的实现方式中,压缩单元具体用于:采用第二模型作为压缩模型,对第一数据块进行压缩,生成第一压缩数据块,第二模型通过使用第一数据块中的部分数据训练第一模型获得。In a possible implementation manner of the third aspect of the present application, the compression unit is specifically configured to: adopt the second model as the compression model, compress the first data block, and generate the first compressed data block, and the second model uses the first data block as the compression model to compress the first data block. Part of the data in a data block is obtained by training the first model.
在本申请第三方面的一种可能的实现方式中,本申请第三方面提供的装置还包括:存储单元,用于存储第一数据块作为参考数据块,存储压缩模型信息,存储的第一数据块与存储的压缩模型信息关联存储。In a possible implementation manner of the third aspect of the present application, the apparatus provided in the third aspect of the present application further includes: a storage unit, configured to store the first data block as a reference data block, store compression model information, and store the first data block as a reference data block. Data blocks are stored in association with stored compression model information.
在本申请第三方面的一种可能的实现方式中,本申请第三方面提供的装置包括神经网络处理器;压缩单元部署于神经网络处理器中。In a possible implementation manner of the third aspect of the present application, the apparatus provided by the third aspect of the present application includes a neural network processor; the compression unit is deployed in the neural network processor.
在本申请第三方面的一种可能的实现方式中,获取单元还用于,获取第一压缩数据包,根据第一压缩数据包中的压缩模型信息,获取压缩模型,本申请第三方面提供的装置还包括解压缩单元,用于通过压缩模型对第一压缩数据包中的第一压缩数据块进行解压缩,获取第一数据块。In a possible implementation manner of the third aspect of the present application, the obtaining unit is further configured to obtain the first compressed data packet, and obtain the compression model according to the compression model information in the first compressed data packet. The third aspect of the present application provides The apparatus further includes a decompression unit, configured to decompress the first compressed data block in the first compressed data packet by using the compression model to obtain the first data block.
本申请第四方面提供一种计算机可读存储介质,其上存储有计算机程序,其特征在于,当所述计算机程序在计算机或处理器中执行时,令所述计算机或处理器执行上述第一方面所述的方法。A fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed in a computer or a processor, the computer or processor is caused to execute the above-mentioned first the method described in the aspect.
本申请第五方面提供一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机或处理器中运行时,使得所述计算机或处理器执行上述第一方面所述的方法。A fifth aspect of the present application provides a computer program product, characterized in that, when the computer program product runs in a computer or a processor, the computer or processor is caused to execute the method described in the first aspect.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前 提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1示出一种人工智能主体框架示意图;Fig. 1 shows a schematic diagram of an artificial intelligence main frame;
图2为本发明实施例提供的一种系统架构示意图;2 is a schematic diagram of a system architecture provided by an embodiment of the present invention;
图3为RNN模型的结构示意图;Fig. 3 is the structural schematic diagram of RNN model;
图4为RNN模型的模型预测示意图;Fig. 4 is the model prediction schematic diagram of RNN model;
图5是本发明实施例提供的一种NPU芯片硬件结构图;5 is a hardware structure diagram of an NPU chip provided by an embodiment of the present invention;
图6为本发明实施例提供的存储系统架构图;FIG. 6 is an architecture diagram of a storage system provided by an embodiment of the present invention;
图7为本发明实施例提供的一种数据压缩方法的流程图;7 is a flowchart of a data compression method provided by an embodiment of the present invention;
图8为存储节点中预存的数据块-模型的示意图;8 is a schematic diagram of a data block-model pre-stored in a storage node;
图9为基于AI模型进行数据压缩的过程示意图;9 is a schematic diagram of a process of data compression based on an AI model;
图10为压缩模块对数据块进行编码的过程示意图;FIG. 10 is a schematic diagram of a process of encoding a data block by a compression module;
图11为基于AI模型进行数据解压缩的过程示意图;Figure 11 is a schematic diagram of the process of data decompression based on the AI model;
图12为本发明实施例提供的一种数据处理装置的架构图;FIG. 12 is an architectural diagram of a data processing apparatus according to an embodiment of the present invention;
图13为本发明实施例提供的一种数据处理装置的架构图;13 is an architectural diagram of a data processing apparatus provided by an embodiment of the present invention;
图14为本发明实施例提供的数据处理装置的结构示意图;14 is a schematic structural diagram of a data processing apparatus provided by an embodiment of the present invention;
图15为本发明实施例提供的一种端云系统架构。FIG. 15 is a terminal-cloud system architecture provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
图1示出一种人工智能主体框架示意图,该主体框架描述了人工智能系统总体工作流程,适用于通用的人工智能领域需求。Figure 1 shows a schematic diagram of an artificial intelligence main frame, which describes the overall workflow of an artificial intelligence system and is suitable for general artificial intelligence field requirements.
下面从“智能信息链”(水平轴)和“互联网技术(Internet Technology,IT)价值链”(垂直轴)两个维度对上述人工智能主题框架进行阐述。The above-mentioned artificial intelligence theme framework will be elaborated below from the two dimensions of "intelligent information chain" (horizontal axis) and "Internet Technology (IT) value chain" (vertical axis).
“智能信息链”反映从数据的获取到处理的一系列过程。举例来说,可以是智能信息感知、智能信息表示与形成、智能推理、智能决策、智能执行与输出的一般过程。在这个过程中,数据经历了“数据—信息—知识—智慧”的凝练过程。The "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it can be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, data has gone through the process of "data-information-knowledge-wisdom".
“IT价值链”从人工智能的底层基础设施、信息(提供和处理技术实现)到系统的产业生态过程,反映人工智能为信息技术产业带来的价值。The "IT value chain" from the underlying infrastructure of artificial intelligence, information (providing and processing technology implementation) to the industrial ecological process of the system reflects the value brought by artificial intelligence to the information technology industry.
所述人工智能主体框架中包括以下几个主要构成部分:The artificial intelligence main frame includes the following main components:
(1)基础设施(1) Infrastructure
基础设施为人工智能系统提供计算能力支持,实现与外部世界的沟通,并通过基础平台实现支撑。所述基础设施包括:传感器,用于与外部沟通;智能芯片(中央处理器(Central processing unit,CPU)、图形处理器(Graphics processing unit,GPU)、神经网络处理器(Neural-network process unit,NPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编辑逻辑门阵列(Field Programmable Gate Array,FPGA)等硬件加速芯片),用于提供计算能力;基础平台,包括分布式计算 框架及网络等相关的平台保障和支持,可以包括云存储和计算、互联互通网络等。举例来说,传感器与外部沟通获取数据,将这些数据提供给基础平台提供的分布式计算系统中的智能芯片进行计算。The infrastructure provides computing power support for artificial intelligence systems, realizes communication with the outside world, and supports through the basic platform. The infrastructure includes: sensors for communicating with the outside; intelligent chips (Central processing unit (CPU), graphics processing unit (Graphics processing unit, GPU), neural-network process unit (Neural-network process unit, NPU), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (Field Programmable Gate Array, FPGA) and other hardware acceleration chips), used to provide computing power; basic platform, including distributed computing framework and Network and other related platform guarantees and support can include cloud storage and computing, interconnection networks, etc. For example, the sensor communicates with the outside to obtain data, and provides the data to the intelligent chip in the distributed computing system provided by the basic platform for calculation.
(2)数据(2) Data
基础设施的上一层的数据用于表示人工智能领域的数据来源。数据涉及到图形、图像、语音、文本,还涉及到传统设备的物联网数据,包括已有系统的业务数据以及力、位移、液位、温度、湿度等感知数据。The data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, and text, as well as IoT data from traditional devices, including business data from existing systems and sensory data such as force, displacement, liquid level, temperature, and humidity.
(3)数据处理(3) Data processing
数据处理通常包括数据训练,机器学习,深度学习,搜索,推理,决策等方式。Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.
其中,机器学习和深度学习可以对数据进行符号化和形式化的智能信息建模、抽取、预处理、训练等。Among them, machine learning and deep learning can perform symbolic and formalized intelligent information modeling, extraction, preprocessing, training, etc. on data.
推理是指在计算机或智能系统中,模拟人类的智能推理方式,依据推理控制策略,利用形式化的信息进行机器思维和求解问题的过程,典型的功能是搜索与匹配。Reasoning refers to the process of simulating human's intelligent reasoning method in a computer or intelligent system, using formalized information to carry out machine thinking and solving problems according to the reasoning control strategy, and the typical function is search and matching.
决策是指对智能信息经过推理后进行决策的过程,通常提供分类、排序、预测等功能。Decision-making refers to the process of making decisions after reasoning about intelligent information, usually providing functions such as classification, sorting, and prediction.
(4)通用能力(4) General ability
对数据经过上面提到的数据处理后,进一步基于数据处理的结果可以形成一些通用能力,其可以是算法或者通用系统,例如,翻译,文本的分析,计算机视觉的处理,语音识别,图像的识别等等。After the data is processed as mentioned above, some general capabilities can be formed based on the results of the data processing, which can be algorithms or general systems, such as translation, text analysis, computer vision processing, speech recognition, and image recognition. and many more.
(5)智能产品及行业应用(5) Smart products and industry applications
智能产品及行业应用指人工智能系统在各领域的产品和应用,是对人工智能整体解决方案的封装,将智能信息决策产品化、实现落地应用,其应用领域主要包括:智能制造、智能交通、智能家居、智能医疗、智能安防、自动驾驶,平安城市,智能终端等。Intelligent products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, and the productization of intelligent information decision-making and implementation of applications. Its application areas mainly include: intelligent manufacturing, intelligent transportation, Smart home, smart medical care, smart security, autonomous driving, safe city, smart terminals, etc.
参见图2,本发明实施例提供了一种系统架构200。数据采集设备260用于采集AI模型样本数据并存入数据库230,训练设备220基于数据库230中维护的样本数据生成目标模型/规则201。Referring to FIG. 2 , an embodiment of the present invention provides a system architecture 200 . The data collection device 260 is used to collect AI model sample data and store it in the database 230 , and the training device 220 generates the target model/rule 201 based on the sample data maintained in the database 230 .
所述AI模型例如包括神经网络模型。The AI model includes, for example, a neural network model.
所述神经网络模型是一种模仿动物神经网络行为特征进行信息处理的网络结构,也简称为人工神经网络(artificial neural networks,ANN)。所述神经网络模型例如包括卷积神经网络(Convolutional neural network,CNN)、深度神经网络模型(Deep Neural Networks,DNN)、循环神经网络(recurrent neural network,RNN)等多种神经网络模型中的至少一种。神经网络模型的结构由大量的节点(或称神经元)相互联接构成,基于特定运算模型通过对输入信息进行学习和训练达到处理信息的目的。一个神经网络模型包括输入层、隐藏层及输出层,输入层负责接收输入信号,输出层负责输出神经网络的计算结果,隐藏层负责学习、训练等计算过程,是网络的记忆单元,隐藏层的记忆功能由权重矩阵来表征,通常每个神经元对应一个权重系数。The neural network model is a network structure that imitates the behavioral characteristics of animal neural networks for information processing, and is also referred to as artificial neural networks (ANN). The neural network model includes, for example, at least one of a variety of neural network models such as Convolutional Neural Network (CNN), Deep Neural Networks (DNN), and Recurrent Neural Network (RNN). A sort of. The structure of the neural network model is composed of a large number of nodes (or neurons) connected to each other, and the purpose of processing information is achieved by learning and training the input information based on a specific operation model. A neural network model includes an input layer, a hidden layer and an output layer. The input layer is responsible for receiving input signals, the output layer is responsible for outputting the calculation results of the neural network, and the hidden layer is responsible for learning, training and other computing processes. It is the memory unit of the network. The memory function is represented by a weight matrix, usually each neuron corresponds to a weight coefficient.
神经网络模型中的每一层的工作可以用数学表达式
Figure PCTCN2021076545-appb-000001
来描述,其中,
Figure PCTCN2021076545-appb-000002
为该层的输入向量,y为该层的输出值(或输出向量),a、W和b为该层中包括的模 型参数。模型的输入层的输入向量为模型的输入特征向量,该输入特征向量中的每个元素为待预测对象的特征值,模型的输出层输出的输出值即为模型的预测值,该预测值指示对待预测对象的预测结果。从物理层面,神经网络模型中的每一层的工作可以理解为通过五种对输入空间(输入向量的集合)的操作,完成输入空间到输出空间的变换,这五种操作包括:1、升维/降维;2、放大/缩小;3、旋转;4、平移;5、“弯曲”。其中1、2、3的操作由
Figure PCTCN2021076545-appb-000003
完成,4的操作由+b完成,5的操作则由a()来实现。这里之所以用“空间”二字来表述是因为被分类的对象并不是单个事物,而是一类事物,空间是指这类事物所有个体的集合。其中,W是权重向量,该向量中的每一个值表示该层神经网络中的一个神经元的权重值。该向量W决定着上文所述的输入空间到输出空间的空间变换,即每一层的权重W控制着如何变换空间。训练神经网络模型的目的,也就是最终得到训练好的神经网络的所有层的权重矩阵(由很多层的向量W形成的权重矩阵)。因此,神经网络的训练过程本质上就是学习控制空间变换的方式,更具体的就是学习权重矩阵。
The work of each layer in a neural network model can be expressed mathematically
Figure PCTCN2021076545-appb-000001
to describe which,
Figure PCTCN2021076545-appb-000002
is the input vector of the layer, y is the output value (or output vector) of the layer, and a, W, and b are the model parameters included in the layer. The input vector of the input layer of the model is the input feature vector of the model, each element in the input feature vector is the feature value of the object to be predicted, and the output value output by the output layer of the model is the predicted value of the model, and the predicted value indicates The prediction result of the object to be predicted. From the physical level, the work of each layer in the neural network model can be understood as completing the transformation from the input space to the output space through five operations on the input space (set of input vectors). These five operations include: 1. Dimension/reduction; 2. Zoom in/out; 3. Rotation; 4. Translation; 5. "Bending". Among them, the operations of 1, 2, and 3 are determined by
Figure PCTCN2021076545-appb-000003
Complete, the operation of 4 is completed by +b, and the operation of 5 is realized by a(). The reason why the word "space" is used here is because the object to be classified is not a single thing, but a type of thing, and space refers to the collection of all individuals of this type of thing. Among them, W is the weight vector, and each value in the vector represents the weight value of a neuron in the neural network of this layer. The vector W determines the space transformation from the input space to the output space described above, that is, the weight W of each layer controls how the space is transformed. The purpose of training the neural network model is to finally obtain the weight matrix of all layers of the trained neural network (the weight matrix formed by the vectors W of many layers). Therefore, the training process of the neural network is essentially learning the way to control the spatial transformation, and more specifically, learning the weight matrix.
在训练神经网络模型的过程中,训练设备220可以通过比较当前网络的预测值和希望的目标值,并根据两者之间的差异情况来更新每一层神经网络的权重向量,从而使得神经网络模型的输出尽可能的接近真正希望预测的值。例如,如果神经网络模型的预测值相比于目标值较大,则调整该模型的权重向量使得模型的预测值减小,反之亦然,如此不断地调整,直到获得能够预测出希望的目标值(即真实值或者标签值)的目标模型/规则201。为此,可预先定义损失函数(loss function)或目标函数(objective function),它们是用于衡量预测值和目标值的差异的重要方程。其中,以损失函数举例,损失函数的输出值(loss)越高表示差异越大,那么神经网络模型的训练就变成了尽可能缩小这个loss的过程。In the process of training the neural network model, the training device 220 can compare the predicted value of the current network with the desired target value, and update the weight vector of each layer of the neural network according to the difference between the two, so as to make the neural network The output of the model is as close as possible to the value that is really expected to be predicted. For example, if the predicted value of the neural network model is larger than the target value, the weight vector of the model is adjusted so that the predicted value of the model decreases, and vice versa, and so on continuously until the desired target value is obtained. (ie ground truth or label value) target model/rule 201. For this purpose, a loss function or objective function can be predefined, which are important equations for measuring the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value of the loss function (loss), the greater the difference, then the training of the neural network model becomes the process of reducing the loss as much as possible.
训练设备220得到的目标模型/规则201可以应用不同的系统或设备中。在图2中,执行设备210配置有I/O接口212,与外部设备进行数据交互,“用户”可以通过客户设备240向I/O接口212输入数据。The target model/rule 201 obtained by training the device 220 can be applied in different systems or devices. In FIG. 2 , the execution device 210 is configured with an I/O interface 212 for data interaction with external devices, and a “user” can input data to the I/O interface 212 through the client device 240 .
执行设备210可以调用数据存储系统250中的数据、代码等,也可以将数据、指令等存入数据存储系统250中。The execution device 210 can call data, codes, etc. in the data storage system 250 , and can also store data, instructions, etc. in the data storage system 250 .
计算模块211使用目标模型/规则201对输入的数据进行处理,以输出处理结果。最后,I/O接口212将处理结果返回给客户设备240,提供给用户。所述执行设备210中还可以包括关联功能模块(图2中示意示出关联功能模块213和关联功能模块214),其可以基于计算模块211的处理结果进行关联处理,以输出与所述处理结果关联的结果。The calculation module 211 uses the target model/rule 201 to process the input data to output the processing result. Finally, the I/O interface 212 returns the processing result to the client device 240, which is provided to the user. The execution device 210 may also include an associated function module (the associated function module 213 and the associated function module 214 are schematically shown in FIG. 2 ), which may perform associated processing based on the processing result of the computing module 211 to output the processing result. associated results.
更深层地,训练设备220可以针对不同的目标,基于不同的数据生成相应的目标模型/规则201,以给用户提供更佳的结果。More deeply, the training device 220 can generate corresponding target models/rules 201 based on different data for different targets, so as to provide users with better results.
在图2中所示情况下,用户可以手动指定输入执行设备210中的数据,例如,在I/O接口212提供的界面中操作。另一种情况下,客户设备240可以自动地向I/O接口212输入数据并获得结果,如果客户设备240自动输入数据需要获得用户的授权,用户可以在客户设备240中设置相应权限。用户可以在客户设备240查看执行设备210输出的结果,具体的呈现形式可以是显示、声音、动作等具体方式。客户设备240也 可以作为数据采集端将采集到样本数据存入数据库230。In the case shown in FIG. 2 , the user may manually specify input data in execution device 210 , eg, operating in an interface provided by I/O interface 212 . In another case, the client device 240 can automatically input data to the I/O interface 212 and obtain the result. If the client device 240 automatically inputs data and needs to obtain the user's authorization, the user can set the corresponding permission in the client device 240 . The user can view the result output by the execution device 210 on the client device 240, and the specific presentation form can be a specific manner such as display, sound, and action. The client device 240 can also act as a data collection terminal to store the collected sample data in the database 230.
值得注意的,图2仅是本发明实施例提供的一种系统架构的示意图,图中所示设备、器件、模块等之间的位置关系不构成任何限制,例如,在图2中,数据存储系统250相对执行设备210是外部存储器,在其它情况下,也可以将数据存储系统250置于执行设备210中。另外,所述训练设备220与所述执行设备210可以是相同的计算设备,例如,所述训练设备220为平台服务器,该平台服务器在训练好目标模型201之后,作为执行设备210为用户提供业务处理服务。It is worth noting that FIG. 2 is only a schematic diagram of a system architecture provided by an embodiment of the present invention, and the positional relationship between the devices, devices, modules, etc. shown in the figure does not constitute any limitation. For example, in FIG. 2, the data storage The system 250 is an external memory relative to the execution device 210 , and in other cases, the data storage system 250 may also be located in the execution device 210 . In addition, the training device 220 and the execution device 210 may be the same computing device. For example, the training device 220 is a platform server. After the target model 201 is trained, the platform server acts as the execution device 210 to provide services for users. Processing services.
本发明实施例涉及结合AI模型进行无损数据压缩的方案。数据无损压缩是指在不丢失有用信息的前提下,缩减原始数据的数据量以减少存储空间,提高其传输、存储和处理效率的一种技术方法。数据压缩算法的基本思想是将数据中重复出现的字符,用更短的编码符号来代替;字符出现的概率越高,编码符号越短。在所述无损数据压缩方案中,通过AI模型预测原始数据块中的单位数据的出现概率,从而可通过熵编码算法基于AI模型输出的概率进行对原始数据块的压缩。所述AI模型例如可以为上述CNN模型、DNN模型RNN模型等模型中的任一种模型。其中,RNN模型更适于处理序列数据,例如,RNN模型可基于数据块中的排列在前的单位数据预测排列在后的单位数据的出现概率,因此,相比于CNN模型等模型,RNN模型具有更高的准确度。本发明实施例中将以RNN模型作为示例进行描述,其中,RNN模型包括很多扩展模型,如长短期记忆网络(Long Short-Term Memory,LSTM)模型、门循环单元网络(Gate Recurrent Unit,GRU)模型等,这些扩展模型也都可以称为RNN模型。The embodiments of the present invention relate to a solution for lossless data compression combined with an AI model. Data lossless compression refers to a technical method that reduces the amount of original data to reduce storage space and improve the efficiency of transmission, storage and processing without losing useful information. The basic idea of the data compression algorithm is to replace the repeated characters in the data with shorter coding symbols; the higher the probability of characters appearing, the shorter the coding symbols. In the lossless data compression scheme, the occurrence probability of the unit data in the original data block is predicted by the AI model, so that the original data block can be compressed based on the probability output by the AI model through the entropy coding algorithm. The AI model may be, for example, any one of the above-mentioned models such as the CNN model, the DNN model, the RNN model, and the like. Among them, the RNN model is more suitable for processing sequence data. For example, the RNN model can predict the occurrence probability of the unit data arranged at the rear based on the unit data arranged at the front in the data block. Therefore, compared with models such as the CNN model, the RNN model can with higher accuracy. In the embodiments of the present invention, an RNN model will be used as an example for description, wherein the RNN model includes many extended models, such as a long short-term memory (Long Short-Term Memory, LSTM) model, a gate recurrent unit network (Gate Recurrent Unit, GRU) Models, etc. These extended models can also be called RNN models.
图3为RNN模型的结构示意图。参考图3,RNN模型也是一种神经网络模型,包括输入层、多层隐藏层(图3中示意示出一层)和输出层,每个神经层中包括多个神经元。与CNN模型等模型不同在于,RNN模型的隐藏层中的神经元除了与上一层进行全连接之外,还包括指向自身的箭头和指向本层中其它神经元的箭头。该指向自身的箭头和指向其它神经元的箭头表示神经元在进行当前计算时还获取模型关于之前的输入数据的记忆,从而基于本次的输入数据和之前的输入数据计算出输出数据。Figure 3 is a schematic diagram of the structure of the RNN model. Referring to FIG. 3 , the RNN model is also a neural network model, including an input layer, a multi-layer hidden layer (one layer is schematically shown in FIG. 3 ) and an output layer, and each neural layer includes a plurality of neurons. Different from the CNN model and other models, the neurons in the hidden layer of the RNN model are not only fully connected to the previous layer, but also include arrows pointing to themselves and arrows pointing to other neurons in this layer. The arrow pointing to itself and the arrow pointing to other neurons indicate that the neuron also acquires the memory of the model about the previous input data when performing the current calculation, so as to calculate the output data based on the current input data and the previous input data.
图4为RNN模型的模型预测示意图。参考图4,x t-1,x t,x t+1分别为在t-1时刻、t时刻和t+1时刻的模型输入,o t-1,o t,o t+1分别为在t-1时刻、t时刻和t+1时刻的模型输出,另外,S t-1,S t,S t+1分别为在t-1时刻、t时刻和t+1时刻的模型记忆。其中,模型记忆S t可通过如下的公式(1)计算获取: FIG. 4 is a schematic diagram of model prediction of the RNN model. Referring to Figure 4, x t-1 , x t , x t+1 are the model inputs at time t-1, time t and time t+1, respectively, o t-1 , o t , o t+1 are respectively at time t-1 Model output at time t-1, time t and time t+1, in addition, S t-1 , S t , and S t+1 are the model memory at time t-1, time t and time t+1, respectively. Among them, the model memory S t can be calculated and obtained by the following formula (1):
S t=f(U*x t+W*S t-1)   (1) S t =f(U*x t +W*S t-1 ) (1)
其中,U、W为模型参数,f()函数是神经网络中的激活函数,其例如为tanh函数。Among them, U and W are model parameters, and the f() function is an activation function in the neural network, such as a tanh function.
模型输出o t通过如下公式(2)计算获取: The model output o t is calculated and obtained by the following formula (2):
o t=softmax(VS t)  (2) o t =softmax(VS t ) (2)
其中,V为模型参数。结合上述公式(1)和公式(2)可以看出,RNN模型相对于输入x t的输出o t除了依赖于输入x t之外,还依赖于t-1时刻的模型记忆S t-1,即相当于还要依赖于在输入x t之前的模型输入,如x t-1where V is the model parameter. Combining the above formula (1) and formula (2), it can be seen that the output o t of the RNN model relative to the input x t not only depends on the input x t , but also depends on the model memory S t-1 at time t-1 , That is, it is equivalent to also depend on the model input before the input x t , such as x t-1 .
例如,在使用RNN模型预测一段话中的字符的出现概率的场景中,当对RNN模型依次输入一句话(例如“我是中国人”)中的每个字时,RNN模型在每输入一个字之后都会根据之前输入的字来预测下一个字的概率,在对RNN模型输入“我是中国” 之后,RNN模型会根据与前面的字关联性预测下一个字为“人”的出现概率较大。具体是,所述“人”的出现概率用数学式可以表达为即P(人|我,是,中,国),表示该概率为“人”字依赖于“我”、“是”、“中”、“国”四个字的概率,RNN模型会根据预先训练好的参数U、V、W来基于前面的“我是中国”计算出“人”的概率较大。For example, in the scenario where the RNN model is used to predict the occurrence probability of characters in a sentence, when each character in a sentence (for example, "I am Chinese") is input to the RNN model in turn, the RNN model will not be used for each character input. After that, the probability of the next word will be predicted based on the previously entered word. After inputting "I am China" to the RNN model, the RNN model will predict the probability of the next word as "person" based on the correlation with the previous word. . Specifically, the occurrence probability of the "person" can be expressed as P(person|me, yes, China, country) in a mathematical formula, indicating that the probability of the word "person" depends on "me", "yes", " The probability of the four words "中" and "country", the RNN model will calculate the probability of "people" based on the previous "I am China" according to the pre-trained parameters U, V, W.
参考上文的描述,可基于损失函数来训练RNN模型,该损失函数中包括所述参数U、V、W,从而可在基于该损失函数调整参数U、V、W的值使得RNN模型的输出(即预测值)相对于标签值不断减小。例如,为了使用RNN模型预测一段文本中各个字的出现概率,可首先从该段文本获取多个句子以生成多个训练样本来训练出与该段文本对应的概率预测模型。例如,该段文本中包括“我是中国人”这句话,可预先找出该段文本中的“我是中国”后面出现“人”字的真实出现概率作为标签值,并将“我是中国人”五个字依次输入RNN模型,由RNN模型输出“人”字的出现概率的预测值,将“人”字的出现概率的预测值和标签值代入损失函数从而调整参数U、V、W的值,使得RNN模型对“我是中国人”中的“人”字的预测值更接近标签值。通过使用多个样本多次训练RNN模型使得模型收敛,从而可通过将该段文本中的每个字依次输入该训练好的RNN模型,从而预测该段文本中每个字的出现概率。With reference to the above description, the RNN model can be trained based on a loss function, which includes the parameters U, V, and W, so that the values of the parameters U, V, and W can be adjusted based on the loss function to make the output of the RNN model (i.e. the predicted value) is continuously decreasing relative to the label value. For example, in order to use the RNN model to predict the occurrence probability of each word in a piece of text, multiple sentences can be obtained from the piece of text first to generate multiple training samples to train a probability prediction model corresponding to the piece of text. For example, if the sentence "I am Chinese" is included in the text, the true probability of occurrence of the word "人" after "I am Chinese" in the text can be found in advance as the label value, and "I am Chinese" can be used as the label value. The five words "Chinese" are input into the RNN model in turn, and the RNN model outputs the predicted value of the occurrence probability of the word "人", and substitutes the predicted value of the occurrence probability of the word "人" and the label value into the loss function to adjust the parameters U, V, The value of W makes the prediction value of the RNN model for the word "people" in "I am Chinese" closer to the label value. The RNN model is trained multiple times by using multiple samples to make the model converge, so that the probability of occurrence of each word in the text can be predicted by sequentially inputting each word in the text into the trained RNN model.
图5是本发明实施例提供的一种NPU芯片硬件结构图。上文参考图4所述的RNN模型的模型预测和模型训练都可以通过图5所示的NPU芯片中实现。FIG. 5 is a hardware structure diagram of an NPU chip provided by an embodiment of the present invention. Both the model prediction and model training of the RNN model described above with reference to FIG. 4 can be implemented in the NPU chip shown in FIG. 5 .
如图5所示,神经网络处理器NPU作为协处理器挂载到主CPU上,由主CPU分配任务。NPU的核心部分为运算电路503,通过控制器504控制运算电路503提取存储器中的矩阵数据并进行乘法运算。As shown in Figure 5, the neural network processor NPU is mounted on the main CPU as a co-processor, and the main CPU assigns tasks. The core part of the NPU is the arithmetic circuit 503, which is controlled by the controller 504 to extract the matrix data in the memory and perform multiplication operations.
在一些实现中,运算电路503内部包括多个处理单元(Process Engine,PE)。在一些实现中,运算电路503是二维脉动阵列。运算电路503还可以是一维脉动阵列或者能够执行例如乘法和加法这样的数学运算的其它电子线路。在一些实现中,运算电路503是通用的矩阵处理器。In some implementations, the arithmetic circuit 503 includes multiple processing units (Process Engine, PE). In some implementations, arithmetic circuit 503 is a two-dimensional systolic array. The arithmetic circuit 503 may also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 503 is a general-purpose matrix processor.
总线接口单元(Bus Interface Unit,BIU)510用于总线与存储单元访问控制器(Direct Memory Access Controller,DMAC)505和取指存储器(Instruction Fetch Buffer)509的交互。The bus interface unit (Bus Interface Unit, BIU) 510 is used for the interaction between the bus and the memory unit access controller (Direct Memory Access Controller, DMAC) 505 and the instruction fetch memory (Instruction Fetch Buffer) 509.
取指存储器509通过总线接口单元510从外部存储器获取指令,DMAC 505通过总线接口单元510从外部存储器获取输入矩阵A或者权重矩阵B的原数据。The instruction fetch memory 509 obtains instructions from the external memory through the bus interface unit 510, and the DMAC 505 obtains the original data of the input matrix A or the weight matrix B from the external memory through the bus interface unit 510.
DMAC 505主要用于将外部存储器DDR中的输入数据搬运到统一存储器506、或将权重数据(例如权重矩阵B)搬运到权重存储器502中、或将输入数据(例如输入矩阵A)搬运到输入存储器501中。The DMAC 505 is mainly used to transfer the input data in the external memory DDR to the unified memory 506, or to transfer the weight data (for example, the weight matrix B) to the weight memory 502, or to transfer the input data (for example, the input matrix A) to the input memory 501.
举例来说,运算电路503可从权重存储器502中读取权重矩阵B相应的数据,并缓存在运算电路503中每一个PE上。运算电路503从输入存储器501中读取输入矩阵A数据与权重矩阵B进行矩阵运算,将运算输出的矩阵C的部分结果或最终结果,保存在累加器(accumulator)508中。统一存储器506可用于存放输入数据和/或输出数据。For example, the operation circuit 503 can read the corresponding data of the weight matrix B from the weight memory 502 and buffer it on each PE in the operation circuit 503 . The operation circuit 503 reads the data of the input matrix A and the weight matrix B from the input memory 501 to perform matrix operation, and stores the partial result or the final result of the matrix C outputted by the operation in the accumulator 508 . Unified memory 506 may be used to store input data and/or output data.
向量计算单元507包括多个运算处理单元,在需要的情况下,对运算电路的输出 做进一步处理,如向量乘,向量加,指数运算,对数运算,大小比较等等。向量计算单元507主要用于神经网络中非卷积/全连接层(Full connecting layer,FCL)网络计算,如池化(Pooling)、批归一化(Batch Normalization)、局部响应归一化(Local Response Normalization)等。The vector calculation unit 507 includes a plurality of operation processing units, and further processes the output of the operation circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc., if necessary. The vector calculation unit 507 is mainly used for non-convolutional/full connection layer (Full connecting layer, FCL) network calculation in the neural network, such as pooling (Pooling), batch normalization (Batch Normalization), local response normalization (Local Response normalization) Response Normalization) and so on.
在一些实现中,向量计算单元507可以将经处理的输出的向量存储到统一缓存器506。在一些实现中,向量计算单元507可以将非线性函数应用到运算电路503的输出,用以生成激活值。在一些实现中,向量计算单元507生成归一化的值、合并值,或二者均有。在一些实现中,向量计算单元507处理过的输出向量能够用作为运算电路503的激活输入,例如用于在神经网络中的后续层中的使用。In some implementations, vector computation unit 507 may store the processed output vectors to unified buffer 506 . In some implementations, vector computation unit 507 may apply a nonlinear function to the output of arithmetic circuit 503 to generate activation values. In some implementations, vector computation unit 507 generates normalized values, merged values, or both. In some implementations, the output vector processed by the vector computing unit 507 can be used as an activation input to the arithmetic circuit 503, eg, for use in subsequent layers in a neural network.
控制器504连接的取指存储器(instruction fetch buffer)509用于存储控制器504使用的指令。统一存储器506,输入存储器501,权重存储器502以及取指存储器509均为片上(On-Chip)存储器。外部存储器独立于该NPU硬件架构。其中,图3所示的RNN模型中各层的运算可以由运算电路503或向量计算单元507执行。An instruction fetch buffer 509 connected to the controller 504 is used to store instructions used by the controller 504 . The unified memory 506, the input memory 501, the weight memory 502 and the instruction fetch memory 509 are all on-chip memories. External memory is independent of the NPU hardware architecture. The operation of each layer in the RNN model shown in FIG. 3 may be performed by the operation circuit 503 or the vector calculation unit 507 .
在使用AI模型对数据进行无损压缩的技术方案中,模型训练的耗时长,使得数据压缩耗时较多,压缩性能较差。In the technical solution of using an AI model to compress data losslessly, model training takes a long time, which makes data compression more time-consuming and has poor compression performance.
为此,本发明实施例提出一种数据压缩方案,利用数据块在时间和/或空间维度的关联性,将相似数据块的AI预测模型用作为当前待压缩数据块的初始模型,以用于进行数据压缩。本发明实施例的数据压缩方案节省了AI模型的模型训练时间,缩短了数据压缩的耗时。To this end, an embodiment of the present invention proposes a data compression scheme, which utilizes the correlation of data blocks in time and/or space dimensions, and uses the AI prediction model of similar data blocks as the initial model of the current data block to be compressed, so as to be used for Data compression is performed. The data compression scheme of the embodiment of the present invention saves the model training time of the AI model and shortens the time-consuming of data compression.
本发明实施例的数据压缩方案可应用于存储系统和/或存储产品中,例如可用于数据库、虚拟化等场景的小数据块压缩。可以理解,本发明实施例的方案不限于用于存储系统中,而是可应用于其它任意需要进行数据压缩的场景中,例如,可应用于移动终端中以用于对移动终端中的数据进行压缩。下文中将以存储系统为例进行描述。The data compression solutions in the embodiments of the present invention can be applied to storage systems and/or storage products, for example, small data block compression can be used in scenarios such as databases and virtualization. It can be understood that the solutions of the embodiments of the present invention are not limited to being used in storage systems, but can be applied to any other scenarios that require data compression. compression. The following description will take the storage system as an example.
图6为本发明实施例提供的存储系统架构图。如图6所示,存储系统中包括计算节点61、存储节点62和存储介质63。其中,所述计算节点61和存储节点62可以为物理服务器,或者也可以为虚拟机、容器等基于通用硬件资源抽象的虚拟实体。所述存储介质63例如为固态硬盘(Solid State Disk,SSD)、硬盘(hard disk drive,HDD)、存储级内存(Storage class memory,SCM)等存储介质,并且,所述存储介质63可以为存储节点本地的存储介质,也可以为与存储节点连接的分布式的存储介质。FIG. 6 is an architecture diagram of a storage system provided by an embodiment of the present invention. As shown in FIG. 6 , the storage system includes a computing node 61 , a storage node 62 and a storage medium 63 . The computing node 61 and the storage node 62 may be physical servers, or may also be virtual entities, such as virtual machines and containers, which are abstracted based on general hardware resources. The storage medium 63 is, for example, a storage medium such as a solid state disk (Solid State Disk, SSD), a hard disk drive (HDD), a storage class memory (Storage class memory, SCM), and the storage medium 63 may be a storage medium The storage medium local to the node may also be a distributed storage medium connected to the storage node.
计算节点61可对存储节点62进行数据访问,例如写数据、读数据等。具体是,计算节点61可向存储节点62发送写请求以写入数据,该写请求的待写数据例如可以为图像、数据库、文本等各种类型的数据,该待写数据也即待压缩数据。存储节点62在接收到写请求之后,通过相似度分析模块621计算写请求中的待写数据与预存的各个参考数据块的相似度,并选出相似度最高的一个参考数据块,获取与该选出的参考数据块关联的AI模型(即概率预测模型),并将该AI模型作为该待写数据的初始AI模型提供给概率预测模块622。概率预测模块622在接收到初始AI模型之后,基于该初始AI模型,进行对待写数据中的单位数据(例如字符)的出现概率预测,并将各个字符的出现概率输出给压缩模块623。压缩模块623基于待写数据中的各个字符的出现概率对待写数据进行压缩,获得该待写数据的压缩数据包,并将该压缩数据包存入 到存储介质中,所述压缩数据包中除了包括待写数据的压缩数据之外,还包括用于压缩该待写数据的AI模型的相关信息。存储节点在向存储介质存入所述待写数据的压缩数据之后,记录所述待写数据与压缩数据的存储地址的对应关系,以便于计算节点对待写数据的读取。所述存储节点62中还可以包括解压缩模块624,当计算节点61需要读取写入数据时,存储节点62可从存储介质63读取压缩数据包,基于该压缩数据包获取用于解压缩的AI模型,通过概率预测模块622和解压缩模块624基于该AI模型进行对压缩数据的解压缩,从而获取写入数据,并返回给计算节点61。上述相似度分析模块621、概率预测模块622、压缩模块623和解压缩模块624可以为软件、硬件或者固件的形式。The computing node 61 may perform data access to the storage node 62, such as writing data, reading data, and the like. Specifically, the computing node 61 can send a write request to the storage node 62 to write data. The data to be written in the write request can be, for example, various types of data such as images, databases, and texts, and the data to be written is also the data to be compressed. . After receiving the write request, the storage node 62 calculates the similarity between the data to be written in the write request and each pre-stored reference data block through the similarity analysis module 621, and selects a reference data block with the highest similarity, and obtains a reference data block with the highest similarity. The selected reference data block is associated with the AI model (ie, the probability prediction model), and the AI model is provided to the probability prediction module 622 as the initial AI model of the data to be written. After receiving the initial AI model, the probability prediction module 622 predicts the occurrence probability of unit data (eg, characters) in the data to be written based on the initial AI model, and outputs the occurrence probability of each character to the compression module 623 . The compression module 623 compresses the data to be written based on the occurrence probability of each character in the data to be written, obtains a compressed data packet of the data to be written, and stores the compressed data packet in the storage medium, except that in the compressed data packet In addition to the compressed data of the data to be written, it also includes relevant information of the AI model used to compress the data to be written. After storing the compressed data of the data to be written into the storage medium, the storage node records the correspondence between the data to be written and the storage address of the compressed data, so that the computing node can read the data to be written. The storage node 62 may also include a decompression module 624. When the computing node 61 needs to read and write data, the storage node 62 may read the compressed data packet from the storage medium 63, and obtain the data for decompression based on the compressed data packet. Based on the AI model, the probability prediction module 622 and the decompression module 624 decompress the compressed data based on the AI model, so as to obtain the written data and return it to the computing node 61 . The above-mentioned similarity analysis module 621, probability prediction module 622, compression module 623 and decompression module 624 may be in the form of software, hardware or firmware.
在一种实现方式中,所述相似度分析模块621、压缩模块623和解压缩模块624可部署在图5中的主CPU中,即由主CPU执行所述相似度分析模块621、压缩模块623和解压缩模块624进行的操作,所述概率预测模块622可部署在图5中的NPU中,即由NPU执行所述概率预测模块622进行的操作。可以理解,所述相似度分析模块621、压缩模块623和解压缩模块624不限于部署在图5中的主CPU中,所述概率预测模块622不限于部署在图5中的NPU中,其可以根据具体的设备配置进行部署。In an implementation manner, the similarity analysis module 621 , the compression module 623 and the decompression module 624 may be deployed in the main CPU in FIG. 5 , that is, the similarity analysis module 621 , the compression module 623 and the decompression module are executed by the main CPU. The operation performed by the compression module 624, the probability prediction module 622 may be deployed in the NPU in FIG. 5, that is, the operation performed by the probability prediction module 622 is performed by the NPU. It can be understood that the similarity analysis module 621, the compression module 623 and the decompression module 624 are not limited to be deployed in the main CPU in FIG. 5, and the probability prediction module 622 is not limited to be deployed in the NPU in FIG. The specific device configuration is deployed.
可以理解,上文中虽然以字符作为所述单位数据的示例,所述单位数据不限于为字符,例如,所述单位数据可以为图像、数据库中的部分数据。对于图像、数据库、文本等数据共同的是,在存储系统中例如都以二进制数来表示,因此,可将这些不同类型中的数据中的单位数据都统一设定为具有预定长度的二进制数。该预定长度例如为一个字节,即8位,从而该单位数据的总数为0~255共256个。可以理解,该预定长度不限于为一个字节,而是可以根据具体场景的需要进行设定,例如也可以设定为两个字节等等,根据不同的单位数据长度,单位数据的总数也相应地变化。通过这样设置单位数据,可通过同一个系统对不同类型的数据进行一致的处理。It can be understood that although characters are used as an example of the unit data, the unit data is not limited to characters, for example, the unit data may be an image or part of data in a database. What is common to data such as images, databases, and texts is that they are all represented by binary numbers in the storage system. Therefore, unit data in these different types of data can be uniformly set as binary numbers with a predetermined length. The predetermined length is, for example, one byte, that is, 8 bits, so that the total number of the unit data is 256 in total from 0 to 255. It can be understood that the predetermined length is not limited to one byte, but can be set according to the needs of specific scenarios, for example, it can also be set to two bytes, etc. According to different unit data lengths, the total number of unit data is also Change accordingly. By setting the unit data in this way, different types of data can be processed consistently by the same system.
下文将详细描述本发明实施例的数据压缩方案的各个步骤。Each step of the data compression scheme of the embodiment of the present invention will be described in detail below.
图7为本发明实施例提供的一种数据压缩方法的流程图,所述方法包括:FIG. 7 is a flowchart of a data compression method provided by an embodiment of the present invention, and the method includes:
步骤S701,基于待压缩的数据块与预存的各个参考数据块的相似度,从多个参考数据块中选择参考数据块;Step S701, selecting a reference data block from a plurality of reference data blocks based on the similarity between the data block to be compressed and each pre-stored reference data block;
步骤S702,获取与选择的参考数据块关联的AI模型;Step S702, acquiring the AI model associated with the selected reference data block;
步骤S703,基于压缩模型,对数据块进行压缩,生成压缩数据块,该压缩模型根据与选择的参考数据块关联的AI模型获得;Step S703, compressing the data block based on the compression model to generate a compressed data block, the compression model is obtained according to the AI model associated with the selected reference data block;
步骤S704,生成压缩数据包,压缩数据包中包括压缩数据块和压缩模型信息。Step S704, generating a compressed data package, where the compressed data package includes compressed data blocks and compression model information.
图7所示方法可由图6所示的存储节点62执行。存储节点62在例如从计算节点61接收到写请求之后,通过图7所示方法对该写请求的待写数据进行数据压缩。存储节点62可将写请求的待写数据作为数据块进行压缩,或者,存储节点62也可以将该待写数据切分成指定大小(例如8KB或者32KB等)的多个数据块之后,对每个数据块分别压缩。The method shown in FIG. 7 may be performed by the storage node 62 shown in FIG. 6 . After receiving the write request from the computing node 61, the storage node 62 performs data compression on the to-be-written data of the write request by using the method shown in FIG. 7 . The storage node 62 can compress the to-be-written data of the write request as a data block, or the storage node 62 can also divide the to-be-written data into multiple data blocks of a specified size (for example, 8KB or 32KB, etc.) Data blocks are compressed individually.
首先,在步骤S701基于待压缩的数据块与预存的各个参考数据块的相似度,从所述多个参考数据块中选择参考数据块。First, in step S701, a reference data block is selected from the plurality of reference data blocks based on the similarity between the data block to be compressed and each pre-stored reference data block.
步骤S701可由图6中的相似度分析模块621执行。存储节点62可在本地或存储介质或云端等存储空间中预存多个参考数据块和各个参考数据块关联的AI模型,其中,所述AI模型是针对关联的参考数据块的概率预测模型。图8为存储节点中预存的参考数据块-模型的示意图。如图8中所示,可预存多个参考数据块-模型组,图8中示意示出第一组、第二组合第三组,每个组中包括特定类型的参考数据块,例如,第一组中包括最近压缩的数据块作为参考数据块,第二组中包括不同类型数据的数据块作为参考数据块,第三组中包括周期中不同时间点的数据块作为参考数据块。其中,最近压缩的数据块作为与待压缩数据块的时间上相邻的数据块,有可能与待压缩数据块具有较大的相似度,因此,可在第一组中将最近压缩的数据块作为参考数据块进行存储。所述不同类型数据例如包括图片、文本、数据库等类型,不同类型数据的数据块对应的AI模型的网络结构、层次、和权重的差异较大,相同类型数据的数据块对应的AI模型的相似度较大,因此,可在第二组中将不同类型数据的数据块作为参考数据块进行存储。周期中不同时间点的数据块为在数据进行周期性变化的场景中在一个周期中的若干时间点的数据块。例如,所述计算节点61可能对应于外卖应用(Application,APP),该APP可向存储节点62写入交易数据,所述交易数据以天为单位进行周期性的循环,一天中的早上、中午和晚上的三个时间点的交易数据的数据块是相互差别较大的数据块,而不同天的早上的交易数据可能相似度较高,因此,可在第三组中将一天的早上、中午、晚上三个时间点的数据块作为参考数据块进行存储。在图8中的各个组中,矩形框用于表示参考数据块,矩形框中的数字表示该参考数据块的编号,例如参考数据块1,参考数据块2,方框用于表示与各个参考数据块关联的AI模型,方框中的数字用于表示AI模型的编号,例如AI模型1,AI模型2,其中,例如具有相同编号的参考数据块和AI模型为关联的参考数据块-AI模型对,例如,参考数据块1与AI模型1相关联。其中,所述参考数据块关联的AI模型可以直接以该AI模型的形式存储,或者可以以该AI模型的相似模型及该相似模型与该AI模型的差异数据的形式存储,该AI模型的相似模型例如为与所述参考数据块具有较高相似度的另一个参考数据块关联的模型。Step S701 can be performed by the similarity analysis module 621 in FIG. 6 . The storage node 62 may pre-store multiple reference data blocks and an AI model associated with each reference data block locally or in a storage space such as a storage medium or the cloud, where the AI model is a probability prediction model for the associated reference data block. FIG. 8 is a schematic diagram of a reference data block-model pre-stored in a storage node. As shown in FIG. 8 , multiple reference data block-model groups can be pre-stored. FIG. 8 schematically shows the first group, the second group and the third group, each group including a specific type of reference data block, for example, the first group, the second group and the third group are schematically shown. One group includes the most recently compressed data blocks as reference data blocks, the second group includes data blocks of different types of data as reference data blocks, and the third group includes data blocks at different time points in the cycle as reference data blocks. Among them, the most recently compressed data block, as a temporally adjacent data block to the to-be-compressed data block, may have a greater similarity with the to-be-compressed data block. Therefore, in the first group, the most recently compressed data block can be Stored as a reference data block. The different types of data include, for example, pictures, texts, databases, etc. The network structures, levels, and weights of AI models corresponding to data blocks of different types of data are quite different, and the AI models corresponding to data blocks of the same type of data are similar. Therefore, data blocks of different types of data can be stored as reference data blocks in the second group. The data blocks at different time points in the cycle are data blocks at several time points in a cycle in a scenario where data changes periodically. For example, the computing node 61 may correspond to a food delivery application (Application, APP), and the APP can write transaction data to the storage node 62, and the transaction data is periodically cycled in units of days. The data blocks of transaction data at three time points in the evening are data blocks that are quite different from each other, and the transaction data in the morning of different days may have a high degree of similarity. , The data blocks at three time points in the evening are stored as reference data blocks. In each group in FIG. 8, a rectangular box is used to represent a reference data block, and the numbers in the rectangular box represent the number of the reference data block, such as reference data block 1, reference data block 2, and the square box is used to represent the reference data block 1 and the reference data block 2. The AI model associated with the data block, the number in the box is used to represent the number of the AI model, such as AI model 1, AI model 2, where, for example, the reference data block and AI model with the same number are the associated reference data block-AI A model pair, for example, reference data block 1 is associated with AI model 1. The AI model associated with the reference data block may be directly stored in the form of the AI model, or may be stored in the form of a similar model of the AI model and the difference data between the similar model and the AI model. A model is, for example, a model associated with another reference data block having a higher degree of similarity to the reference data block.
可以理解,上文中对参考数据块的分组仅仅是示意性的,而不是限制性的,可根据不同的存储场景设置不同的参考数据块组。其中,在存储节点62中,从时间和/或空间的维度将与待压缩的数据块可能具有较大相似度的数据块作为参考数据块进行存储。It can be understood that the grouping of reference data blocks in the above is only illustrative, rather than restrictive, and different reference data block groups can be set according to different storage scenarios. Wherein, in the storage node 62, from the dimension of time and/or space, a data block that may have a greater similarity with the data block to be compressed is stored as a reference data block.
存储节点62在每压缩一个数据块之后,都可以进行对预存的参考数据块的更新。例如,在每压缩一个数据块之后,更新图8中的第一组中的参考数据块和对应模型,使得在该组中保留最近压缩的一定数量的(例如5-10个)数据块。在每压缩一个数据块之后,更新第二组中相同类型的参考数据块。在每压缩一个数据块之后,更新第三组中周期中的相同时间点的参考数据块。After each data block is compressed, the storage node 62 may update the pre-stored reference data block. For example, after each data block is compressed, the reference data blocks and corresponding models in the first group in Figure 8 are updated so that a certain number (eg, 5-10) of the most recently compressed data blocks remain in the group. After each data block is compressed, the reference data blocks of the same type in the second group are updated. After each data block is compressed, the reference data block at the same time point in the cycle in the third group is updated.
针对待压缩的原始数据块,相似度分析模块621可基于原始数据块与参考数据块的相似度(例如内容相似度、数据相似度等)来选出相似度较高的参考数据块。相似度分析模块621可基于各种相似度算法来计算原始数据块与参考数据块的相似度,所述相似度算法例如包括杰卡德(Jaccard)相似度算法、余弦(Cosine)相似度算法等 等。其中,所述Jaccard相似度J(A,B)可通过如下公式(3)进行计算:For the original data block to be compressed, the similarity analysis module 621 may select a reference data block with higher similarity based on the similarity between the original data block and the reference data block (eg, content similarity, data similarity, etc.). The similarity analysis module 621 can calculate the similarity between the original data block and the reference data block based on various similarity algorithms, such as Jaccard similarity algorithm, Cosine similarity algorithm, etc. Wait. Wherein, the Jaccard similarity J(A, B) can be calculated by the following formula (3):
Figure PCTCN2021076545-appb-000004
Figure PCTCN2021076545-appb-000004
其中,符号∩表示获取集合A与集合B的交集,符号∪表示获取集合A与集合B的并集。例如,原始数据块为abc,参考数据块为bcd,则原始数据块与参考数据块的相似度为(b,c)/(a,b,c,d)=2/4=0.5。Among them, the symbol ∩ means to obtain the intersection of set A and set B, and the symbol ∪ means to obtain the union of set A and set B. For example, if the original data block is abc and the reference data block is bcd, the similarity between the original data block and the reference data block is (b,c)/(a,b,c,d)=2/4=0.5.
在一种实施方式中,相似度分析模块621可计算原始数据块与每个参考数据块的相似度,从而选择相似度最高的参考数据块。在另一种实施方式中,相似度分析模块621可基于原始数据块的特征选择相应的参考数据块组,并计算原始数据块与该参考数据块组中的每个参考数据块的相似度,从而选择该组中相似度最高的参考数据块。例如,待压缩的数据块为文本类型的数据,相似度分析模块621可在图8中的第二组中选择与原始数据块的相似度最高的参考数据块。In one embodiment, the similarity analysis module 621 may calculate the similarity between the original data block and each reference data block, so as to select the reference data block with the highest similarity. In another embodiment, the similarity analysis module 621 may select a corresponding reference data block group based on the characteristics of the original data block, and calculate the similarity between the original data block and each reference data block in the reference data block group, Thus, the reference data block with the highest similarity in the group is selected. For example, if the data block to be compressed is text-type data, the similarity analysis module 621 may select the reference data block with the highest similarity with the original data block from the second group in FIG. 8 .
步骤S702,获取与选择的参考数据块关联的AI模型。Step S702, acquiring the AI model associated with the selected reference data block.
相似度分析模块621在选出参考数据块之后,可基于参考数据块与AI模型的关联关系,获取与该参考数据块对应的AI模型,并将该AI模型作为原始数据块的初始AI模型提供给概率预测模块622。After selecting the reference data block, the similarity analysis module 621 can obtain the AI model corresponding to the reference data block based on the association relationship between the reference data block and the AI model, and provide the AI model as the initial AI model of the original data block. to the probability prediction module 622.
在步骤S703,基于压缩模型,对数据块进行压缩,生成压缩数据块,该压缩模型根据与选择的参考数据块关联的AI模型获得。In step S703, the data block is compressed based on the compression model obtained according to the AI model associated with the selected reference data block to generate a compressed data block.
首先,可由图6中的概率预测模块622基于所述初始AI模型获取压缩模型,并通过压缩模型预测待压缩的数据块中的单位数据的出现概率。在概率预测模块622具有软件形式的情况中,该概率预测模块622即为实现基于上述初始AI模型对数据块中的单位数据进行概率预测的代码。该代码可通过图5中的NPU进行处理从而执行该步骤。First, a compression model can be obtained from the probability prediction module 622 in FIG. 6 based on the initial AI model, and the occurrence probability of unit data in the data block to be compressed can be predicted by the compression model. In the case where the probability prediction module 622 is in the form of software, the probability prediction module 622 is the code for realizing the probability prediction of the unit data in the data block based on the above-mentioned initial AI model. The code can be processed by the NPU in Figure 5 to perform this step.
在一种情况下,在所述选出的参考数据块与待压缩的原始数据块的相似度大于等于预定阈值的情况中,可将所述初始AI模型直接用作为与该原始数据块对应的AI模型(即压缩模型),以对该原始数据块进行概率预测。In one case, when the similarity between the selected reference data block and the original data block to be compressed is greater than or equal to a predetermined threshold, the initial AI model can be directly used as the corresponding original data block. AI models (i.e. compressed models) to make probabilistic predictions on this raw block of data.
在所述选出的参考数据块与待压缩的数据块的相似度小于预定阈值的情况中,可从原始数据块中获取部分数据进一步训练该初始AI模型,直至模型收敛,并将训练获取的AI模型作为压缩模型用于对该原始数据块进行概率预测。所述模型训练过程可参考上文中对RNN模型的训练过程的描述。具体是,在存储节点62中,可由NPU获取原始数据块中的部分数据;将所述部分数据中的预定数目的单位数据输入所述初始AI模型,以输出所述预定数目的单位数据的下一个单位数据的出现概率。之后,存储节点62可通过NPU根据所述初始AI模型的输出、以及预先确定的所述预定数目的单位数据的下一个单位数据的真实出现概率(即标签值)训练所述初始AI模型,以获取经训练的AI模型。在该情况中,由于该初始AI模型对应的参考数据块与原始数据块具有一定的相似度,因此,该模型训练将很快使得模型收敛,因此占用较少的模型训练时间。In the case where the similarity between the selected reference data block and the data block to be compressed is less than a predetermined threshold, the initial AI model can be further trained by obtaining partial data from the original data block until the model converges, and the training obtained The AI model is used as a compressed model to make probabilistic predictions on this raw data block. For the model training process, reference may be made to the above description of the training process of the RNN model. Specifically, in the storage node 62, part of the data in the original data block can be obtained by the NPU; a predetermined number of unit data in the partial data are input into the initial AI model to output the lower part of the predetermined number of unit data. The probability of occurrence of a unit of data. Afterwards, the storage node 62 can train the initial AI model through the NPU according to the output of the initial AI model and the actual occurrence probability (ie the label value) of the next unit data of the predetermined number of unit data, so as to Get a trained AI model. In this case, since the reference data block corresponding to the initial AI model has a certain degree of similarity with the original data block, the model training will quickly make the model converge, so it takes less model training time.
在确定了用于对待压缩的原始数据块进行压缩的压缩模型之后,存储节点62可通过NPU使用该压缩模型进行对原始数据块中每个单位数据的出现概率的预测,以用于基于每个单位数据的出现概率对该原始数据块进行数据压缩。After determining the compression model for compressing the original data block to be compressed, the storage node 62 may use the compression model through the NPU to perform prediction of the occurrence probability of each unit data in the original data block, so as to be used based on each The occurrence probability of the unit data performs data compression on the original data block.
图9为基于压缩模型进行数据压缩的过程示意图。FIG. 9 is a schematic diagram of a process of data compression based on a compression model.
假设数据块中的单位数据的长度为1个字节,如上文所述,由于1个字节共有8位,因此,1个字节可表示0~255共256个单位数据,假设该数据块为文本,这该256个单位数据为256个字符,下文中将以文本数据块为例进行描述,可以理解,如果所述数据块为图像等其它类型的数据块,对其的处理过程是一样的。Assume that the length of the unit data in the data block is 1 byte. As mentioned above, since 1 byte has 8 bits in total, 1 byte can represent 256 unit data from 0 to 255. Assuming that the data block is text, and the 256 units of data are 256 characters. The text data block will be used as an example for description below. It can be understood that if the data block is an image and other types of data blocks, the processing process is the same. of.
如图9所示,在对原始数据块进行数据压缩时,首先将数据块中的第1字节(即第1个字符)输入压缩模块,该压缩模块基于例如算术编码算法进行数据压缩,因此压缩模块需要获取数据块中的每个字符的出现概率,以基于该出现概率进行数据压缩。由于数据块中的第1个字符之前没有其它字符,因此无法通过AI模型来预测该第1个字符依赖于前面出现的字符的概率,因此,可预设此时256个字符具有平均出现概率(即1/256),从而,压缩模块可基于该平均概率对数据块中的第1个字符进行编码。可以理解,本发明实施例不限于如上文所述,在另一种实施方式中,在预定类型的数据块中,所述256个字符的出现概率可能是不同的,因此,可将数据块的第1个字符输入压缩模型,以由压缩模型输出256个字符的各个字符的出现概率,并将该概率输出给压缩模块。压缩模块基于256个字符各自的出现概率可确定该第1个字符的出现概率,并基于该出现概率进行对第1个字符的编码。As shown in Figure 9, when compressing the original data block, the first byte (ie, the first character) in the data block is first input into the compression module, which compresses the data based on, for example, an arithmetic coding algorithm, so The compression module needs to obtain the occurrence probability of each character in the data block to perform data compression based on the occurrence probability. Since there are no other characters before the first character in the data block, the AI model cannot predict the probability that the first character depends on the previous characters. Therefore, it can be preset that 256 characters have an average probability of occurrence ( That is, 1/256), so the compression module can encode the first character in the data block based on this average probability. It can be understood that this embodiment of the present invention is not limited to the above. In another implementation manner, in a predetermined type of data block, the occurrence probability of the 256 characters may be different. Therefore, the data block may be The first character is input into the compression model, and the occurrence probability of each character of 256 characters is output by the compression model, and the probability is output to the compression module. The compression module may determine the occurrence probability of the first character based on the respective occurrence probability of the 256 characters, and encode the first character based on the occurrence probability.
在压缩模块对第1个字符编码的同时,还将该第1个字符输入给压缩模型,从而压缩模型基于该第1个字符预测在原始数据块的第2个字节中256个字符各自的依赖于该第1个字符的出现概率,压缩模型在进行概率预测之后,将预测的对应于第2字节的各个字符的依赖于第1个字符的出现概率输出给压缩模块。在对压缩模块输入数据块中的第1个字符之后,将数据块中的第2个字符输入压缩模块,压缩模块基于从压缩模型接收的各个字符的预测概率,确定数据块中的第2字符的出现概率,并基于该出现概率对第2个字符进行编码。通过同样的方式,可对数据块中的N个字符进行编码,从而最终获取数据块的压缩数据块。在上文的描述中,压缩模型对于原始数据块中的每个字节输出256个字符各自的依赖于前一个字符的出现概率,可以理解,本发明实施例不限于此,例如,可预先设定,由压缩模型对于原始数据块中的每个字节输出256个字符各自的依赖于其前两个字符的出现概率、依赖于其前三个字符的出现概率等等。例如,假设预先设定了压缩模型对于原始数据块中的每个字节输出256个字符各自的依赖于其前两个字符的出现概率,当向压缩模型输入原始数据块中的第1个字符之后,该压缩模型输出256个字符各自的依赖于第1个字符的出现概率,当向压缩模型输入原始数据块中的第2个字符之后,该压缩模型输出256个字符各自的依赖于第1个字符和第2个字符的出现概率,当向压缩模型输入原始数据块中的第3个字符之后,该压缩模型输出256个字符各自的依赖于第2个字符和第3个字符的出现概率,等等。While the compression module encodes the first character, the first character is also input to the compression model, so that the compression model predicts the respective 256 characters in the second byte of the original data block based on the first character. Depending on the appearance probability of the first character, after performing probability prediction, the compression model outputs the predicted appearance probability of each character corresponding to the second byte depending on the first character to the compression module. After the first character in the data block is input to the compression module, the second character in the data block is input into the compression module, and the compression module determines the second character in the data block based on the predicted probability of each character received from the compression model The probability of occurrence of , and encode the second character based on the probability of occurrence. In the same way, N characters in the data block can be encoded, thereby finally obtaining the compressed data block of the data block. In the above description, for each byte in the original data block, the compression model outputs the respective occurrence probabilities of 256 characters that depend on the previous character. It can be understood that the embodiment of the present invention is not limited to this. For example, it can be preset. For each byte in the original data block, the compression model outputs the respective probabilities of occurrence of 256 characters depending on the first two characters, the occurrence probability depending on the first three characters, and so on. For example, assuming that the compression model is preset to output 256 characters for each byte in the original data block, each of which depends on the occurrence probability of its first two characters, when the first character in the original data block is input to the compression model After that, the compression model outputs the occurrence probability of each of the 256 characters that depends on the first character. When the second character in the original data block is input to the compression model, the compression model outputs the 256 characters that depend on the first character. The probability of occurrence of the first character and the second character, when the third character in the original data block is input to the compression model, the compression model outputs the respective probabilities of occurrence of the second and third characters depending on the 256 characters ,and many more.
在由概率预测模块622预测待压缩的数据块中的各个单位数据的出现概率之后,可由图6中的压缩模块623根据所述待压缩的数据块中的单位数据的出现概率,对所述数据块进行压缩,生成压缩数据块。After the probability prediction module 622 predicts the occurrence probability of each unit data in the data block to be compressed, the compression module 623 in FIG. The blocks are compressed to generate compressed data blocks.
压缩模块623可通过各种熵编码算法基于数据块中的单位数据的出现概率对数据块进行压缩,所述熵编码算法例如包括算术编码算法、异步数值系统算法、哈夫曼编 码算法等,下文中将以算术编码算法作为示例进行描述。The compression module 623 can compress the data block based on the occurrence probability of the unit data in the data block through various entropy coding algorithms, for example, the entropy coding algorithm includes arithmetic coding algorithm, asynchronous numerical system algorithm, Huffman coding algorithm, etc. Arithmetic coding algorithms will be described herein as an example.
假设待压缩的数据块包括顺序排列的a、b、c三个字符。参考图9,首先,将字符a输入压缩模块,并将256个字符的平均概率输入压缩模块。压缩模块中预先对256个字符排列了先后顺序,从而便于基于各个字符的概率确定该字符对应的概率区间。假设,在压缩模块中将a排列在256个字符的第1位,将b排列在第2位,将c排列在第3位。图10为压缩模块对数据块“abc”进行编码的过程示意图。压缩模块在接收到字符a和字符a的概率(1/256)之后,根据字符a在256个字符中的排列位置将长度为1的线段中的第1个长度为1/256的区间即(0,0.004)确定为当前编码的区间,如图10中左侧所示,这里将1/256近似为0.004。It is assumed that the data block to be compressed includes three characters a, b, and c arranged in sequence. Referring to FIG. 9, first, the character a is input into the compression module, and the average probability of 256 characters is input into the compression module. The 256 characters are arranged in sequence in advance in the compression module, so that the probability interval corresponding to each character can be easily determined based on the probability of each character. Suppose, in the compression module, a is arranged in the 1st position of 256 characters, b is arranged in the 2nd position, and c is arranged in the 3rd position. Fig. 10 is a schematic diagram of the process of encoding the data block "abc" by the compression module. After the compression module receives the probability of character a and character a (1/256), according to the arrangement position of character a in the 256 characters, the first interval of length 1 in the line segment with length 1/256 is ( 0, 0.004) is determined as the current coding interval, as shown in the left side of Fig. 10, where 1/256 is approximated as 0.004.
在将字符a输入压缩模块的同时,还将该字符a输入压缩模型,并在将字符a输入压缩模块之后,将数据块中的第2个字符b输入压缩模块。压缩模型在接收字符a之后,假设预测在a之后出现的各个字符的概率为a:1/4,b:2/4,c:1/4,即256个字符中的除字符a、b、c的其它字符的出现概率为0。压缩模块基于数据块中的第2个字符b的出现概率及字符b在256个字符中的排列位置,将上述确定的编码区间(0,0.004)分为与字符a、b、c分别对应的三个区间,如图10的中间部分所示,分别为与a对应的(0,0.004*1/4=0.001)、(0.001,0.004*3/4=0.003)、(0.003,0.004),并且确定字符b对应的区间(0.001,0.003)为当前编码的区间。When the character a is input into the compression module, the character a is also input into the compression model, and after the character a is input into the compression module, the second character b in the data block is input into the compression module. After the compression model receives the character a, it is assumed that the probability of predicting each character that appears after a is a: 1/4, b: 2/4, c: 1/4, that is, the division characters a, b, and The probability of occurrence of other characters of c is 0. The compression module divides the above-determined coding interval (0, 0.004) into corresponding characters a, b, and c based on the occurrence probability of the second character b in the data block and the arrangement position of character b in the 256 characters. The three intervals, as shown in the middle part of Fig. 10, are respectively (0, 0.004*1/4=0.001), (0.001, 0.004*3/4=0.003), (0.003, 0.004) corresponding to a, and It is determined that the interval (0.001, 0.003) corresponding to the character b is the interval of the current encoding.
在将字符b输入压缩模块的同时,还将字符b输入压缩模型,并在将字符b输入压缩模块之后,将数据块中的第3个字符c输入压缩模块。压缩模型基于前一个字符(字符b)预测在字符b之后各个字符的出现概率,假设预测在b之后出现的各个字符的概率为a:1/5,b:2/5,c:2/5,即256个字符中的除字符a、b、c的其它字符的出现概率为0。类似地,压缩模块将上述确定的编码区间(0.001,0.003)分为与字符a、b、c分别对应的三个区间,如图10右侧所示,分别为与a对应的(0.001,(0.003-0.001)*1/5+0.001=0.0014)、(0.0014,(0.003-0.001)*3/5+0.001=0.0022)、(0.0022,0.0029),并且确定字符c对应的区间(0.0022,0.0029)为当前编码的区间,在确定该区间之后,压缩模块从该区间中取任意值作为数据块abc的压缩数据块,例如0.0023。While the character b is input into the compression module, the character b is also input into the compression model, and after the character b is input into the compression module, the third character c in the data block is input into the compression module. The compression model predicts the occurrence probability of each character after character b based on the previous character (character b), assuming that the predicted probability of each character appearing after b is a: 1/5, b: 2/5, c: 2/5 , that is, the occurrence probability of other characters other than characters a, b, and c in the 256 characters is 0. Similarly, the compression module divides the above-determined coding interval (0.001, 0.003) into three intervals corresponding to characters a, b, and c, respectively, as shown on the right side of Figure 10, which are (0.001, ( 0.003-0.001)*1/5+0.001=0.0014), (0.0014, (0.003-0.001)*3/5+0.001=0.0022), (0.0022,0.0029), and determine the interval corresponding to character c (0.0022, 0.0029) is the currently encoded interval, after determining the interval, the compression module takes any value from the interval as the compressed data block of the data block abc, for example, 0.0023.
在步骤S704,生成所述待压缩的数据块的压缩数据包,所述压缩数据包中包括所述压缩数据块和压缩模型信息。In step S704, a compressed data package of the data block to be compressed is generated, and the compressed data package includes the compressed data block and compression model information.
在如上所述获取待压缩数据块的压缩数据块之后,存储节点62可基于压缩数据块和用于压缩原始数据块的压缩模型的相关信息生成待压缩数据块的压缩数据包(也可以称为压缩包),从而通过该压缩包可对压缩数据块进行解压缩,以用于获取原始数据块。After obtaining the compressed data block of the data block to be compressed as described above, the storage node 62 may generate a compressed data packet (also referred to as a compressed data block) of the data block to be compressed based on the compressed data block and the relevant information of the compression model used to compress the original data block. compressed package), so that the compressed data block can be decompressed through the compressed package to obtain the original data block.
具体是,如果将所述初始AI模型直接用作为用于对原始数据块进行压缩的压缩模型,则可以在压缩数据包中包括所述压缩数据块和所述初始AI模型的标识(例如编号)。可以理解,在压缩数据包中也可以包括压缩数据块和初始AI模型。Specifically, if the initial AI model is directly used as a compression model for compressing the original data block, an identifier (eg, number) of the compressed data block and the initial AI model may be included in the compressed data package. . It can be understood that the compressed data block and the initial AI model may also be included in the compressed data package.
在解压缩时,可通过压缩数据包中的初始AI模型的标识获取该AI模型进行解压缩。通过在压缩数据包中包括AI模型的标识,而不需要包括AI模型(即AI模型的全部参数),从而减少了存储压缩数据包需要的存储空间,并使得数据压缩率大大增大,其中,数据压缩率通过如下的公式(4)进行计算:During decompression, the AI model can be obtained through the identifier of the initial AI model in the compressed data package for decompression. By including the identifier of the AI model in the compressed data package, it is not necessary to include the AI model (that is, all parameters of the AI model), thereby reducing the storage space required for storing the compressed data package, and greatly increasing the data compression rate, wherein, The data compression rate is calculated by the following formula (4):
Figure PCTCN2021076545-appb-000005
Figure PCTCN2021076545-appb-000005
如果在对初始AI模型经过训练之后,将训练获取的AI模型(下文称为训练后AI模型)用作为用于对原始数据块进行压缩的压缩模型,可以首先计算该训练后AI模型与初始AI模型的差异数据,例如,差异数据=训练后AI模型-初始AI模型,然后生成压缩数据包,该压缩数据包中包括压缩数据块、初始AI模型的标识和上述差异数据。从而,在解压缩时,可通过初始AI模型的标识获取初始AI模型,基于所述差异数据和初始AI模型获取训练后的AI模型,即,训练后AI模型=初始AI模型+差异数据。由于该初始AI模型对应的参考数据块与原始数据块的相似度较高,因此,所述训练后AI模型与初始AI模型的差异数据较小,从而压缩数据包较小,减少了存储压缩数据包需要的存储空间,并使得数据压缩率增大。可以理解,本发明实施例不限于此,在该情况中,也可以在压缩数据包中包括压缩数据块和训练后AI模型。If after the initial AI model is trained, the AI model obtained by training (hereinafter referred to as the post-training AI model) is used as the compression model for compressing the original data block, the post-training AI model and the initial AI model can be calculated first. The difference data of the model, for example, difference data=post-training AI model-initial AI model, and then a compressed data package is generated, and the compressed data package includes the compressed data block, the identifier of the initial AI model, and the above-mentioned difference data. Therefore, when decompressing, the initial AI model can be obtained through the identifier of the initial AI model, and the trained AI model can be obtained based on the difference data and the initial AI model, that is, the AI model after training=initial AI model+difference data. Because the similarity between the reference data block corresponding to the initial AI model and the original data block is high, the difference data between the AI model after training and the initial AI model is small, so the compressed data package is small and the storage of compressed data is reduced. The storage space required by the package, and the data compression rate is increased. It can be understood that the embodiment of the present invention is not limited to this, and in this case, the compressed data block and the post-training AI model may also be included in the compressed data packet.
存储节点62在生成压缩数据包之后,可将压缩数据包存入存储介质63中,并记录原始数据块与该压缩数据包的存储地址的对应关系。After generating the compressed data packet, the storage node 62 may store the compressed data packet in the storage medium 63, and record the correspondence between the original data block and the storage address of the compressed data packet.
再回到图6,计算节点61在向存储节点62发送对数据的写请求之后,当需要读取该写入数据时,计算节点61可向存储节点62发送对该写入数据的读请求。存储节点62在接收到该读请求之后,确定与该写入数据对应的至少一个压缩数据包的存储地址,读取该压缩数据包,并基于压缩数据包中的用于压缩数据块的压缩模型信息,获取该用于压缩数据块的压缩模型,并使用该压缩模型对压缩数据包中的压缩数据块进行解压缩,以获取原始的写入数据并返回给计算节点61。Returning to FIG. 6 , after the computing node 61 sends the data write request to the storage node 62 , when the write data needs to be read, the computing node 61 may send the write data read request to the storage node 62 . After receiving the read request, the storage node 62 determines the storage address of at least one compressed data packet corresponding to the write data, reads the compressed data packet, and uses the compression model for compressing the data block in the compressed data packet. information, obtain the compression model for compressing the data block, and use the compression model to decompress the compressed data block in the compressed data packet to obtain the original written data and return it to the computing node 61 .
图11为基于压缩模型进行数据解压缩的过程示意图。FIG. 11 is a schematic diagram of a process of data decompression based on a compression model.
参考图11,存储节点62在获取压缩数据包之后,从压缩数据包中获取原始数据块的压缩数据块,在上文图10所示的数据压缩实例中,该压缩数据块为0.0023,并基于压缩数据包中的用于压缩原始数据块的压缩模型信息,获取该用于压缩原始数据块的压缩模型。与上文类似地,可预设原始数据块的第1个字符的概率为256个字符的平均概率(即1/256≈0.004),存储节点62将0.0023和平均概率输入给解压缩模块,与压缩模块类似地,解压缩模块已经预先对256个字符进行排序,其中在区间(0,1)中,区间(0,0.004)为与字符a对应的区间,解压缩模块确定压缩数据0.0023在区间(0,0.004)内,因此可确定原始数据的第1个字符为字符a。在解压缩模块预测出字符a之后,存储节点62将字符a输入用于压缩原始数据块的压缩模型,与上文对原始数据进行压缩时相同地,参考图10,在对压缩模型输入字符a之后,压缩模型将输出256个字符的预测概率,即,Pa=1/4,Pb=2/4,Pc=1/4,其它字符的出现概率为0。压缩模型将预测的字符a、b、c的概率输入给解压缩模块,解压缩模块根据预定的字符a、b、c的排列顺序可确定,对于原始数据块的第2个字节,字符a对应的区间为上述确定的区间(0,0.004)中的区间(0,0.001),字符b对应的区间为区间(0,0.004)中的区间(0.001,0.003),字符c对应的区间为区间(0,0.004)中的区间(0.003,0.004)。显然,压缩数据块0.0023落入了字符b对应的区间(0.001,0.003)中,因此,解压缩模块可确定原始数据块中的第2个字符为字符b。类似地,在预测了第2个字符之后,将预测出的字符b输入压缩模型,从而压缩模型可预测第三个字节对应的各个字符的预测概率,例如,如图10所示,Pa=1/5,Pb=2/5,Pc=2/5,并将各个字符的 概率输入给解压缩模块。解压缩模块基于各个字符的排列顺序,可确定在上述确定的区间(0.001,0.003)中,字符a对应于区间(0.001,0.0014),字符b对应于区间(0.0014,0.0022),字符c对应于区间(0.0022,0.003),由于压缩数据块0.0023落入字符c对应的区间(0.0022,0.003)中,因此,解压缩模块可确定原始数据块的第3个字符为字符c。在由解压缩模块依次输出原始数据块的全部字符(即abc)之后,存储节点62完成了对压缩数据块的解压缩过程,获得了原始数据块。之后,存储节点62将解压缩数据获得的原始数据块作为上述读请求的响应返回给应用节点61。Referring to FIG. 11 , after obtaining the compressed data packet, the storage node 62 obtains the compressed data block of the original data block from the compressed data packet. In the data compression example shown in FIG. 10 above, the compressed data block is 0.0023, and is based on The compression model information for compressing the original data block in the compressed data package is obtained, and the compression model for compressing the original data block is obtained. Similar to the above, the probability of the first character of the original data block can be preset to be the average probability of 256 characters (that is, 1/256≈0.004), and the storage node 62 inputs 0.0023 and the average probability to the decompression module, and Similarly to the compression module, the decompression module has pre-sorted 256 characters, wherein in the interval (0, 1), the interval (0, 0.004) is the interval corresponding to the character a, and the decompression module determines that the compressed data 0.0023 is in the interval (0, 0.004), so it can be determined that the first character of the original data is character a. After the decompression module predicts the character a, the storage node 62 inputs the character a into the compression model used for compressing the original data block, the same as when compressing the original data above, referring to FIG. 10 , when entering the character a into the compression model After that, the compression model will output the predicted probability of 256 characters, ie, Pa=1/4, Pb=2/4, Pc=1/4, and the occurrence probability of other characters is 0. The compression model inputs the predicted probabilities of characters a, b, and c to the decompression module. The decompression module can determine the sequence of the predetermined characters a, b, and c. For the second byte of the original data block, the character a The corresponding interval is the interval (0, 0.001) in the interval (0, 0.004) determined above, the interval corresponding to the character b is the interval (0.001, 0.003) in the interval (0, 0.004), and the interval corresponding to the character c is the interval The interval (0.003, 0.004) in (0, 0.004). Obviously, the compressed data block 0.0023 falls into the interval (0.001, 0.003) corresponding to the character b. Therefore, the decompression module can determine that the second character in the original data block is the character b. Similarly, after predicting the second character, the predicted character b is input into the compression model, so that the compression model can predict the prediction probability of each character corresponding to the third byte. For example, as shown in Figure 10, Pa= 1/5, Pb=2/5, Pc=2/5, and input the probability of each character to the decompression module. Based on the arrangement order of each character, the decompression module can determine that in the above determined interval (0.001, 0.003), the character a corresponds to the interval (0.001, 0.0014), the character b corresponds to the interval (0.0014, 0.0022), and the character c corresponds to the interval (0.001, 0.0014). The interval (0.0022, 0.003), since the compressed data block 0.0023 falls into the interval (0.0022, 0.003) corresponding to the character c, the decompression module can determine that the third character of the original data block is the character c. After the decompression module sequentially outputs all characters (ie, abc) of the original data block, the storage node 62 completes the process of decompressing the compressed data block, and obtains the original data block. After that, the storage node 62 returns the original data block obtained by decompressing the data to the application node 61 as a response to the above read request.
上文以存储系统中对存储数据的压缩和解压缩的过程作为示例描述了本发明实施例的数据处理方案,通过本该方案,可以节省数据压缩时长,并可以大大提高数据压缩率。可以理解,本发明实施例的数据处理方案不限于如上文所述用于存储节点中,而可以用于其他场景以及其他设备中。例如,用户的移动终端可通过本发明实施例的数据压缩方案在对原始数据进行压缩之后进行保存,从而节省移动终端的数据存储时长,提高用户的使用体验。The data processing scheme of the embodiment of the present invention is described above by taking the process of compressing and decompressing stored data in the storage system as an example. With this scheme, the data compression time can be saved and the data compression rate can be greatly improved. It can be understood that the data processing solutions in the embodiments of the present invention are not limited to being used in storage nodes as described above, but can be used in other scenarios and other devices. For example, the user's mobile terminal can save the original data after compressing the original data through the data compression scheme of the embodiment of the present invention, thereby saving the data storage time of the mobile terminal and improving the user's use experience.
图12为本发明实施例提供的一种数据处理装置的架构图,该数据处理装置用于执行图7所示的数据处理方法,所述数据处理装置包括:处理单元1201和存储单元1202,存储单元中存储有可执行代码,FIG. 12 is an architectural diagram of a data processing apparatus provided by an embodiment of the present invention. The data processing apparatus is configured to execute the data processing method shown in FIG. 7 . Executable code is stored in the cell,
处理单元1201用于执行可执行代码以实现:基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块;获取与第一参考数据块相关联的第一模型;基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得;生成第一压缩数据包,所述第一压缩数据包中包括所述第一压缩数据块和压缩模型信息,所述压缩模型信息为根据所述压缩模型获得。The processing unit 1201 is configured to execute the executable code to implement: selecting the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block; acquiring the first reference data block associated with the first reference data block model; compressing the first data block based on the compression model to generate a first compressed data block, the compression model is obtained according to the first model; generating a first compressed data packet, the first compressed data packet includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
在一种可能的实现方式中,处理单元1201用于执行可执行代码以实现基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得,具体为,处理单元1201用于执行可执行代码以实现:采用所述第一模型作为压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块。In a possible implementation manner, the processing unit 1201 is configured to execute executable code to implement, based on a compression model, compress the first data block to generate a first compressed data block, and the compression model is based on the first data block. To obtain a model, specifically, the processing unit 1201 is configured to execute executable code to implement: using the first model as a compression model, compressing the first data block, and generating a first compressed data block.
在一种可能的实现方式中,处理单元1201用于执行可执行代码以实现基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得,具体为:处理单元1201用于执行可执行代码以实现采用第二模型作为压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述第二模型通过使用所述第一数据块中的部分数据训练所述第一模型获得。In a possible implementation manner, the processing unit 1201 is configured to execute executable code to implement, based on a compression model, compress the first data block to generate a first compressed data block, and the compression model is based on the first data block. Obtaining a model, specifically: the processing unit 1201 is configured to execute executable code to implement using the second model as a compression model, compress the first data block, and generate a first compressed data block, and the second model is obtained by using Part of the data in the first data block is obtained by training the first model.
在一种可能的实现方式中,处理单元1201还用于执行可执行代码以实现:存储第一数据块作为参考数据块,存储压缩模型信息,存储的第一数据块与存储的压缩模型信息关联存储。In a possible implementation manner, the processing unit 1201 is further configured to execute executable code to implement: storing the first data block as a reference data block, storing compression model information, and associating the stored first data block with the stored compression model information storage.
在一种可能的实现方式中,处理单元1201包括神经网络处理器1203;处理单元1201用于执行可执行代码以实现基于第一模型,对第一数据块进行压缩,具体为:神经网络处理器1203用于执行可执行代码以实现基于第一模型,对第一数据块进行压缩。In a possible implementation manner, the processing unit 1201 includes a neural network processor 1203; the processing unit 1201 is configured to execute executable codes to implement compression of the first data block based on the first model, specifically: a neural network processor 1203 is used for executing the executable code to implement the compression of the first data block based on the first model.
在一种可能的实现方式中,处理单元1201还用于执行可执行代码以实现:获取第一压缩数据包;根据第一压缩数据包中的压缩模型信息,获取压缩模型;通过压缩模型对第一压缩数据包中的第一压缩数据块进行解压缩,获取第一数据块。In a possible implementation manner, the processing unit 1201 is further configured to execute executable code to achieve: obtaining the first compressed data packet; obtaining the compression model according to the compression model information in the first compressed data packet; The first compressed data block in a compressed data packet is decompressed to obtain the first data block.
图13为本申请实施例提供的一种数据处理装置的架构图,该数据处理装置用于执行图7所示的数据处理方法,所述数据处理装置包括:FIG. 13 is an architectural diagram of a data processing apparatus provided by an embodiment of the present application. The data processing apparatus is configured to execute the data processing method shown in FIG. 7 , and the data processing apparatus includes:
选择单元131,用于基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块;a selection unit 131, configured to select the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block;
获取单元132,用于获取与第一参考数据块相关联的第一模型;an obtaining unit 132, configured to obtain the first model associated with the first reference data block;
压缩单元133,用于基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得;a compression unit 133, configured to compress the first data block based on a compression model to generate a first compressed data block, and the compression model is obtained according to the first model;
生成单元134,用于生成第一压缩数据包,所述第一压缩数据包中包括所述第一压缩数据块和压缩模型信息,所述压缩模型信息为根据所述压缩模型获得。The generating unit 134 is configured to generate a first compressed data packet, where the first compressed data packet includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
在一种可能的实现方式中,压缩单元133具体用于:基于所述压缩模型,预测所述第一数据块中的单位数据的出现概率;根据所述第一数据块中的单位数据的出现概率,对所述第一数据块进行压缩,生成第一压缩数据块。In a possible implementation manner, the compressing unit 133 is specifically configured to: predict the occurrence probability of the unit data in the first data block based on the compression model; according to the occurrence probability of the unit data in the first data block probability, and compressing the first data block to generate a first compressed data block.
在一种可能的实现方式中,压缩单元133具体用于:采用第二模型作为压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述第二模型通过使用所述第一数据块中的部分数据训练所述第一模型获得。In a possible implementation manner, the compression unit 133 is specifically configured to: adopt the second model as a compression model, compress the first data block, and generate a first compressed data block, and the second model uses the Part of the data in the first data block is obtained by training the first model.
在一种可能的实现方式中,数据处理装置还包括:存储单元135,用于存储第一数据块作为参考数据块,存储压缩模型信息,存储的第一数据块与存储的压缩模型信息关联存储。In a possible implementation manner, the data processing apparatus further includes: a storage unit 135, configured to store the first data block as a reference data block, and store compression model information, where the stored first data block is stored in association with the stored compression model information .
在一种可能的实现方式中,数据处理装置包括神经网络处理器;所述压缩单元133部署于所述神经网络处理器中。In a possible implementation manner, the data processing apparatus includes a neural network processor; the compression unit 133 is deployed in the neural network processor.
在一种可能的实现方式中,获取单元132还用于,获取第一压缩数据包,根据第一压缩数据包中的压缩模型的相关信息,获取压缩模型,数据处理装置还包括解压缩单元136,用于通过压缩模型对第一压缩数据包中的第一压缩数据块进行解压缩,获取第一数据块。In a possible implementation manner, the obtaining unit 132 is further configured to obtain the first compressed data packet, and obtain the compression model according to the relevant information of the compression model in the first compressed data packet, and the data processing apparatus further includes a decompression unit 136 , which is used to decompress the first compressed data block in the first compressed data packet by using the compression model to obtain the first data block.
其中,图13所示的数据处理装置中的各个单元可以具有软件、硬件或固件的形式,本发明实施例对此不作限定。Wherein, each unit in the data processing apparatus shown in FIG. 13 may have the form of software, hardware, or firmware, which is not limited in this embodiment of the present invention.
本申请还提供一种计算机可读存储介质,其上存储有计算机程序,其特征在于,当所述计算机程序在计算机或处理器中执行时,令所述计算机或处理器执行上述参考图所述的方法。The present application further provides a computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed in a computer or a processor, the computer or processor is caused to execute the description in the above referenced drawings. Methods.
本申请还提供一种计算机程序产品,当所述计算机程序产品在计算机或处理器中运行时,使得所述计算机或处理器执行上述参考图所述的方法。The present application also provides a computer program product, which, when the computer program product is executed in a computer or a processor, causes the computer or the processor to execute the method described above with reference to the figures.
图14为本发明实施例提供的数据处理装置的结构示意图。所述数据处理装置中可以包括处理器110、内部存储器120、连接模块130、显示器140和接口模块150。所述数据处理装置还可以包括其它模块或部件,如音频模块等,图14中未示出。可以理解的是,本发明实施例示意的结构并不构成对所述数据处理装置的具体限定。在本申请另一些实施例中,所述数据处理装置可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。FIG. 14 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present invention. The data processing apparatus may include a processor 110 , an internal memory 120 , a connection module 130 , a display 140 and an interface module 150 . The data processing apparatus may also include other modules or components, such as audio modules, etc., which are not shown in FIG. 14 . It can be understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the data processing apparatus. In other embodiments of the present application, the data processing apparatus may include more or less components than those shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理 器(application processor,AP),调制解调处理器,GPU,图像信号处理器(image signal processor,ISP),CPU,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或NPU等中的至少一个,图14中在处理器110中示意示出CPU、ISP、NPU和GPU,其可通过总线连接。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。例如,处理器110可以是一个芯片或芯片组。例如,所述应用处理器可以是所述CPU。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a modem processor, a GPU, an image signal processor (image signal processor, ISP), a CPU , at least one of video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or NPU, etc. CPU, ISP, NPU and GPU are schematically shown in processor 110 in FIG. 14 , which can be connected via a bus. Wherein, different processing units may be independent devices, or may be integrated in one or more processors. For example, the processor 110 may be a chip or chipset. For example, the application processor may be the CPU.
处理器110中还可以设置存储器,用于存储指令和数据。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复到处理器110外部的存储器存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated memory accesses outside the processor 110 are avoided, reducing the latency of the processor 110, thereby increasing the efficiency of the system.
内部存储器120,也叫主存储器,可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器120的指令,从而执行所述数据处理装置的各种功能应用以及数据处理。内部存储器120可以包括程序存储区和数据存储区。其中,存储程序区可存储操作系统,应用程序的代码等,例如,如图14中所示,内部存储器120的程序存储区中存储有用于执行图7所示方法的以下模块:选择模块121,用于基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块;获取模块122,用于获取与第一参考数据块相关联的第一模型;压缩模块123,用于基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得;生成模块124,用于生成第一压缩数据包,所述第一压缩数据包中包括所述第一压缩数据块和压缩模型信息,所述压缩模型信息为根据所述压缩模型获得。 Internal memory 120, also called main memory, may be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the data processing apparatus by executing the instructions stored in the internal memory 120 . The internal memory 120 may include a program storage area and a data storage area. Wherein, the storage program area can store the operating system, the code of the application program, etc. For example, as shown in FIG. 14, the program storage area of the internal memory 120 stores the following modules for executing the method shown in FIG. 7: the selection module 121, for selecting the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block; the obtaining module 122 is used to obtain the first model associated with the first reference data block; the compression module 123, for compressing the first data block based on a compression model to generate a first compressed data block, where the compression model is obtained according to the first model; a generating module 124, for generating a first compressed data packet , the first compressed data packet includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
此外,内部存储器120可以包括随机存取存储器(Random Access Memory,RAM),例如双倍速率同步动态随机存储器(Double Data RateSynchronous Dynamic Random Access Memory,DDR Memory),还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。In addition, the internal memory 120 may include random access memory (Random Access Memory, RAM), such as double-rate synchronous dynamic random access memory (Double Data Rate Synchronous Dynamic Random Access Memory, DDR Memory), and may also include non-volatile memory, such as At least one disk storage device, flash memory device, universal flash storage (universal flash storage, UFS), etc.
连接模块130例如可用于进行有线连接和无线局域网(wireless local area networks,WLAN)等。显示屏140用于显示文本、图像,视频等。显示屏140包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。所述接口模块150例如包括外部存储器接口、USB接口等多种接口。For example, the connection module 130 may be used for wired connection and wireless local area networks (wireless local area networks, WLAN) and the like. The display screen 140 is used to display text, images, videos, and the like. The display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light). emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (quantum dot light emitting diodes, QLED) and so on. The interface module 150 includes, for example, various interfaces such as an external memory interface and a USB interface.
参见图15,本发明实施例提供了一种端云系统架构300。执行设备210由一个或多个服务器实现,可选的,与其它数据处理装置配合,例如:数据存储、路由器、负载均衡器等设备;执行设备210可以布置在一个物理站点上,或者分布在多个物理站点上。执行设备210可以使用数据存储系统250中的数据,或者调用数据存储系统250中的程序代码实现如图7所示的方法。Referring to FIG. 15 , an embodiment of the present invention provides a terminal-cloud system architecture 300 . The execution device 210 is implemented by one or more servers, and optionally, cooperates with other data processing devices, such as data storage, routers, load balancers and other devices; the execution device 210 may be arranged on a physical site, or distributed in multiple locations. on a physical site. The execution device 210 may use the data in the data storage system 250, or invoke the program code in the data storage system 250 to implement the method shown in FIG. 7 .
用户可以操作各自的用户设备(例如本地设备301和本地设备302)与执行设备 210进行交互。每个本地设备可以表示任何计算设备,例如个人计算机、计算机工作站、智能手机、平板电脑、智能摄像头、智能汽车或其他类型蜂窝电话、媒体消费设备、可穿戴设备、机顶盒、游戏机等。A user may operate respective user devices (e.g., local device 301 and local device 302) to interact with execution device 210. Each local device may represent any computing device, such as a personal computer, computer workstation, smartphone, tablet, smart camera, smart car or other type of cellular phone, media consumption device, wearable device, set-top box, gaming console, etc.
每个用户的本地设备可以通过任何通信机制/通信标准的通信网络与执行设备210进行交互,通信网络可以是广域网、局域网、点对点连接等方式,或它们的任意组合。Each user's local device can interact with the execution device 210 through any communication mechanism/standard communication network, which can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.
在另一种实现中,执行设备210的一个方面或多个方面可以由每个本地设备实现,例如,本地设备301可以为执行设备210提供本地数据或反馈计算结果。In another implementation, one or more aspects of the execution device 210 may be implemented by each local device, for example, the local device 301 may provide the execution device 210 with local data or feedback calculation results.
需要注意的,执行设备210的所有功能也可以由本地设备实现。例如,本地设备301实现执行设备210的功能并为自己的用户提供服务,或者为本地设备302的用户提供服务。It should be noted that all the functions of the execution device 210 can also be implemented by the local device. For example, the local device 301 implements the functions of the execution device 210 and provides services for its own users, or provides services for the users of the local device 302 .
需要理解,本文中的“第一”,“第二”等描述,仅仅为了描述的简单而对相似概念进行区分,并不具有其他限定作用。It should be understood that the descriptions of "first", "second" and so on herein are only for the simplicity of description to distinguish similar concepts, and have no other limiting effect.
本领域的技术人员可以清楚地了解到,本申请提供的各实施例的描述可以相互参照,为描述的方便和简洁,例如关于本发明实施例提供的各装置、设备的功能以及执行的步骤可以参照本申请方法实施例的相关描述,各方法实施例之间、各装置实施例之间也可以互相参照。Those skilled in the art can clearly understand that the descriptions of the embodiments provided in the present application may refer to each other, for the convenience and brevity of the description, for example, the functions and execution steps of the devices and devices provided in the embodiments of the present invention can be Referring to the related descriptions of the method embodiments of the present application, mutual reference may also be made between the method embodiments and the device embodiments.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line, or wireless (eg, infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be a computer Any available medium that can be accessed or a data storage device such as a server, data center, etc., that contains one or more of the available mediums integrated.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,在没有超过本申请的范围内,可以通过其他的方式实现。例如,以上所描述的实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners without exceeding the scope of the present application. For example, the above-described embodiments are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined. Either it can be integrated into another system, or some features can be omitted, or not implemented. The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units . Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment. Those of ordinary skill in the art can understand and implement it without creative effort.
另外,所描述装置和方法以及不同实施例的示意图,在不超出本申请的范围内,可以与其它系统,模块,技术或方法结合或集成。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连 接,可以是电子、机械或其它的形式。In addition, the described apparatus and methods, as well as the schematic diagrams of the various embodiments, may be combined or integrated with other systems, modules, techniques or methods without departing from the scope of this application. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electronic, mechanical or other forms.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (19)

  1. 一种数据处理方法,其特征在于,包括:A data processing method, comprising:
    基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块;Selecting the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block;
    获取与所述第一参考数据块相关联的第一模型;obtaining a first model associated with the first reference data block;
    基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得;Based on a compression model, the first data block is compressed to generate a first compressed data block, and the compression model is obtained according to the first model;
    生成第一压缩数据包,所述第一压缩数据包中包括所述第一压缩数据块和压缩模型信息,所述压缩模型信息为根据所述压缩模型获得。A first compressed data package is generated, where the first compressed data package includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
  2. 根据权利要求1所述的方法,其特征在于,所述基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,具体为:The method according to claim 1, wherein the first data block is compressed based on a compression model to generate the first compressed data block, specifically:
    基于所述压缩模型,预测所述第一数据块中的单位数据的出现概率;predicting the occurrence probability of unit data in the first data block based on the compression model;
    根据所述第一数据块中的单位数据的出现概率,对所述第一数据块进行压缩,生成第一压缩数据块。According to the occurrence probability of unit data in the first data block, the first data block is compressed to generate a first compressed data block.
  3. 根据权利要求1或2所述的方法,其特征在于,所述基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得,具体为:The method according to claim 1 or 2, wherein the first data block is compressed based on a compression model to generate a first compressed data block, and the compression model is obtained according to the first model ,Specifically:
    采用所述第一模型作为压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块。Using the first model as a compression model, the first data block is compressed to generate a first compressed data block.
  4. 根据权利要求3所述的方法,其特征在于,所述压缩模型信息包括所述第一模型或者所述第一模型的标识。The method according to claim 3, wherein the compressed model information includes the first model or an identifier of the first model.
  5. 根据权利要求1或2所述的方法,其特征在于,所述基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得,具体为:The method according to claim 1 or 2, wherein the first data block is compressed based on a compression model to generate a first compressed data block, and the compression model is obtained according to the first model ,Specifically:
    采用第二模型作为压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述第二模型通过使用所述第一数据块中的部分数据训练所述第一模型获得。Using the second model as a compression model, the first data block is compressed to generate a first compressed data block, and the second model is obtained by training the first model using part of the data in the first data block.
  6. 根据权利要求5所述的方法,其特征在于,所述压缩模型信息包括以下任一项:所述第二模型;所述第二模型的标识;所述第一模型的标识、及所述第二模型与所述第一模型的差异数据。The method according to claim 5, wherein the compressed model information comprises any one of the following: the second model; the identifier of the second model; the identifier of the first model, and the first model Difference data between the second model and the first model.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述多个参考数据块包括以下至少一种数据块:压缩的数据块、不同数据类型的数据块、周期的不同时间点的数据块。The method according to any one of claims 1-6, wherein the multiple reference data blocks include at least one of the following data blocks: compressed data blocks, data blocks of different data types, and different time points of a cycle data block.
  8. 根据权利要求1-7任一所述的方法,其特征在于,所述方法还包括:存储所述第一数据块作为参考数据块,存储所述压缩模型信息,所述存储的第一数据块与所述存储的压缩模型信息关联存储。The method according to any one of claims 1-7, wherein the method further comprises: storing the first data block as a reference data block, storing the compression model information, and storing the stored first data block and stored in association with the stored compression model information.
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-8, wherein the method further comprises:
    获取所述第一压缩数据包;obtaining the first compressed data packet;
    根据所述第一压缩数据包中的所述压缩模型信息,获取所述压缩模型;obtaining the compression model according to the compression model information in the first compressed data packet;
    通过所述压缩模型对所述第一压缩数据包中的第一压缩数据块进行解压缩,获取 所述第一数据块。Decompress the first compressed data block in the first compressed data packet by using the compression model to obtain the first data block.
  10. 一种数据处理装置,其特征在于,包括处理单元和存储单元,所述存储单元中存储有可执行代码,所述处理单元用于执行所述可执行代码以实现:A data processing apparatus, characterized in that it includes a processing unit and a storage unit, wherein executable codes are stored in the storage unit, and the processing unit is configured to execute the executable codes to achieve:
    基于待压缩的第一数据块与预存的各个参考数据块的相似度,选择第一参考数据块;Selecting the first reference data block based on the similarity between the first data block to be compressed and each pre-stored reference data block;
    获取与所述第一参考数据块相关联的第一模型;obtaining a first model associated with the first reference data block;
    基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得;Based on a compression model, the first data block is compressed to generate a first compressed data block, and the compression model is obtained according to the first model;
    生成第一压缩数据包,所述第一压缩数据包中包括所述第一压缩数据块和压缩模型信息,所述压缩模型信息为根据所述压缩模型获得。A first compressed data package is generated, where the first compressed data package includes the first compressed data block and compression model information, where the compression model information is obtained according to the compression model.
  11. 根据权利要求10所述的装置,其特征在于,所述处理单元用于执行所述可执行代码以实现基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得,具体为:The apparatus according to claim 10, wherein the processing unit is configured to execute the executable code to compress the first data block based on a compression model to generate a first compressed data block, the The compression model is obtained according to the first model, specifically:
    所述处理单元用于执行所述可执行代码以实现采用所述第一模型作为压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块。The processing unit is configured to execute the executable code to implement using the first model as a compression model, compress the first data block, and generate a first compressed data block.
  12. 根据权利要求11所述的装置,其特征在于,所述压缩模型信息包括所述第一模型或者所述第一模型的标识。The apparatus according to claim 11, wherein the compressed model information comprises the first model or an identifier of the first model.
  13. 根据权利要求10所述的装置,其特征在于,所述处理单元用于执行所述可执行代码以实现基于压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述压缩模型为根据所述第一模型获得,具体为:The apparatus according to claim 10, wherein the processing unit is configured to execute the executable code to compress the first data block based on a compression model to generate a first compressed data block, the The compression model is obtained according to the first model, specifically:
    所述处理单元用于执行所述可执行代码以实现采用第二模型作为压缩模型,对所述第一数据块进行压缩,生成第一压缩数据块,所述第二模型通过使用所述第一数据块中的部分数据训练所述第一模型获得。The processing unit is configured to execute the executable code to implement using the second model as a compression model, compress the first data block, and generate a first compressed data block, and the second model uses the first Part of the data in the data block is obtained by training the first model.
  14. 根据权利要求13所述的装置,其特征在于,所述压缩模型信息包括以下任一项:所述第二模型;所述第二模型的标识;所述第一模型的标识、及所述第二模型与所述第一模型的差异数据。The device according to claim 13, wherein the compressed model information comprises any one of the following: the second model; the identifier of the second model; the identifier of the first model, and the first model Difference data between the second model and the first model.
  15. 根据权利要求10-14任一项所述的装置,其特征在于,所述多个参考数据块包括以下至少一种数据块:压缩的数据块、不同数据类型的数据块、周期的不同时间点的数据块。The apparatus according to any one of claims 10-14, wherein the plurality of reference data blocks include at least one of the following data blocks: compressed data blocks, data blocks of different data types, and different time points of a cycle data block.
  16. 根据权利要求10-14任一所述的装置,其特征在于,所述处理单元还用于执行所述可执行代码以实现:存储所述第一数据块作为参考数据块,存储所述压缩模型信息,所述存储的第一数据块与所述存储的压缩模型信息关联存储。The apparatus according to any one of claims 10-14, wherein the processing unit is further configured to execute the executable code to implement: storing the first data block as a reference data block and storing the compression model information, the stored first data block is stored in association with the stored compression model information.
  17. 根据权利要求10-16任一项所述的装置,其特征在于,所述处理单元还用于执行所述可执行代码以实现:The apparatus according to any one of claims 10-16, wherein the processing unit is further configured to execute the executable code to achieve:
    获取所述第一压缩数据包;obtaining the first compressed data packet;
    根据所述第一压缩数据包中的所述压缩模型信息,获取所述压缩模型;obtaining the compression model according to the compression model information in the first compressed data packet;
    通过所述压缩模型对所述第一压缩数据包中的第一压缩数据块进行解压缩,获取所述第一数据块。Decompress the first compressed data block in the first compressed data packet by using the compression model to obtain the first data block.
  18. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,当所述计 算机程序在计算机或处理器中执行时,令所述计算机或处理器执行权利要求1-9中任一项的所述的方法。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed in a computer or a processor, the computer or processor is caused to execute any one of claims 1-9 the described method.
  19. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机或处理器中运行时,使得所述计算机或处理器执行如权利要求1-9任一项所述的方法。A computer program product, characterized in that, when the computer program product is executed in a computer or a processor, the computer or processor is caused to execute the method according to any one of claims 1-9.
PCT/CN2021/076545 2021-02-10 2021-02-10 Data processing method and apparatus WO2022170569A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180067859.2A CN116368796A (en) 2021-02-10 2021-02-10 Data processing method and device
PCT/CN2021/076545 WO2022170569A1 (en) 2021-02-10 2021-02-10 Data processing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/076545 WO2022170569A1 (en) 2021-02-10 2021-02-10 Data processing method and apparatus

Publications (1)

Publication Number Publication Date
WO2022170569A1 true WO2022170569A1 (en) 2022-08-18

Family

ID=82838047

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/076545 WO2022170569A1 (en) 2021-02-10 2021-02-10 Data processing method and apparatus

Country Status (2)

Country Link
CN (1) CN116368796A (en)
WO (1) WO2022170569A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116820352A (en) * 2023-08-23 2023-09-29 湖南奔普智能科技有限公司 Self-service settlement system of ward with data disaster recovery function
CN117150518A (en) * 2023-08-04 2023-12-01 中国移动通信集团四川有限公司 Communication carrier data security encryption method and system
CN117272688A (en) * 2023-11-20 2023-12-22 四川省交通勘察设计研究院有限公司 Compression and decompression method, device and system for structural mechanics simulation data

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116915259B (en) * 2023-09-12 2023-12-01 山东先飞数智物流科技有限公司 Bin allocation data optimized storage method and system based on internet of things

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1338235A (en) * 2000-08-18 2002-03-06 Smit有限公司 Method and device for video compress encoding based on division
US6452602B1 (en) * 1999-12-13 2002-09-17 Ati International Srl Method and apparatus for storing compressed data
CN104715496A (en) * 2015-03-23 2015-06-17 中国科学技术大学 Image prediction method, system and device based on three-dimensional point cloud model under cloud environment
CN106649859A (en) * 2016-12-30 2017-05-10 中国移动通信集团江苏有限公司 Character string-based file compression method and apparatus
CN107743235A (en) * 2017-10-27 2018-02-27 厦门美图之家科技有限公司 Image processing method, device and electronic equipment
CN110072105A (en) * 2019-05-07 2019-07-30 武汉大学深圳研究院 A kind of distributed video compression sampling method for reconstructing for combining side information

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6452602B1 (en) * 1999-12-13 2002-09-17 Ati International Srl Method and apparatus for storing compressed data
CN1338235A (en) * 2000-08-18 2002-03-06 Smit有限公司 Method and device for video compress encoding based on division
CN104715496A (en) * 2015-03-23 2015-06-17 中国科学技术大学 Image prediction method, system and device based on three-dimensional point cloud model under cloud environment
CN106649859A (en) * 2016-12-30 2017-05-10 中国移动通信集团江苏有限公司 Character string-based file compression method and apparatus
CN107743235A (en) * 2017-10-27 2018-02-27 厦门美图之家科技有限公司 Image processing method, device and electronic equipment
CN110072105A (en) * 2019-05-07 2019-07-30 武汉大学深圳研究院 A kind of distributed video compression sampling method for reconstructing for combining side information

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117150518A (en) * 2023-08-04 2023-12-01 中国移动通信集团四川有限公司 Communication carrier data security encryption method and system
CN116820352A (en) * 2023-08-23 2023-09-29 湖南奔普智能科技有限公司 Self-service settlement system of ward with data disaster recovery function
CN116820352B (en) * 2023-08-23 2023-11-10 湖南奔普智能科技有限公司 Self-service settlement system of ward with data disaster recovery function
CN117272688A (en) * 2023-11-20 2023-12-22 四川省交通勘察设计研究院有限公司 Compression and decompression method, device and system for structural mechanics simulation data
CN117272688B (en) * 2023-11-20 2024-02-13 四川省交通勘察设计研究院有限公司 Compression and decompression method, device and system for structural mechanics simulation data

Also Published As

Publication number Publication date
CN116368796A (en) 2023-06-30

Similar Documents

Publication Publication Date Title
WO2022170569A1 (en) Data processing method and apparatus
WO2020221200A1 (en) Neural network construction method, image processing method and devices
WO2021043193A1 (en) Neural network structure search method and image processing method and device
WO2022042002A1 (en) Training method for semi-supervised learning model, image processing method, and device
WO2021190451A1 (en) Method and apparatus for training image processing model
WO2022042713A1 (en) Deep learning training method and apparatus for use in computing device
WO2022022274A1 (en) Model training method and apparatus
CN111401406B (en) Neural network training method, video frame processing method and related equipment
WO2021159714A1 (en) Data processing method and related device
WO2021022521A1 (en) Method for processing data, and method and device for training neural network model
WO2022001805A1 (en) Neural network distillation method and device
WO2021008206A1 (en) Neural architecture search method, and image processing method and device
WO2021155832A1 (en) Image processing method and related device
WO2022228425A1 (en) Model training method and apparatus
WO2021129668A1 (en) Neural network training method and device
WO2023231794A1 (en) Neural network parameter quantification method and apparatus
WO2023284716A1 (en) Neural network searching method and related device
WO2024067884A1 (en) Data processing method and related apparatus
WO2022111387A1 (en) Data processing method and related apparatus
WO2023020613A1 (en) Model distillation method and related device
WO2023051369A1 (en) Neural network acquisition method, data processing method and related device
CN114266897A (en) Method and device for predicting pox types, electronic equipment and storage medium
WO2022222854A1 (en) Data processing method and related device
WO2022156475A1 (en) Neural network model training method and apparatus, and data processing method and apparatus
WO2021136058A1 (en) Video processing method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21925232

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21925232

Country of ref document: EP

Kind code of ref document: A1