WO2019191904A1 - 一种数据处理方法及装置 - Google Patents

一种数据处理方法及装置 Download PDF

Info

Publication number
WO2019191904A1
WO2019191904A1 PCT/CN2018/081757 CN2018081757W WO2019191904A1 WO 2019191904 A1 WO2019191904 A1 WO 2019191904A1 CN 2018081757 W CN2018081757 W CN 2018081757W WO 2019191904 A1 WO2019191904 A1 WO 2019191904A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
compression
processed
compressed
order
Prior art date
Application number
PCT/CN2018/081757
Other languages
English (en)
French (fr)
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 CN201880086748.4A priority Critical patent/CN111602111A/zh
Priority to PCT/CN2018/081757 priority patent/WO2019191904A1/zh
Publication of WO2019191904A1 publication Critical patent/WO2019191904A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a data processing method and apparatus.
  • Data compression is a method of reducing the amount of data to reduce storage space without loss of information to improve the efficiency of data transmission, storage and processing.
  • data compression is often required.
  • the current multimedia information includes a variety of media information such as text, sound, images, animation, and video. After digitizing, the amount of data is very large. If the data is not compressed by the multimedia data, the computer system cannot store and exchange it.
  • the existing data compression method is generally used for compressing data of a large amount of data such as images, audio, and video, and the calculation amount is relatively large in order to achieve a certain data compression ratio.
  • the embodiment of the invention provides a data processing method and device, which can achieve a higher compression ratio for data compression with a small calculation amount.
  • a first aspect of the embodiments of the present invention provides a data processing method, including:
  • the compression parameter including an offset, a maximum compression length, and a control frame marker.
  • the plurality of data segments to be processed are separately compressed, and the compressed frame corresponding to the compression method used in the compression process is used to add the compressed data to the compressed data array in chronological order.
  • the compression parameter further includes a frame length, a first-order frame length, and a second-order frame length.
  • the specific implementation manner of acquiring the compression parameter for the data set to be processed may be: acquiring the to-be-processed data set to be processed. The value range of the data; determining an offset, a frame length, a first-order frame length, a second-order frame length, and a control frame flag for the to-be-processed data set according to the value range of the to-be-processed data included in the to-be-processed data set, Control frame markers include start frame markers, compressed mode markers, and end frame markers.
  • the start frame mark is used to mark the beginning of a compressed data segment in the compressed data array, the start frame mark is located at the first position of the compressed data segment; and the end frame mark is used to mark the end of a compressed data segment in the compressed data array, ending The frame marker is located at the last position of the compressed data segment.
  • the specific implementation manner of compressing the data segments to be processed may be: determining, for the target data segment to be processed in the plurality of data segments to be processed, that the indication cursor is in the target data segment to be processed. The current location, the indicator cursor is used to indicate the next data to be processed, wherein the target data segment to be processed is any one of the plurality of data segments to be processed; if the current location of the cursor is not exceeded, the target is to be processed.
  • the compression mode is determined according to the compression condition indicating that the current position of the cursor is satisfied; the data segment to be processed is compressed according to the determined compression mode.
  • the method further includes: if the indication cursor currently indicates the top data to be processed in the target data segment to be processed, the target data segment to be processed in the compressed data array A start frame marker is added to the first position of the corresponding target compressed data segment.
  • the compression mode flag includes a second-order differential tag
  • the compression mode includes a second-order differential compression
  • the specific implementation manner of compressing the target data segment to be processed according to the determined compression mode may be: Whether the current position of the cursor satisfies the compression condition corresponding to the second-order differential compression; if it is satisfied, the current position of the cursor and the subsequent frame length/second-order frame length data are subjected to second-order differential compression; the target compressed data segment is determined.
  • the last compressed mode mark in the middle is a second-order differential mark; if it is a second-order differential mark, the second-order differential-compressed data is added at the next position of the target compressed data segment; if it is not the second-order differential mark, A second-order differential marker is added to the next position of the target compressed data segment, and second-order differentially compressed data is added at the next position of the second-order differential marker; the cursor is moved back to the frame length/second-order frame length.
  • the compressed mode flag further includes a first-order differential tag
  • the compression mode further includes a first-order differential compression
  • the method further includes: Determining whether the current position of the cursor satisfies the compression condition corresponding to the first-order differential compression; if yes, indicating the current position of the cursor and the subsequent frame length/first-order frame length data for first-order differential compression; determining the target compression Whether the last compressed mode mark in the data segment is a first-order differential mark; if it is a first-order differential mark, the first-order differential-compressed data is added at the next position of the target compressed data segment; if not the first-order differential mark, Adding a first-order differential marker to the next position of the target compressed data segment, and adding first-order differentially compressed data to the next position of the first-order differential marker; indicating the cursor back frame length/first-order frame length position.
  • the compressed mode flag further includes a key frame mark
  • the method further includes: indicating the to-be-processed data currently indicated by the cursor Converting data into binary form; determining whether the last compressed mode mark in the target compressed data segment is a key frame mark; if it is a key frame mark, adding binary form data at the next position of the target compressed data segment; The key frame mark adds the key frame mark at the next position of the target compressed data segment, and adds the binary form data at the next position of the key frame mark; the pointing cursor is moved back to a position.
  • the compression condition includes a data length condition, a compression feasibility condition, and a collision avoidance condition;
  • the data length condition of the second-order differential compression is: indicating that at least two compressed data are in front of the current position of the cursor, And indicating the current position of the cursor and at least the frame length / second-order frame length data;
  • the second-order differential compression compression feasibility condition is: indicating the current position of the cursor and the subsequent frame length / second-order frame length data
  • the second-order difference value is smaller than the second-order frame maximum value, the second-order frame maximum value is the maximum value represented by the binary number of the second-order frame length;
  • the second-order differential compression collision avoidance condition is: the data obtained after the second-order differential compression and The control frame mark is not the same;
  • the data length condition of the first-order differential compression is: indicating that the cursor is currently in front of at least one compressed data, and indicates that the cursor is currently located and at least has a frame length/first-order frame length.
  • the compression feasibility condition of the first-order differential compression is: indicating the current position of the cursor and the frame length behind it.
  • the first-order difference value of the first-order frame length data is smaller than the first-order frame maximum value, and the first-order frame maximum value is the maximum value represented by the binary number of the first-order frame length;
  • the collision avoidance condition of the first-order differential compression is: first-order The data obtained after differential compression is different from the control frame mark.
  • the control frame mark includes a start frame mark, a compressed mode mark, and an end frame mark
  • the compressed data array includes at least one compressed data segment
  • the method further includes: determining a data segment to be decompressed according to the compression parameter, where The data segment to be decompressed is any compressed data segment in which the first frame in the compressed data array is the start frame mark, and the last frame is the end frame mark; the data segment to be decompressed is divided into multiple according to the compressed mode flag included in the data segment to be decompressed.
  • Each of the data segments to be decompressed includes respective compressed mode marks and data to be decompressed; and the plurality of data segments to be decompressed are respectively decompressed according to respective compressed mode marks.
  • the compressed mode flag includes a key frame mark, a first-order difference mark, and a second-order difference mark
  • the specific implementation manner of decompressing the plurality of data segments to be decompressed according to the respective compression mode marks may be : If the compression mode is marked as a key frame mark, the data to be decompressed included in the decompressed sub-data segment is decompressed by converting the binary form into a decimal form; if the compression mode is marked as a first-order differential mark, the first order is followed.
  • the decompression method corresponding to the differential compression decompresses the data to be decompressed included in the data segment to be decompressed; if the compression mode is marked as a second-order differential tag, decompresses the data segment to be decompressed according to the decompression method corresponding to the second-order differential compression
  • the data to be decompressed is included; the data obtained after decompression is offset according to the offset included in the compression parameter, and the data segment to be processed corresponding to the data segment to be decompressed is obtained.
  • the method further includes recombining the data segments to be processed obtained by decompressing all the compressed data segments included in the compressed data array in time series to obtain a data set to be processed.
  • a second aspect of the embodiments of the present invention provides a data processing apparatus, including:
  • an obtaining unit configured to acquire a compression parameter for the data set to be processed, where the compression parameter includes an offset, a maximum compression length, and a control frame label.
  • an offset unit configured to perform offset according to the offset to be processed data included in the data set to be processed.
  • a dividing unit configured to divide the offset data to be processed into a plurality of data segments to be processed according to a maximum compression length.
  • the processing unit is configured to separately compress the plurality of data segments to be processed, and use the control frame marks corresponding to the compression mode used in the compression process to add the compressed data to the compressed data array in time sequence.
  • a third aspect of the embodiments of the present invention provides another data processing apparatus, including:
  • the obtaining unit is configured to obtain a value range of the to-be-processed data included in the to-be-processed data set.
  • a determining unit configured to determine, according to the value range of the to-be-processed data included in the to-be-processed data set, an offset, a frame length, a first-order frame length, a second-order frame length, and a control frame flag for the to-be-processed data set.
  • the start frame mark is used to mark the beginning of a compressed data segment in the compressed data array, the start frame mark is located at the first position of the compressed data segment; and the end frame mark is used to mark the end of a compressed data segment in the compressed data array, ending The frame marker is located at the last position of the compressed data segment.
  • a dividing unit configured to perform offset according to the offset to be processed data to be processed in the data set, and divide the offset data to be processed into a plurality of to-be-processed data segments according to a maximum compression length.
  • the determining unit is further configured to determine, for a target data segment to be processed in the plurality of data segments, a location indicating that the cursor is currently in the target data segment to be processed, and the indication cursor is used to indicate the next to-be-processed data, the target
  • the data segment to be processed is any one of the plurality of data segments to be processed.
  • a processing unit configured to: if the indication cursor currently indicates the top-ranked data to be processed in the data segment to be processed, the first target compressed data segment corresponding to the target data segment to be processed in the compressed data array Add a start frame marker at each location.
  • the determining unit is configured to determine, if the current location of the cursor does not exceed the position of the last pending data in the data segment to be processed, whether the position where the cursor is currently located satisfies the compression condition corresponding to the second-order differential compression.
  • the compression unit is configured to perform second-order differential compression by indicating the current position of the cursor and the subsequent frame length/second-order frame length data if the position where the cursor is currently located satisfies the compression condition corresponding to the second-order differential compression.
  • the determining unit is further configured to determine whether the last compressed mode flag in the target compressed data segment is a second-order differential flag.
  • the processing unit is further configured to add second-order differentially compressed data at a next position of the target compressed data segment if the last compressed mode flag in the target compressed data segment is a second-order differential flag.
  • the processing unit is further configured to add a second-order differential marker at a next position of the target compressed data segment if the last compressed mode flag in the target compressed data segment is not a second-order differential marker, and add a second-order differential marker at the second-order differential marker The second-order differentially compressed data is added to the next position.
  • the mobile unit is configured to move the indication cursor back frame length/second order frame length.
  • the determining unit in the data processing apparatus is further configured to determine whether a location indicating whether the cursor is currently located satisfies a compression condition corresponding to the first-order differential compression.
  • the compression unit is further configured to: if the position where the cursor is currently located satisfies the compression condition corresponding to the first-order differential compression, perform first-order differential compression on the data indicating the current position of the cursor and the subsequent frame length/first-order frame length data. .
  • the determining unit is further configured to determine whether the last compressed mode flag in the target compressed data segment is a first-order differential flag.
  • the processing unit is further configured to add first-order differentially compressed data to a next position of the target compressed data segment if the last compressed mode flag in the target compressed data segment is a first-order differential flag.
  • the processing unit is further configured to: if the last compressed mode flag in the target compressed data segment is not a first-order differential marker, add a first-order differential marker at a next position of the target compressed data segment, and the first-order differential marker The first-order differentially compressed data is added to the next position.
  • the mobile unit is further configured to move the indication cursor back frame length/first-order frame length.
  • the processing unit in the data processing apparatus is further configured to: if the location where the cursor is currently located does not satisfy the compression condition corresponding to the first-order differential compression, the data to be processed currently indicated by the cursor is indicated Converted to data in binary form.
  • the determining unit is further configured to determine whether the last compressed mode flag in the target compressed data segment is a key frame flag.
  • the processing unit is further configured to add data in binary form at a next position of the target compressed data segment if the last compressed mode flag in the target compressed data segment is a key frame flag.
  • the processing unit is further configured to add a key frame mark at a next position of the target compressed data segment if the last compressed mode flag in the target compressed data segment is not a key frame mark, and next to the key frame mark Add data in binary form at the location.
  • the mobile unit is further configured to move the indication cursor back to a position.
  • the determining unit in the data processing apparatus is further configured to determine, according to the compression parameter, a data segment to be decompressed, where the data segment to be decompressed is a first frame in the compressed data array, which is a start frame marker. And the last frame is any compressed data segment marked with an end frame.
  • the dividing unit is further configured to divide the data segment to be decompressed into a plurality of data segments to be decompressed according to the compressed mode flag included in the data segment to be decompressed, wherein each data segment to be decompressed includes a respective compressed mode flag and to be Decompress the data.
  • the data processing apparatus further includes:
  • a decompression unit configured to respectively decompress the plurality of sub-decompressed sub-data segments according to the respective compression mode flags.
  • the decompressing unit is specifically configured to: if the compressed mode is marked as a key frame mark, use the method of converting the binary form into a decimal form to solve the data to be decompressed included in the decompressed sub data segment. Compression; if the compression mode is marked as a first-order differential marker, the decompressed data included in the data segment to be decompressed is decompressed according to the decompression method corresponding to the first-order differential compression; if the compression mode is marked as a second-order differential marker, then according to the second The decompression method corresponding to the step differential compression decompresses the data to be decompressed included in the data segment to be decompressed.
  • the data processing apparatus further includes:
  • an offset unit configured to perform offset on the data obtained after the decompression according to the offset included in the compression parameter, to obtain a data segment to be processed corresponding to the data segment to be decompressed before compression.
  • the processing unit is further configured to recombine the data segments to be processed obtained by decompressing all the compressed data segments included in the compressed data array in time sequence to obtain a data set to be processed.
  • a fourth aspect of the embodiments of the present invention provides a data processing apparatus, including: a processor, a communication interface, and a memory, wherein the processor, the communication interface, and the memory are connected to each other, wherein the memory is used to store a computer program.
  • the computer program includes program instructions, and the processor is configured to invoke the program instructions to perform the method provided by the first aspect of the embodiments of the present invention.
  • a fifth aspect of embodiments of the present invention provides a computer readable storage medium storing a computer program, the computer program comprising program instructions, the program instructions, when executed by a processor, causing the processor to execute A method provided by the first aspect of the embodiments of the present invention.
  • the embodiment of the present invention has the following beneficial effects: offsetting the data to be processed by the offset in the obtained compression parameter, and dividing the data to be processed into multiple data segments to be processed according to the maximum compression length in the compression parameter.
  • the plurality of data segments to be processed are separately compressed, and the compressed data is respectively added to the compressed data array in chronological order according to the control frame mark corresponding to the compression mode used in the compression process.
  • the data compression method provided by the embodiment of the invention can achieve a higher compression rate with a smaller calculation amount.
  • FIG. 1 is a schematic flowchart of a data processing method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a data format of a compressed data segment in a compressed data array according to an embodiment of the present invention
  • FIG. 3 is a schematic flow chart of another data processing method according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of converting a decimal number into a binary number in the embodiment of the present invention.
  • FIG. 6 is a schematic flowchart of decompressing compressed data in an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a process of compressing and decompressing two-dimensional data in an embodiment of the present invention.
  • FIG. 8 is a schematic block diagram of a data processing apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic block diagram of another data processing apparatus according to an embodiment of the present invention.
  • FIG. 10 is a schematic block diagram of still another data processing apparatus according to an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a data processing method according to an embodiment of the present invention. The method shown in FIG. 1 may include:
  • a compression parameter for a data set to be processed where the compression parameter includes an offset, a maximum compression length, and a control frame label.
  • the data processing device acquires a compression parameter for the data set to be processed.
  • the data set to be processed is composed of a plurality of to-be-processed data arranged in chronological order.
  • the compression parameters of the data set to be processed are used to determine the structure of the data processing device, and the structure of the data processing device is some parameter indicator in the software. It will be appreciated that the data processing device can be a terminal or a server.
  • the offset in the compression parameter is to ensure that each data in the data to be processed is a positive value from zero for subsequent processing;
  • the maximum compression length in the compression parameter is a fixed parameter of the data processing device. Used to indicate the maximum amount of data that the data processing device can compress at one time;
  • the control frame marker is used to mark the data representation after the current location, and the control frame marker itself does not carry data information.
  • the control frame flag may specifically include: a start frame mark, a compressed mode mark, and an end frame mark, wherein the compressed mode mark includes a first order difference mark, a second order difference mark, and a key frame mark.
  • the start frame marker is used to indicate the beginning of a compressed data segment in the compressed data array
  • the end frame marker is used to represent the end of a compressed data segment in the compressed data array
  • the first-order differential marker is used to represent the data after the current location
  • the second-order differential marker is used to indicate that the data after the current position is the data after the second-order differential compression
  • the key frame marker is used to indicate that the data after the current position is the data that cannot be compressed.
  • the data format of a compressed data segment in the compressed data array is shown in FIG. 2.
  • the compressed mode is marked as the key frame data after the key frame mark, and the compressed mode is marked as the first order difference.
  • the data after the mark is the first-order difference data
  • the data after the compression mode is marked as the second-order difference mark is the second-order difference data;
  • the start frame mark and the end frame mark respectively mark the start and end of a compressed data segment in a compressed data array.
  • the data processing device adds an offset to the data to be processed included in the to-be-processed data set, and divides the offset data to be processed into a plurality of to-be-processed data segments according to the maximum compression length.
  • the data processing apparatus uses the inverse of the minimum value of the data to be processed included in the data set to be processed as the offset of the data to be processed, and the data processing apparatus offsets the data to be processed according to the offset. Exemplarily, if the data range in the data set to be processed is -100 to 200, the offset of the data to be processed is 100.
  • the data processing device offsets the data to be processed according to the offset: adding 100 to each data in the data set to be processed, and obtaining a data range of 0 to 300 for the data to be processed.
  • the maximum compression length is an inherent parameter of the data processing device, and each data processing device corresponds to a maximum compression length.
  • the number of data segments to be processed obtained by dividing the data to be processed by the data processing device is a value obtained by rounding up the length (maximum compression length of the data set to be processed). Exemplarily, if the data volume of the data to be processed included in the data set to be processed is 100 M, and the maximum compression length of the data processing device is 26 M, the data set to be processed is divided into 4 according to the maximum compression length (100/26 upward fetch) Whole) data segments.
  • the data in the data set to be processed may be multi-dimensional data, such as two-dimensional point coordinates (x, y) or three-dimensional accelerometers (x, y, z), and the data processing device will be biased according to the maximum compression length.
  • the data to be processed is divided into a plurality of data segments to be processed, the data may be further separated from the data segments to be processed in the plurality of data segments to be processed, and the data of each dimension is separated according to the dimension of the data segment to be processed. Come out and save the data for each dimension in chronological order.
  • the data in the target data segment to be processed can be expressed as ⁇ (x 1 , y 1 ), (x 2 , y 2 ), (x 3 , y 3 ), (x 4 , y 4 ), ... (x n , y n ) ⁇ , according to the dimension of the data to be processed, the data is divided into sub-sets ⁇ x 1, x 2 , x 3 , x 4 ,..., x n ⁇ and ⁇ y 1, y 2 , y 3 , y 4 , ..., y n ⁇ , the data in each subset is arranged in chronological order.
  • the data in the data set to be processed is multi-dimensional data, it is necessary to determine the compression parameters corresponding to the respective dimensions according to the value range of each dimension data. In order to achieve higher compression efficiency, if the values of different dimensions are different, the data processing device with different compression parameters needs to be processed.
  • the data to be processed is a data set of coordinates of two-dimensional points (x i , y i ), and x i ranges from -20 to 350, and y i ranges from -200 to 1000; The offset of x i is 20, and the offset of y i is 200, which is ten times different. If the same parameters are used, the optimal compression efficiency for x i and y i cannot be achieved at the same time.
  • the data processing device compresses the plurality of data segments to be processed separately, and uses the control frame marks corresponding to the compression mode used in the compression process to add the compressed data to the compressed data array in time sequence.
  • the compressed data array is used to store the compressed data in order, and the compressed data array includes the control frame mark in addition to the compressed data.
  • the control frame flag is used to mark the compression mode corresponding to the data after the control frame mark.
  • the control frame mark includes: a start frame mark, a compressed mode mark, and an end frame mark, wherein the compressed mode mark includes a first order difference mark, a second order difference mark, and a key frame mark.
  • the data processing apparatus can perform the compression process on the plurality of data segments to be processed in parallel, but the data generated after the compression must be arranged in chronological order.
  • the data to be processed includes the data to be processed
  • the data to be processed is divided into a plurality of data segments to be processed; the data of the plurality of data segments to be processed are arranged in chronological order and sent to the data processing device for compression;
  • the compressed data is still arranged in chronological order. If the data to be processed included in the data set to be processed is multi-dimensional data, the data of each dimension in each data segment after compression is also arranged in chronological order.
  • the data processing apparatus offsets the data to be processed by the offset in the obtained compression parameter, and divides the data to be processed into a plurality of data segments to be processed according to the maximum compression length in the compression parameter;
  • the plurality of data segments to be processed are separately compressed, and the compressed data is respectively added to the compressed data array in chronological order according to the control frame mark corresponding to the compression mode used in the compression process.
  • the data in the data set to be processed is divided into data segments, and the divided data segments to be processed are compressed, so that a higher compression ratio can be achieved with a smaller calculation amount.
  • FIG. 3 is a schematic flowchart diagram of another data processing method according to an embodiment of the present invention, where the method includes:
  • the data processing device obtains a value range of the to-be-processed data set.
  • the value range of the data set to be processed is determined by the maximum value and the minimum value in the data to be processed. If the data to be processed included in the data set to be processed is multi-dimensional data, it is necessary to determine the range of values of each dimension data in the data set to be processed, and save them separately.
  • the control frame mark includes a start frame mark, a compressed mode mark, and an end frame mark.
  • the start frame mark is used to mark the beginning of a compressed data segment in the compressed data array
  • the start frame mark is located at the first position of the compressed data segment
  • the end frame mark is used to mark the end of a compressed data segment in the compressed data array.
  • the end frame marker is located at the last position of the compressed data segment.
  • the data processing apparatus determines an offset, a frame length, a first-order frame length, a second-order frame length, and a control frame flag of the to-be-processed data set according to the value range of the to-be-processed data included in the to-be-processed data set.
  • the opposite of the minimum value of each dimension in the data set to be processed is used as an offset of the corresponding dimension data;
  • the maximum value minus the minimum value plus 5 is recorded as the intermediate number, and the minimum number of bytes required to represent the intermediate number is calculated.
  • the number of bytes is the frame length; the largest frame length can be represented.
  • the five numbers are used as control frame markers, respectively representing the start frame marker, the first-order differential marker, the second-order differential marker, the key frame marker, and the end frame marker; if the frame length is odd, then (frame length -1)/2 is used as one The order frame length, (frame length -1) / 4 as the second-order frame length; if the frame length is even, then (frame length) / 2 as the first-order frame length, (frame length) / 4 as the second-order frame length; The maximum value represented by the binary number of the first-order frame length is taken as the first-order frame maximum value, and the maximum value represented by the binary number of the second-order frame length is taken as the second-order frame maximum value.
  • the data processing device offsets the to-be-processed data included in the data set to be processed according to the offset determined in step 302, and divides the offset data to be processed into multiple data segments to be processed according to the maximum compression length. . It can be understood that the lengths of the plurality of data segments obtained by the data processing device according to the maximum compression length may be different.
  • the data set to be processed is a sequence of decimal values of length 1024, and the maximum compression length of the data processing device is 100 decimal numbers, 11 pieces of data to be processed are obtained according to the maximum compression length, wherein the first 10 are to be processed. There are 100 data for each data segment to be processed in the processed data segment, and only 24 data for the 11th data segment to be processed.
  • the indication cursor is used to indicate the next to-be-processed data
  • the target to-be-processed data segment is any one of the plurality of to-be-processed data segments.
  • the data processing apparatus determines, for a target data segment to be processed in the plurality of data segments to be processed, a location indicating that the cursor is currently located in the target data segment to be processed.
  • the data processing apparatus adds a start frame flag at a first position of the target compressed data segment corresponding to the target data segment to be processed in the compressed data array.
  • the data processing device determines the frame length according to the value range of the data to be processed included in the data set to be processed, and then uses the maximum 5 digits that can be represented by the frame length as the control frame flag, and determines the value indicating the start frame mark therein, and The start frame marker is added to the first position of the target compressed data segment in the compressed data array.
  • the maximum number that can be represented by 2 bytes is as shown in Table 1. If 65535 is used as the start frame mark and 65534 is used as the key frame mark, 65533 is used as the second.
  • the order frame mark, 65532 as the first-order frame mark, and 65531 as the end frame mark first add the start frame mark 1111111111111 at the first position of the target compressed data segment in the compressed data array.
  • the multi-byte data converted to binary in the embodiment of the present invention may be in the big end mode (the high byte of the data is stored in the low address of the memory, and the low byte of the data is stored in the high address of the memory. ) or little-endian mode (the low byte of the data is stored in the low address of the memory, the high byte of the data is stored in the high address of the memory) is added to the target compressed data segment of the compressed data array.
  • the same mode needs to be adopted uniformly in the entire compression and decompression system.
  • the compression method of the data to be processed includes first-order differential compression and second-order differential compression. It can be understood that the first-order differential compression or the second-order differential compression needs to meet corresponding compression conditions, wherein the compression conditions include data length conditions, compression feasibility conditions, and collision avoidance conditions.
  • the data length condition of performing second-order differential compression is: indicating that at least two compressed data are in front of the current position of the cursor, and indicating that the current position of the cursor and at least the frame length/second-order frame length data are followed;
  • the compression feasibility condition for performing second-order differential compression is: indicating that the current position of the cursor and the subsequent frame length/second-order frame length data are smaller than the second-order frame maximum value, and the second-order frame maximum value is The binary number of the second-order frame length can represent the maximum value;
  • the collision avoidance condition for the second-order differential compression is: the data obtained after the second-order differential compression is different from the control frame mark.
  • the data length condition of the second-order differential compression is to determine that the data currently indicated by the cursor can perform the second-order difference operation, and the value obtained after the second-order difference operation just generates one frame of data.
  • the indication cursor is currently indicating the first data (ie, 15) of the target data segments 15, 17, 19, 21, 18...
  • the calculation method according to the second-order difference (data[ i]-data[i-1])-(data[i-1]-data[i-2]), it can be seen that data[i] is 15, but data[i-1] and data[i] cannot be determined.
  • the value of -2] so the corresponding second-order difference value cannot be calculated.
  • the compression feasibility condition of the second-order differential compression is to ensure that the value obtained by performing the second-order differential operation can be represented by a binary number of the second-order frame length.
  • the frame length is 1 byte
  • the second-order frame length is 1/2 byte, that is, a 4-bit binary number.
  • the second-order frame length can represent a maximum value of 15. If the second-order difference value indicating the current position of the cursor and the following 2 (calculated by the frame length/second-order frame length) is less than 15, the second-order difference is satisfied. Compressed compression feasibility conditions.
  • the collision avoidance condition of the second-order differential compression is used to ensure the uniqueness of the control frame.
  • the role of the control frame is to mark the data representation after the current position. If it is not possible to ensure the uniqueness of the control frame in the compressed data array, the error will be decompressed when the data is decompressed.
  • the last pending data in the target pending data segment is the last pending data in the target pending data segment. If the indication cursor currently indicates the last pending data in the target pending data segment and the currently indicated data has been compressed, the compression of the target pending data segment is ended, and at the next position in the target compressed data segment Join the end frame tag.
  • the second-order differential compression is performed by indicating the current position of the cursor and the subsequent frame length/second-order frame length data.
  • a second-order difference value indicating a position where the cursor is located and a frame length/second-order frame length subsequent to the cursor is calculated, and the calculated value is converted into a binary number and sequentially arranged in chronological order.
  • Each 8 bits is composed of one byte to form one frame.
  • the second-order difference is calculated as: (data[i]-data[i-1])-(data[i-1]-data[i-2]), where i is the location where the cursor is currently located, Data is the target data segment to be processed, and data[i] represents the i-th data in the target data segment to be processed.
  • the last compressed mode in the target compressed data segment is marked as the newly added compressed mode flag in the target compressed data segment. It can be understood that the compressed data corresponding to the compressed mode flag is included in the target compressed data segment after the last compressed mode flag.
  • the compressed mode mark further includes key frame data; if the last compressed mode in the target compressed data segment is marked as first order The differential compression flag is followed by the first-order differential compression data.
  • the last compressed mode flag in the target compressed data segment is a second-order differential flag
  • the second-order differentially compressed data is added to the next position of the target compressed data segment.
  • the last compressed mode flag in the target compressed data segment is a second-order differential marker, it indicates that the data following the second-order differential marker in the target compressed data segment is the data obtained after the second-order differential compression. .
  • the second-order differentially compressed data is directly added to the next position of the target compressed data segment. This embodiment ensures that only one second-order differential compressed data is needed in the target compressed data segment. Second-order differential markers are used to identify data compression efficiency.
  • the last compressed mode flag in the target compressed data segment is not a second-order differential marker, add a second-order differential marker at the next position of the target compressed data segment, and join at the next position of the second-order differential marker. Second-order differentially compressed data.
  • the last compressed mode flag in the target compressed data segment is not a second-order differential flag, it indicates that the last compression method in the target compressed data segment is not second-order differential compression, and then the target compressed data segment needs to be added first.
  • a second-order differential marker is then added to the second-order differentially compressed data at the next location of the second-order differential marker.
  • the data added to the target compressed data segment is in a binary form, that is, the value obtained by the second-order differential calculation needs to be converted into a binary form, and then added to the target compressed data segment.
  • a binary form that is, the value obtained by the second-order differential calculation needs to be converted into a binary form, and then added to the target compressed data segment.
  • the frame length is 3 bytes
  • each frame needs to include 6 second-order differential data, and if the second-order difference operation is obtained, the value obtained is: 14,13 14,14,14,13, the process of binary conversion of the six second-order differential data is shown in FIG. 4.
  • the cursor is moved back to the frame length/second order frame length.
  • the determination may be continued to determine whether the position where the cursor is located satisfies the compression condition corresponding to the first-order differential compression, and specifically includes the following steps 312-317. .
  • the compression conditions corresponding to the first-order differential compression include a data length condition, a compression feasibility condition, and a collision avoidance condition.
  • the data length condition of the first-order differential compression is: indicating that there is at least one compressed data in front of the current position of the cursor, and indicating the current position of the cursor and at least the frame length/first-order frame length data; first-order difference
  • the compression feasibility condition of the compression is: indicating that the current position of the cursor and the subsequent frame length/first-order frame length data are less than the first-order frame maximum value, and the first-order frame maximum value is the first-order frame length.
  • the maximum value represented by the binary number; the collision avoidance condition of the first-order differential compression is: the data obtained after the first-order differential compression is different from the control frame mark.
  • the data length condition of the first-order differential compression is used to ensure that the data of the current position can perform the first-order difference operation, and the first-order difference operation is performed to generate one frame of data.
  • the compression feasibility condition of the first-order differential compression is used to ensure that the value obtained by the first-order difference operation can be represented by the binary number of the first-order frame length.
  • the collision avoidance condition of the first-order differential compression is used to ensure the uniqueness of the control frame.
  • the first position differential compression is performed by indicating the current position of the cursor and the subsequent frame length/first-order frame length data.
  • the data processing device indicates the current location of the cursor and the subsequent frame length/first-order frame.
  • the length data is subjected to first-order differential compression.
  • the first-order difference is calculated as data[i]-data[i-1], i is the location where the cursor is currently located, data is the target data segment to be processed, and data[i] represents the target data segment to be processed. i data.
  • the last compressed mode in the target compressed data segment is marked as the latest added compressed mode flag in the target compressed data segment.
  • the compressed data corresponding to the compressed mode flag is included after the last compressed mode flag in the target compressed data segment.
  • the last compressed mode in the target compressed data segment is marked as a second-order differential mark, the second-order differential mark is further included in the target compressed data segment; if the target compressed data segment is in the middle row
  • the last compressed mode is marked as a key frame flag, and the key frame data in binary form is also included after the key frame mark in the target compressed data segment.
  • the last compressed mode flag in the target compressed data segment is a first-order differential flag
  • the first-order differentially compressed data is added to the next position of the target compressed data segment.
  • the last compressed mode flag in the target compressed data segment is a first-order differential flag, it indicates that the last compression is first-order differential compression, and the first-order differential compressed data is directly added.
  • the target is compressed in the data segment.
  • the last compressed mode flag in the target compressed data segment is not a first-order differential flag, add a first-order differential flag at the next position of the target compressed data segment, and join at the next position of the first-order differential marker.
  • First-order differentially compressed data If the last compressed mode flag in the target compressed data segment is not a first-order differential flag, add a first-order differential flag at the next position of the target compressed data segment, and join at the next position of the first-order differential marker.
  • the last compressed mode flag in the target compressed data segment is not a first-order differential flag, it indicates that the last data compression is not a first-order differential compression, so it is necessary to first add a first-order differential marker to the target compressed data segment. First, the first-order differentially compressed data is added to the next position of the first-order differential mark.
  • the method may further include the following steps 318-322.
  • the data to be processed indicated by the cursor is converted into data in binary form.
  • the data processing device converts the data to be processed currently indicated by the cursor into binary data, that is, converts a decimal number into a form represented by a binary number.
  • binary data that is, converts a decimal number into a form represented by a binary number.
  • FIG. 5 an implementation method of converting a decimal number 12345 into a binary number of 2 bytes is performed.
  • the position where the cursor is located may not satisfy the second-order difference condition or the first-order difference condition.
  • the data in the target data segment to be processed is not differentially compressed, but is converted as key frame data.
  • the first position in the target compressed data segment is the start frame mark
  • the data after the start of the frame mark is the key frame data.
  • a key frame mark is added at the next position of the start frame mark, and then the compression mode flag is determined.
  • the binary form data is added at the next position of the target compressed data segment.
  • the last key frame mark in the target compressed data segment may be the key frame mark added at the next position of the start frame mark in step 319, or may be the last compression process in the target compressed data segment. Keyframe tags added.
  • the last compressed mode flag in the target compressed data segment is not a key frame mark, add a key frame mark at a next position of the target compressed data segment, and add a binary form at the next position of the key frame mark. data.
  • the last compressed mode flag in the target compressed data segment is not a key frame flag, indicating that the last compression is second-order differential compression or first-order differential compression, and the key is added to the next position in the target compressed data segment.
  • Binary data is added after the frame is marked.
  • the corresponding compression mode such as first-order differential compression and second-order differential compression
  • the corresponding compression mode may be determined according to a compression condition that indicates that the cursor is currently located. If the position where the cursor is located satisfies the second-order differential compression, the second-order differential compression is performed; when the position where the pointing cursor is located does not satisfy the compression condition corresponding to the second-order differential compression, it is determined whether the position of the current cursor is satisfied to satisfy the first order.
  • the compression condition corresponding to the differential compression if the position where the cursor is located does not satisfy the compression condition corresponding to the first-order differential compression, the data to be processed indicated by the indication cursor is stored in the form of key frame data.
  • the compression ratio of the second-order differential compression is higher than the compression ratio of the first-order differential compression. It can be seen that, in the above manner, the data to be processed included in the data set to be processed can be realized to achieve a large compression ratio with a small calculation amount.
  • the data processing method further includes a process of data decompression, as shown in FIG. 6, the data decompression process includes:
  • the data segment to be decompressed is any compressed data segment in which the first frame in the compressed data array is the start frame mark, and the last frame is the end frame mark.
  • the data in the compressed data array is read frame by frame in chronological order, and it is determined whether the data of each frame is a control frame mark, such as a start frame mark and an end frame mark. When a pair of start frame mark and end frame mark are found, it is determined that the start frame mark and the end frame mark are a target pending data segment.
  • the specific implementation method for determining whether the data of each frame is a control frame mark may be a bitwise comparison, and the data of each frame may be converted into a decimal value form, and the control frame of the decimal representation form. Perform numerical comparisons.
  • the compressed data array includes a plurality of data segments to be decompressed.
  • Each of the data segments to be decompressed includes a respective compressed mode flag and data to be decompressed.
  • the compression mode in the data segment to be decompressed is marked as a key frame mark, determining that the data after the key frame mark is key frame data; if the compression mode in the data segment to be decompressed is marked as a first order difference mark, Determining the data after the first-order differential mark is the first-order differentially compressed data; if the compressed mode in the data segment to be decompressed is marked as a second-order differential mark, determining that the data after the second-order differential mark is second-order differentially compressed data.
  • the compressed sub-data segment contains only one compressed mode flag, but the compressed mode flag contains one or more compressed data.
  • the data to be decompressed included in the decompressed sub data segment is decompressed by converting the binary form into a decimal form.
  • the compression mode is marked as a first-order differential flag
  • the data to be decompressed included in the data segment to be decompressed is decompressed according to the decompression method corresponding to the first-order differential compression.
  • the current frame in the data segment to be decompressed is divided into a plurality of data blocks in order according to the first-order frame length; and the data blocks are converted into data in decimal form according to the value represented by the binary form, and the obtained data is obtained.
  • data[i-1] is the last data that has been decompressed, and L1[i] is the first-order difference corresponding to the i-th decompressed data, which corresponds to the first-order difference converted by the current frame.
  • the data to be decompressed included in the data segment to be decompressed is decompressed according to the decompression method corresponding to the second-order differential compression. Specifically, the current frame in the data segment to be decompressed is divided into a plurality of data blocks in order according to the second-order frame length; and the data blocks are converted into data in decimal form according to the value represented by the binary form, and the obtained data is obtained.
  • the second-order difference corresponding to the data corresponds to the first-order difference converted by the current frame.
  • the data obtained after decompression is offset according to the offset included in the compression parameter, and the data segment to be processed corresponding to the data segment to be decompressed is obtained.
  • the next frame data is continuously decompressed until the decompression of all the frames is completed. Specifically, it can be determined whether the decompression of all the frames in the data segment to be decompressed is completed by determining whether the data before the end frame in the data segment to be decompressed has been decompressed. Further, if the decompression of all the data segments in the data to be decompressed is not completed, the next data segment to be decompressed is continuously obtained until the decompression process of all the data segments is completed.
  • control frame mark such as the start frame mark and the end frame mark, or the number of the decompressed data and the data recorded during the compression process can be determined. Whether the quantity is consistent to determine whether the decompression of all data segments is completed.
  • the data segments to be processed obtained by decompressing all the compressed data segments included in the compressed data array are recombined in time sequence to obtain a data set to be processed.
  • the target data segment to be processed ⁇ (x 1 , y 1 ), (x 2 , y 2 ) will be processed. , (x 3 , y 3 ), (x 4 , y 4 ), ...
  • (x n , y n ) ⁇ separate the data of each dimension to obtain a subset ⁇ x 1 , x 2 , x 3 , x 4 , ..., x n ⁇ and ⁇ y 1 , y 2 , y 3 , y 4 , ..., y n ⁇ ; then compress two data segments (data segment 1 and data segment 2) according to the compression parameters, specific For the compression process, refer to the method in the embodiment corresponding to FIG. 1 or FIG. 3 to obtain an compressed compressed data array.
  • the data segment to be decompressed is first found according to the control frame mark, such as the start frame mark and the end frame mark, and the data in the decompressed data segment is decompressed according to the step shown in FIG. 6 in the above embodiment.
  • the control frame mark such as the start frame mark and the end frame mark
  • FIG. 8 is a schematic block diagram of a data processing apparatus according to an embodiment of the present invention, for implementing corresponding functions in the data processing apparatus in the embodiment of FIG. 1. As shown in FIG. 8, the data processing apparatus is shown in FIG. Includes the following units:
  • the obtaining unit 801 is configured to acquire a compression parameter for the data set to be processed, where the compression parameter includes an offset, a maximum compression length, and a control frame label.
  • the offset unit 802 is configured to perform offset on the to-be-processed data included in the data set to be processed according to the offset.
  • the dividing unit 803 is configured to divide the offset data to be processed into a plurality of data segments to be processed according to a maximum compression length.
  • the processing unit 804 is configured to separately compress the plurality of data segments to be processed, and use the control frame marks corresponding to the compression mode used in the compression process to add the compressed data to the compressed data array in time sequence.
  • the compression parameter for the data set to be processed is acquired by the obtaining unit 801, and the data to be processed included in the data set to be processed is offset by the offset unit 802 according to the offset.
  • the dividing unit 803 divides the offset data to be processed into a plurality of data segments to be processed according to the maximum compression length.
  • the processing unit 804 compresses the plurality of data segments to be processed separately, and uses the control frame marks corresponding to the compression mode used in the compression process to add the compressed data to the compressed data array in chronological order. It can be seen that the compression mode of the data to be processed included in the data set to be processed can achieve higher compression efficiency with a smaller calculation amount.
  • FIG. 9 is a schematic block diagram of another data processing apparatus according to an embodiment of the present invention, for implementing corresponding functions in the data processing apparatus in the embodiment of FIG. 3, as shown in FIG.
  • the device includes the following units:
  • the obtaining unit 901 is configured to obtain a value range of the to-be-processed data included in the to-be-processed data set.
  • the determining unit 902 is configured to determine, according to the value range of the to-be-processed data included in the to-be-processed data set, an offset, a frame length, a first-order frame length, a second-order frame length, and a control frame flag for the to-be-processed data set.
  • the dividing unit 903 is configured to perform offsetting on the to-be-processed data included in the data set to be processed according to the offset, and divide the offset data to be processed into a plurality of to-be-processed data segments according to the maximum compression length.
  • the determining unit 902 is further configured to determine, for a target data segment to be processed in the plurality of data segments, a location where the cursor is currently located in the target data segment to be processed.
  • the processing unit 904 is configured to: if the indication that the cursor is currently indicating the top data to be processed in the target data segment to be processed, compress the first segment of the target compressed data segment corresponding to the target data segment to be processed in the data array Add a start frame marker at the location.
  • the determining unit 905 is configured to determine, if the current location of the cursor does not exceed the position of the last pending data in the target data segment to be processed, determine whether the current location of the cursor meets the compression condition corresponding to the second-order differential compression .
  • the compressing unit 906 is configured to perform second-order differential compression by indicating the position where the cursor is located and the frame length/second-order frame length data after the cursor is located at the position corresponding to the second-order differential compression.
  • the determining unit 905 is further configured to determine whether the last compressed mode flag in the target compressed data segment is a second-order differential flag.
  • the processing unit 904 is further configured to add second-order differentially compressed data at a next position of the target compressed data segment if the last compressed mode flag in the target compressed data segment is a second-order differential flag.
  • the processing unit 904 is further configured to: if the last compressed mode flag in the target compressed data segment is not a second-order differential flag, add a second-order differential flag at a next position of the target compressed data segment, and in the second-order difference The second-order differentially compressed data is added to the next position of the marker.
  • the mobile unit 907 is configured to move the indication cursor back frame length/second order frame length.
  • the determining unit 905 in the data processing apparatus is further configured to determine whether a location indicating whether the cursor is currently located satisfies a compression condition corresponding to the first-order differential compression.
  • the compression unit 906 is further configured to: if the position where the cursor is currently located satisfies the compression condition corresponding to the first-order differential compression, the first position difference between the current position of the cursor and the frame length/first-order frame length of the cursor is performed. compression.
  • the determining unit 905 is further configured to determine whether the last compressed mode flag in the target compressed data segment is a first-order differential flag.
  • the processing unit 904 is further configured to add first-order differentially compressed data to a next position of the target compressed data segment if the last compressed mode flag in the target compressed data segment is a first-order differential flag.
  • the processing unit 904 is further configured to: if the last compressed mode flag in the target compressed data segment is not a first-order differential flag, add a first-order differential flag at a next position of the target compressed data segment, and first-order difference The first-order differentially compressed data is added to the next position of the marker.
  • the moving unit 907 is further configured to move the indication cursor back frame length/first-order frame length.
  • the processing unit 904 in the data processing apparatus is further configured to: if the location where the cursor is currently located does not satisfy the compression condition corresponding to the first-order differential compression, the current indication indicated by the cursor is to be processed.
  • the data is converted to data in binary form.
  • the determining unit 905 is further configured to determine whether the last compressed mode flag in the target compressed data segment is a key frame flag.
  • the processing unit 904 is further configured to add data in a binary form at a next position of the target compressed data segment if the last compressed mode flag in the target compressed data segment is a key frame flag.
  • the processing unit 904 is further configured to: if the last compressed mode flag in the target compressed data segment is not a key frame mark, add a key frame mark at a next position of the target compressed data segment, and under the key frame mark Add data in binary form at one location.
  • the moving unit 907 is further configured to move the indication cursor back to a position.
  • the determining unit 902 in the data processing apparatus is further configured to determine, according to the compression parameter, a data segment to be decompressed, where the data segment to be decompressed is a first frame in the compressed data array, which is a start frame marker. And the last frame is any compressed data segment of the end frame tag.
  • the dividing unit 903 is further configured to divide the data segment to be decompressed into a plurality of data segments to be decompressed according to the compressed mode flag included in the data segment to be decompressed, where each data segment to be decompressed includes a respective compressed mode flag and The data to be decompressed.
  • the data processing apparatus further includes:
  • the decompressing unit 908 is configured to respectively decompress the plurality of sub-decompressed sub-data segments according to the respective compression mode flags.
  • the decompression unit 908 is specifically configured to: if the compressed mode is marked as a key frame mark, use the method of converting the binary form into a decimal form to perform decompression of the data to be decompressed included in the decompressed sub data segment. Decompressing; if the compression mode is marked as a first-order differential marker, decompressing the data to be decompressed included in the data segment to be decompressed according to the decompression method corresponding to the first-order differential compression; if the compression mode is marked as a second-order differential marker, The decompression method corresponding to the second-order differential compression decompresses the data to be decompressed included in the data segment to be decompressed.
  • the data processing apparatus further includes:
  • the offset unit 909 is configured to perform offset on the data obtained after the decompression according to the offset included in the compression parameter, to obtain a data segment to be processed corresponding to the data segment to be decompressed.
  • the processing unit 904 is further configured to recombine the data segments to be processed obtained by decompressing all the compressed data segments included in the compressed data array in time sequence to obtain a data set to be processed.
  • the obtaining unit 901 obtains the value range of the data to be processed included in the data set to be processed, and determines, by using the determining unit 902, the value range of the data to be processed included in the data set to be processed.
  • the data to be processed included in the data set to be processed is offset by the dividing unit 903 according to the offset, and the data to be processed after the offset is divided into a plurality of data segments to be processed according to the maximum compression length.
  • the determining unit 902 determines the compression mode according to the location where the cursor is currently located, specifically including second-order differential compression and first-order differential compression; compresses the data to be processed according to the determined compression mode, and sequentially compresses the compressed data. Add a compressed data array. It can be seen that the implementation can achieve higher compression efficiency of the data to be processed with a smaller amount of calculation.
  • FIG. 10 is a schematic block diagram of still another data processing apparatus according to an embodiment of the present invention.
  • the apparatus may include: one or more processors 1001, one or more communication interfaces 1002, and a memory 1003.
  • the processor 1001, the communication interface 1002, and the memory 1003 are connected to each other by a bus 1003, wherein the memory 1003 is used to store a computer program, the computer program includes program instructions, and the processor 1001 is configured to invoke the program. instruction.
  • one or more instructions stored in the computer storage medium are loaded and executed by the processor 1001 to implement corresponding steps of the method flow shown in FIG. 1 or FIG. 3; in a specific implementation, in a computer storage medium
  • One or more instructions are loaded by the processor 1001 and the following steps are performed:
  • the compression parameter including an offset, a maximum compression length, and a control frame marker.
  • the plurality of data segments to be processed are separately compressed, and the compressed frame corresponding to the compression method used in the compression process is used to add the compressed data to the compressed data array in chronological order.
  • the specific implementation manner of the processor 1001 for acquiring the compression parameter of the to-be-processed data set may be: obtaining a value range of the to-be-processed data included in the to-be-processed data set; Processing a range of values of the data, determining an offset, a frame length, a first-order frame length, a second-order frame length, and a control frame flag for the data set to be processed, the control frame flag including a start frame flag, a compressed mode flag, and an end frame mark.
  • the specific implementation manner of the processor 1001 compressing the data segments to be processed may be: determining, for the target data segment to be processed in the plurality of data segments to be processed, that the indication cursor is in the target to be processed. The current position of the data segment, the indication cursor is used to indicate the next data to be processed, wherein the target data segment to be processed is any one of the plurality of data segments to be processed; if the current location of the cursor is not exceeded In the data segment of the target to be processed, where the last data to be processed is located, the compression mode is determined according to the compression condition indicating that the current position of the cursor is satisfied; and the data segment to be processed is compressed according to the determined compression mode.
  • the processor 1001 is further configured to: if the indication cursor currently indicates the top pending data in the target data segment to be processed, the target data segment to be processed in the compressed data array A start frame marker is added to the first position of the corresponding target compressed data segment.
  • the compressed mode flag further includes a second-order differential tag
  • the compression mode includes second-order differential compression.
  • the specific implementation manner of the processor 1001 compressing the target data segment to be processed according to the determined compression manner may be: Determining whether the current position of the cursor indicates the compression condition corresponding to the second-order differential compression; if yes, indicating the current position of the cursor and the subsequent frame length/second-order frame length data for second-order differential compression; determining the target compression Whether the last compressed mode flag in the data segment is a second-order differential flag; if it is a second-order differential flag, the second-order differential-compressed data is added at the next position of the target compressed data segment; if not the second-order differential flag, Then adding a second-order differential mark at the next position of the target compressed data segment, and adding second-order differentially compressed data at the next position of the second-order differential mark; indicating the frame backward/second-order frame length of the cursor position.
  • the compressed mode flag further includes a first-order differential tag
  • the compression mode further includes a first-order differential compression
  • the processor 1001 is configured to indicate that the current location of the cursor does not satisfy the compression condition corresponding to the second-order differential compression.
  • the method is further configured to: determine whether the position where the cursor is currently located satisfies the compression condition corresponding to the first-order differential compression; if yes, the first-order differential compression is performed by indicating the position where the cursor is located and the subsequent frame length/first-order frame length data; Determining whether the last compressed mode flag in the target compressed data segment is a first-order differential flag; if it is a first-order differential flag, adding first-order differential-compressed data to the next position of the target compressed data segment; if not the first-order The differential mark adds a first-order differential mark at the next position of the target compressed data segment, and adds the first-order differential-compressed data at the next position of the first-order differential mark; the indicated frame is moved backward by the frame length/first order Frame length position.
  • the processor 1001 is further configured to: convert the data to be processed indicating the current indication of the cursor into data in a binary form. Determining whether the last compressed mode flag in the target compressed data segment is a key frame flag; if it is a key frame flag, adding binary data at the next position of the target compressed data segment; if not the key frame flag, The key frame mark is added to the next position of the target compressed data segment, and the binary form data is added at the next position of the key frame mark; the pointing cursor is moved back one position.
  • the compression condition includes a data length condition, a compression feasibility condition, and a collision avoidance condition;
  • the data length condition of the second-order differential compression is: indicating that at least two compressed data are in front of the position where the cursor is located, and Indicates the position of the cursor and at least the frame length/second-order frame length data;
  • the compression feasibility condition of the second-order differential compression is: the second order of the data indicating the position of the cursor and the subsequent frame length/second-order frame length data.
  • the difference value is smaller than the second-order frame maximum value, the second-order frame maximum value is the maximum value represented by the binary number of the second-order frame length;
  • the collision avoidance condition of the second-order differential compression is: the data and control frame mark obtained after the second-order differential compression
  • the data length condition of the first-order differential compression is: indicating that there is at least one compressed data in front of the position where the cursor is located, and indicating the position where the cursor is located and at least the frame length/first-order frame length data; first-order difference
  • the compression feasibility condition of the compression is: the first order indicating the position of the cursor and the subsequent frame length/first-order frame length data.
  • the difference value is smaller than the first-order frame maximum value, and the first-order frame maximum value is the maximum value represented by the binary number of the first-order frame length;
  • the collision avoidance condition of the first-order differential compression is: the data and control frame mark obtained after the first-order differential compression Not the same.
  • the processor 1001 is further configured to: determine, according to a compression parameter, a data segment to be decompressed, where the data segment to be decompressed is a first frame in the compressed data array, and the last frame is an end. Any compressed data segment of the frame mark; the data segment to be decompressed is divided into a plurality of data segments to be decompressed according to the compressed mode flag included in the data segment to be decompressed, and each data segment to be decompressed includes a respective compressed mode flag and to be decompressed Data; decompressing a plurality of data segments to be decompressed separately according to respective compression mode flags.
  • the specific implementation manner in which the processor 1001 decompresses the plurality of data segments to be decompressed according to the respective compression mode labels may be: if the compression mode is marked as a key frame mark, the binary form is utilized. Decompressing the data to be decompressed included in the decompressed sub-data segment by converting to a decimal form; if the compression mode is marked as a first-order differential tag, decompressing the data segment to be decompressed according to the decompression method of the first-order differential compression The data to be decompressed is included; if the compression mode is marked as a second-order differential marker, the data to be decompressed included in the data segment to be decompressed is decompressed according to the decompression method corresponding to the second-order differential compression; The data obtained after decompression is offset, and the corresponding data segment to be processed before the data segment to be decompressed is compressed.
  • the processor 1001 is further configured to: recombine the data segments to be processed obtained by decompressing all the compressed data segments included in the compressed data array in time series to obtain a data set to be processed.
  • a computer readable storage medium is stored, the computer readable storage medium storing a computer program, the computer program comprising program instructions, the program instructions being executed by a processor to implement the present invention
  • the computer program comprising program instructions, the program instructions being executed by a processor to implement the present invention
  • the computer readable storage medium may be an internal storage unit in the data processing platform described in any of the foregoing embodiments, or a hard disk or a memory of the server.
  • the computer readable storage medium may also be an external storage device of the server, such as a plug-in hard disk equipped on the server, a smart memory card (SMC), and a Secure Digital (SD) card. , Flash Card, etc.
  • SMC smart memory card
  • SD Secure Digital
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

本发明实施例公开了一种数据处理方法及装置,其中方法包括:获取针对待处理数据集合的压缩参数,所述压缩参数包括偏移量、最大压缩长度和控制帧标记;根据所述偏移量对所述待处理数据集合包括的待处理数据进行偏移,并按照所述最大压缩长度将偏移后的待处理数据划分为多个待处理数据段;对所述多个待处理数据段分别进行压缩,并利用压缩过程中采用的压缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。采用本发明,可以实现对数据压缩以较小的计算量达到较高的压缩率。

Description

一种数据处理方法及装置 技术领域
本发明涉及计算机技术领域,尤其涉及一种数据处理方法及装置。
背景技术
数据压缩是指在不丢失信息的前提下,缩减数据量以减少存储空间,以提高数据传输、存储和处理效率的一种方法。在网络带宽有限、载体容量有限的情况下,为了能够较快地传输或更方便地保存数据,常需要对数据进行数据压缩。举例来说,现在的多媒体信息中包括了文本、声音、图像、动画以及视频等多种媒体信息,经过数字化处理后其数据量非常大。如果不对多媒体数据进行数据压缩处理,计算机系统就无法对它进行存储和交换。现有的数据压缩方法一般用于对图像、音频和视频等大数据量的数据进行压缩,为达到一定的数据压缩率其计算量比较大。
发明内容
本发明实施例提供了一种数据处理方法及装置,可以实现对数据压缩以较小的计算量达到较高的压缩率。
本发明实施例第一方面提供一种数据处理方法,包括:
获取针对待处理数据集合的压缩参数,该压缩参数包括偏移量、最大压缩长度和控制帧标记。
根据偏移量对待处理数据集合包括的待处理数据进行偏移,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段;
对多个待处理数据段分别进行压缩,并利用压缩过程中采用的压缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。
作为一种可能的实施方式,压缩参数还包括帧长度、一阶帧长度和二阶帧长度,获取针对待处理数据集合的压缩参数的具体实现方式可以为:获取待处理数据集合包括的待处理数据的取值范围;根据待处理数据集合包括的待处理数据的取值范围,确定针对待处理数据集合的偏移量、帧长度、一阶帧长度、二阶帧长度和控制帧标记,该控制帧标记包括开始帧标记、压缩模式标记和结束帧标记。其中,开始帧标记用于标记压缩数据数组中一个压缩数据段的开始,开始帧标记位于压缩数据段的第一个位置;结束帧标记用于标记压缩数据数组中一个压缩数据段的结束,结束帧标记位于压缩数据段的最后一个位置。
作为一种可能的实施方式,对多个待处理数据段分别进行压缩的具体实现方式可以为:针对多个待处理数据段中的目标待处理数据段,确定指示光标在目标待处理数据段中当前所在的位置,该指示光标用于指示下一个待处理数据,其中,目标待处理数据段为多个待处理数据段中的任一个数据段;若指示光标当前所在的位置未超过目标待处理数据段中排在最后的待处理数据所在的位置,则根据指示光标当前所在位置满足的压缩条件确定压缩方式;按照确定出的压缩方式对目标待处理数据段进行压缩。
作为一种可能的实施方式,所述方法还包括:若指示光标当前指示的是目标待处理数据段中排在最前的待处理数据,则在所述压缩数据数组中所述目标待处理数据段对应的目标压缩数据段的第一个位置处加入开始帧标记。
作为一种可能的实施方式,压缩模式标记包括二阶差分标记,压缩方式包括二阶差分压缩,所述按照确定出的压缩方式对目标待处理数据段进行压缩的具体实现方式可以为:判断指示光标当前所在的位置是否满足二阶差分压缩对应的压缩条件;若满足,则将指示光标当前所在的位置及后面的帧长度/二阶帧长度个数据进行二阶差分压缩;判断目标压缩数据段中排在最后的压缩模式标记是否为二阶差分标记;若是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分压缩后的数据;若不是二阶差分标记,则在目标压 缩数据段的下一个位置处加入二阶差分标记,并在二阶差分标记的下一个位置处加入二阶差分压缩后的数据;将指示光标后移帧长度/二阶帧长度个位置。
作为一种可能的实施方式,压缩模式标记还包括一阶差分标记,压缩方式还包括一阶差分压缩若指示光标当前所在的位置不满足二阶差分压缩对应的压缩条件,所述方法还包括:判断指示光标当前所在的位置是否满足一阶差分压缩对应的压缩条件;若满足,则将指示光标当前所在的位置及后面的帧长度/一阶帧长度个数据进行一阶差分压缩;判断目标压缩数据段中排在最后的压缩模式标记是否为一阶差分标记;若是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分压缩后的数据;若不是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分标记,并在一阶差分标记的下一个位置处加入一阶差分压缩后的数据;将指示光标后移帧长度/一阶帧长度个位置。
作为一种可能的实施方式,压缩模式标记还包括关键帧标记,若指示光标当前所在的位置不满足一阶差分压缩对应的压缩条件,所述方法还包括:将指示光标当前指示的待处理数据转化为二进制形式的数据;判断目标压缩数据段中排在最后的压缩模式标记是否为关键帧标记;若是关键帧标记,则在目标压缩数据段的下一个位置处加入二进制形式的数据;若不是关键帧标记,则在目标压缩数据段的下一个位置处加入关键帧标记,并在关键帧标记的下一个位置处加入二进制形式的数据;将指示光标后移一个位置。
作为一种可能的实施方式,压缩条件包括数据长度条件、压缩可行性条件和冲突避免条件;二阶差分压缩的数据长度条件为:指示光标当前所在的位置前面至少有两个压缩过的数据,且指示光标当前所在的位置及后面至少有帧长度/二阶帧长度个数据;二阶差分压缩的压缩可行性条件为:指示光标当前所在的位置及后面的帧长度/二阶帧长度个数据的二阶差分值都小于二阶帧最大值,二阶帧最大值为二阶帧长度的二进制数表示的最大值;二阶差分压缩的冲突避免条件为:二阶差分压缩后得到的数据与控制帧标记不相同;一阶差分压缩的数据长度条件为:指示光标当前所在的位置前面至少有一个压缩过的数据,且指示光标当前所在的位置及后面至少有帧长度/一阶帧长度个数据;一阶差分压缩的压缩可行性条件为:指示光标当前所在的位置及后面的帧长度/一阶帧长度个数据的一阶差分值都小于一阶帧最大值,一阶帧最大值为一阶帧长度的二进制数表示的最大值;一阶差分压缩的冲突避免条件为:一阶差分压缩后得到的数据与控制帧标记不相同。
作为一种可能的实施方式,控制帧标记包括开始帧标记、压缩模式标记和结束帧标记,压缩数据数组包括至少一个压缩数据段,所述方法还包括:根据压缩参数确定待解压数据段,该待解压数据段为压缩数据数组中第一帧为开始帧标记,且最后一帧为结束帧标记的任一压缩数据段;根据待解压数据段包括的压缩模式标记将待解压数据段划分为多个待解压子数据段,每一个待解压子数据段包括各自的压缩模式标记和待解压数据;按照各自的压缩模式标记分别对多个待解压子数据段进行解压缩。
作为一种可能的实施方式,压缩模式标记包括关键帧标记、一阶差分标记和二阶差分标记,按照各自的压缩模式标记分别对多个待解压子数据段进行解压缩的具体实施方式可以为:若压缩模式标记为关键帧标记,则利用将二进制形式转换为十进制形式的方式对待解压子数据段所包括的待解压数据进行解压缩;若压缩模式标记为一阶差分标记,则按照一阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据;若压缩模式标记为二阶差分标记,则按照二阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据;根据压缩参数包括的偏移量对解压缩后得到的数据进行偏移,得到待解压数据段压缩前对应的待处理数据段。
作为一种可能的实施方式,所述方法还包括:将对压缩数据数组包括的全部压缩数据段进行解压缩得到的待处理数据段按照时间顺序重新组合,得到待处理数据集合。
本发明实施例第二方面提供一种数据处理装置,包括:
获取单元,用于获取针对待处理数据集合的压缩参数,该压缩参数包括偏移量、最大压缩长度和控制帧标记。
偏移单元,用于根据偏移量对待处理数据集合包括的待处理数据进行偏移。
划分单元,用于按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。
处理单元,用于对多个待处理数据段分别进行压缩,并利用压缩过程中采用的压缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。
本发明实施例第三方面提供另一种数据处理装置,包括:
获取单元,用于获取待处理数据集合包括的待处理数据的取值范围。
确定单元,用于根据待处理数据集合包括的待处理数据的取值范围,确定针对待处理数据集合的偏移量、帧长度、一阶帧长度、二阶帧长度和控制帧标记。其中,开始帧标记用于标记压缩数据数组中一个压缩数据段的开始,开始帧标记位于压缩数据段的第一个位置;结束帧标记用于标记压缩数据数组中一个压缩数据段的结束,结束帧标记位于压缩数据段的最后一个位置。
划分单元,用于根据偏移量对待处理数据集合包括的待处理数据进行偏移,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。
所述确定单元,还用于针对多个数据段中的目标待处理数据段,确定指示光标在目标待处理数据段中当前所在的位置,指示光标用于指示下一个待处理数据,所述目标待处理数据段为所述多个待处理数据段中的任一个数据段。
处理单元,用于若指示光标当前指示的是目标待处理数据段中排在最前的待处理数据,则在所述压缩数据数组中所述目标待处理数据段对应的目标压缩数据段的第一个位置处加入开始帧标记。
判断单元,用于若指示光标当前所在的位置未超过目标待处理数据段中排在最后的待处理数据所在的位置,则判断指示光标当前所在的位置是否满足二阶差分压缩对应的压缩条件。
压缩单元,用于若指示光标当前所在的位置满足二阶差分压缩对应的压缩条件,则将指示光标当前所在的位置及后面的帧长度/二阶帧长度个数据进行二阶差分压缩。
所述判断单元,还用于判断目标压缩数据段中排在最后的压缩模式标记是否为二阶差分标记。
所述处理单元,还用于若目标压缩数据段中排在最后的压缩模式标记是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分压缩后的数据。
所述处理单元,还用于若目标压缩数据段中排在最后的压缩模式标记不是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分标记,并在二阶差分标记的下一个位置处加入二阶差分压缩后的数据。
移动单元,用于将指示光标后移帧长度/二阶帧长度个位置。
作为一种可能的实施方式,所述数据处理装置中的所述判断单元,还用于判断指示光标当前所在的位置是否满足一阶差分压缩对应的压缩条件。
所述压缩单元,还用于若指示光标当前所在的位置满足一阶差分压缩对应的压缩条件,则将指示光标当前所在的位置及后面的帧长度/一阶帧长度个数据进行一阶差分压缩。
所述判断单元,还用于判断目标压缩数据段中排在最后的压缩模式标记是否为一阶差分标记。
所述处理单元,还用于若目标压缩数据段中排在最后的压缩模式标记是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分压缩后的数据。
所述处理单元,还用于若目标压缩数据段中排在最后的压缩模式标记不是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分标记,并在一阶差分标记的下一个 位置处加入一阶差分压缩后的数据。
所述移动单元,还用于将指示光标后移帧长度/一阶帧长度个位置。
作为一种可能的实施方式,所述数据处理装置中的所述处理单元,还用于若指示光标当前所在的位置不满足一阶差分压缩对应的压缩条件,将指示光标当前指示的待处理数据转化为二进制形式的数据。
所述判断单元,还用于判断目标压缩数据段中排在最后的压缩模式标记是否为关键帧标记。
所述处理单元,还用于若目标压缩数据段中排在最后的压缩模式标记是关键帧标记,则在目标压缩数据段的下一个位置处加入二进制形式的数据。
所述处理单元,还用于若目标压缩数据段中排在最后的压缩模式标记不是关键帧标记,则在目标压缩数据段的下一个位置处加入关键帧标记,并在关键帧标记的下一个位置处加入二进制形式的数据。
所述移动单元,还用于将指示光标后移一个位置。
作为一种可能的实施方式,所述数据处理装置中的所述确定单元,还用于根据压缩参数确定待解压数据段,该待解压数据段为压缩数据数组中第一帧为开始帧标记,且最后一帧为结束帧标记的任一压缩数据段。
所述划分单元,还用于根据待解压数据段包括的压缩模式标记将待解压数据段划分为多个待解压子数据段,其中,每一个待解压子数据段包括各自的压缩模式标记和待解压数据。
作为一种可能的实施方式,所述数据处理装置还包括:
解压缩单元,用于按照各自的压缩模式标记分别对多个待解压子数据段进行解压缩。
作为一种可能的实施方式,所述解压缩单元具体用于:若压缩模式标记为关键帧标记,则利用将二进制形式转换为十进制形式的方式对待解压子数据段所包括的待解压数据进行解压缩;若压缩模式标记为一阶差分标记,则按照一阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据;若压缩模式标记为二阶差分标记,则按照二阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据。
作为一种可能的实施方式,所述数据处理装置还包括:
偏移单元,用于根据压缩参数包括的偏移量对解压缩后得到的数据进行偏移,得到待解压数据段压缩前对应的待处理数据段。
所述处理单元,还用于将对压缩数据数组包括的全部压缩数据段进行解压缩得到的待处理数据段按照时间顺序重新组合,得到待处理数据集合。
本发明实施例第四方面提供又一种数据处理装置,包括:包括处理器、通信接口和存储器,所述处理器、通信接口和存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行本发明实施例第一方面提供的方法。
本发明实施例第五方面提供一种计算机可读存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行本发明实施例第一方面提供的方法。
实施本发明实施例,具有如下有益效果:通过获取到的压缩参数中的偏移量对待处理数据进行偏移,并根据压缩参数中的最大压缩长度将待处理数据划分为多个待处理数据段;对多个待处理数据段分别进行压缩,并根据压缩过程中采用的压缩方式对应的控制帧标记,将压缩后的数据按照时间顺序分别加入压缩数据数组。本发明实施例提供的数据压缩方式可以实现以较小的计算量达到较高的压缩率。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例提供的一种数据处理方法的示意流程图;
图2是本发明实施例中压缩数据数组中一个压缩数据段的数据格式示意图;
图3是本发明实施例提供的另一种数据处理方法的示意流程图;
图4是本发明实施例中对差分数据进行二进制转换的示意图;
图5是本发明实施例中将十进制数转换为二进制数的示意图;
图6是本发明实施例中对压缩后的数据进行解压缩的示意流程图;
图7是本发明实施例中二维数据的压缩和解压缩过程的示意图;
图8是本发明实施例提供的一种数据处理装置的示意性框图;
图9本发明实施例提供的另一种数据处理装置的示意性框图;
图10是本发明实施例提供的又一种数据处理装置的示意性框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
参见图1,是本发明实施例提供的一种数据处理方法的示意流程图,如图1所示的方法可包括:
101、获取针对待处理数据集合的压缩参数,所述压缩参数包括偏移量、最大压缩长度和控制帧标记。
具体的,数据处理装置获取针对待处理数据集合的压缩参数。其中,待处理数据集合由多个待处理数据按照时间顺序排列组合而成。待处理数据集合的压缩参数用于确定数据处理装置的结构,数据处理装置的结构在软件中即为一些参数指标。可以理解的是,数据处理装置可以是终端或服务器。
其中,压缩参数中的偏移量是为了保证待处理数据中的每个数据都为从零开始的正值,以便于后续的处理;压缩参数中的最大压缩长度为数据处理装置的固定参数,用于表示数据处理装置一次能够压缩的最大数据量;控制帧标记用于标记当前位置之后的数据表达形式,控制帧标记本身不带有数据信息。控制帧标记具体可以包括:开始帧标记、压缩模式标记和结束帧标记,其中压缩模式标记包括一阶差分标记、二阶差分标记和关键帧标记。
示例性的,开始帧标记用于表示压缩数据数组中一个压缩数据段的开始,结束帧标记用于表示压缩数据数组中一个压缩数据段的结束;一阶差分标记用于表示当前位置之后的数据为采用一阶差分压缩后的数据,二阶差分标记用于表示当前位置之后的数据为采用二阶差分压缩后的数据;而关键帧标记用于表示当前位置之后的数据为不能被压缩的数据。
举例来说,如图2所示,图2中所示为压缩数据数组中一个压缩数据段的数据格式,压缩模式标记为关键帧标记之后的数据为关键帧数据,压缩模式标记为一阶差分标记之后的数据为一阶差分数据,压缩模式标记为二阶差分标记之后的数据为二阶差分数据;开始帧标记和结束帧标记分别标记一个压缩数据数组中一个压缩数据段的开始和结束。
102、根据偏移量对待处理数据集合包括的待处理数据进行偏移,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。
具体的,数据处理装置为待处理数据集合包括的待处理数据加上偏移量,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。具体实现中,数据处理装置将待处理数据集合包括的待处理数据中最小值的相反数作为待处理数据的偏移量,数据处理装置根据该偏移量对待处理数据进行偏移。示例性的,若待处理数据集合中的数据范围是-100到200,则待处理数据的偏移量为100。数据处理装置根据偏移量对待处理数据进行偏移的方式为:将待处理数据集合中的每个数据都加上100,得到待处理数据的数据范围为0到300。
其中,最大压缩长度为数据处理装置的固有参数,每一个数据处理装置都对应一个最大压缩长度。数据处理装置对待处理数据进行划分所得的待处理数据段的数目为(待处理数据集合的长度/最大压缩长度)向上取整得到的数值。示例性的,若待处理数据集合包括的待处理数据的数据量为100M,数据处理装置的最大压缩长度为26M,则按照最大压缩长度将待处理数据集合划分为4(100/26的向上取整)个数据段。
可选的,待处理数据集合中的数据可以是多维数据,如二维的点坐标(x,y)或三维的加速度计(x,y,z),则数据处理装置按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段后,还可以包括:针对多个待处理数据段中的目标待处理数据段,根据目标待处理数据段的维度,将各个维度的数据分离出来,并将各个维度的数据分开按时间顺序保存。示例性的,若待处理数据集合为二维点坐标数据集,目标待处理数据段中的数据可以表示为{(x 1,y 1),(x 2,y 2),(x 3,y 3),(x 4,y 4),…(x n,y n)},则按照待处理数据的维度,将数据分为子集合{x 1,x 2,x 3,x 4,…,x n}和{y 1,y 2,y 3,y 4,…,y n},各子集合中的数据按照时间顺序排列。
可以理解的是,若待处理数据集合中的数据为多维数据,则需要根据各个维度数据的取值范围,确定出各个维度对应的压缩参数。为了达到较高的压缩效率,针对不同维度的数据,若取值范围相差较大,则需要采用具备不同压缩参数的数据处理装置进行处理。示例性的,若待处理数据为二维点(x i,y i)坐标的数据集,且x i的取值范围为-20到350,y i的取值范围为-200到1000;则x i的偏移量为20,而y i的偏移量为200,两者相差十倍,若是采用相同的参数,则不能同时实现对x i和y i的最佳压缩效率。
103、对多个待处理数据段分别进行压缩,并利用压缩过程中采用的压缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。
具体的,由数据处理装置对多个待处理数据段分别进行压缩,并利用压缩过程中采用的压缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。其中,压缩数据数组用于按序存放压缩后的数据,压缩数据数组中除了存放压缩后的数据外,还包括控制帧标记。控制帧标记用于标记该控制帧标记之后的数据对应的压缩方式。控制帧标记包括:开始帧标记、压缩模式标记和结束帧标记,其中,压缩模式标记包括一阶差分标记、二阶差分标记和关键帧标记。
可以理解的是,数据处理装置对多个待处理数据段的压缩过程可以并行进行,但压缩后生成的数据须按照时间顺序进行排列。具体的,待处理数据集合所包括待处理数据进行偏移后,被划分为多个待处理数据段;该多个待处理数据段的数据按时间顺序排列,并送入数据处理装置进行压缩;压缩后的数据仍按照时间顺序进行排列。若待处理数据集合所包括的待处理数据为多维数据,则压缩后各个数据段中各个维度的数据也是按照时间顺序进行排列。
通过实施本发明实施例,数据处理装置通过获取到的压缩参数中的偏移量对待处理数据进行偏移,并根据压缩参数中的最大压缩长度将待处理数据划分为多个待处理数据段;对多个待处理数据段分别进行压缩,并根据压缩过程中采用的压缩方式对应的控制帧标记,将压缩后的数据按照时间顺序分别加入压缩数据数组。上述实施方式将待处理数据集合中 的数据进行数据段划分,并对划分后的待处理数据段进行压缩,可以实现以较小的计算量达到较高的压缩率。
请参见图3,图3是本发明实施例提供的另一种数据处理方法的流程示意图,所述方法包括:
301、获取待处理数据集合包括的待处理数据的取值范围。
具体的,数据处理装置获取待处理数据集合的取值范围。
可以理解的是,待处理数据集合的取值范围由待处理数据中的最大值和最小值确定。若待处理数据集合所包括的待处理数据为多维数据,则需要确定待处理数据集合中各个维度数据的取值范围,并分别保存。
302、根据待处理数据集合包括的待处理数据的取值范围,确定针对待处理数据集合的偏移量、帧长度、一阶帧长度、二阶帧长度和控制帧标记。
其中,控制帧标记包括开始帧标记、压缩模式标记和结束帧标记。其中,开始帧标记用于标记压缩数据数组中一个压缩数据段的开始,该开始帧标记位于压缩数据段的第一个位置;结束帧标记用于标记压缩数据数组中一个压缩数据段的结束,该结束帧标记位于压缩数据段的最后一个位置。数据处理装置根据待处理数据集合包括的待处理数据的取值范围,确定待处理数据集合的偏移量、帧长度、一阶帧长度、二阶帧长度和控制帧标记。
具体实现中,若待处理数据集合包括的待处理数据为多维数据,则将待处理数据集合中各个维度最小值的相反数作为相应维度数据的偏移量;对具体的某一维度的数据而言,最大值减去最小值再加5得到的数记为中间数,计算表示该中间数所需要的最小的字节数,这个字节数即为帧长度;将帧长度可以表示的最大的5个数作为控制帧标记,分别表示开始帧标记、一阶差分标记、二阶差分标记、关键帧标记和结束帧标记;若帧长度为奇数,则将(帧长度-1)/2作为一阶帧长度,(帧长度-1)/4作为二阶帧长度;若帧长度为偶数,则将(帧长度)/2作为一阶帧长度,(帧长度)/4作为二阶帧长度;将一阶帧长度的二进制数表示的最大值作为一阶帧最大值,将二阶帧长度的二进制数表示的最大值作为二阶帧最大值。
303、根据偏移量对待处理数据集合包括的待处理数据进行偏移,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。
具体的,数据处理装置根据步骤302中确定出的偏移量对待处理数据集合包括的待处理数据进行偏移,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。可以理解的是,数据处理装置按照最大压缩长度划分得到的多个数据段的长度可以是不一样的。
示例性的,若待处理数据集合是长度为1024的十进制数值序列,数据处理装置的最大压缩长度为100个十进制数,则按照最大压缩长度划分得到11个待处理数据段,其中前10个待处理数据段中每个待处理数据段有100个数据,而第11个待处理数据段只有24个数据。
304、针对多个待处理数据段中的目标待处理数据段,确定指示光标在目标待处理数据段中当前所在的位置。
具体的,指示光标用于指示下一个待处理数据,目标待处理数据段为多个待处理数据段中的任一个数据段。数据处理装置针对多个待处理数据段中的目标待处理数据段,确定指示光标在目标待处理数据段中当前所在的位置。
305、若指示光标当前指示的是目标待处理数据段中排在最前的待处理数据,则在压缩数据数组中目标待处理数据段对应的目标压缩数据段的第一个位置处加入开始帧标记。
具体的,数据处理装置在压缩数据数组中目标待处理数据段对应的目标压缩数据段的 第一个位置处加入开始帧标记。数据处理装置根据待处理数据集合包括的待处理数据的取值范围确定出帧长度,再将帧长度能够表示的最大的5位数作为控制帧标记,确定出其中表示开始帧标记的数值,并将该开始帧标记加入压缩数据数组中目标压缩数据段的第一个位置。
示例性的,若计算出的帧长度为2个字节,则2个字节能够表示的最大的数如表1所示,若将65535作为开始帧标记、65534作为关键帧标记,65533作为二阶帧标记,65532作为一阶帧标记,65531作为结束帧标记,则首先在压缩数据数组中目标压缩数据段的第一个位置处加入开始帧标记1111111111111111。
表1
2个字节所表示的最大的5位数 对应的二进制表示
65535 11111111 11111111
65534 11111111 11111110
65533 11111111 11111101
65532 11111111 11111100
65531 11111111 11111011
需要进一步说明的是,本发明实施例中转换为二进制的多字节数据可以采用大端模式(数据的高字节保存在内存的低地址中,数据的低字节保存在内存的高地址中)或小端模式(数据的低字节保存在内存的低地址中,数据的高字节保存在内存的高地址中)加入压缩数据数组的目标压缩数据段中。但整个压缩和解压系统中需要统一采用同一个模式。
306、若指示光标当前所在的位置未超过目标待处理数据段中排在最后的待处理数据所在的位置,判断指示光标当前所在的位置是否满足二阶差分压缩对应的压缩条件。
具体的,对待处理数据的压缩方式包括一阶差分压缩和二阶差分压缩。可以理解的是,进行一阶差分压缩或二阶差分压缩需要满足相应的压缩条件,其中压缩条件包括数据长度条件、压缩可行性条件和冲突避免条件。其中,进行二阶差分压缩的数据长度条件为:指示光标当前所在的位置前面至少有两个压缩过的数据,且指示光标当前所在的位置及后面至少有帧长度/二阶帧长度个数据;进行二阶差分压缩的压缩可行性条件为:指示光标当前所在的位置及后面的帧长度/二阶帧长度个数据的二阶差分值都小于二阶帧最大值,该二阶帧最大值为二阶帧长度的二进制数能够表示的最大值;进行二阶差分压缩的冲突避免条件为:二阶差分压缩后得到的数据与控制帧标记不相同。
具体的,二阶差分压缩的数据长度条件是要确定指示光标当前指示的数据能够进行二阶差分运算,并且二阶差分运算后得到的值刚好生成一帧数据。示例性的,若指示光标当前所指示的是目标待处理数据段15,17,19,21,18…中的第一个数据(即15),则根据二阶差分的计算方法:(data[i]-data[i-1])-(data[i-1]-data[i-2]),可以看出data[i]为15,但无法确定data[i-1]和data[i-2]的值,因此无法计算对应的二阶差分值。
具体的,二阶差分压缩的压缩可行性条件是用于确保进行二阶差分运算得到的值能够用二阶帧长度的二进制数来表示。示例性的,若帧长度为1个字节,二阶帧长度为1/2个字节,即4位二进制数。二阶帧长度能够表示的最大值为15,若指示光标当前所在位置及后面的2(通过帧长度/二阶帧长度计算得到)位数的二阶差分值均小于15,则满足二阶差分压缩的压缩可行性条件。
具体的,二阶差分压缩的冲突避免条件是用于确保控制帧的独有性。如前所述,控制帧的作用是用于标记当前位置之后的数据表达形式。若不能确保在压缩数据数组中控制帧的独有性,则在对数据进行解压缩时,则会解压错误。
可以理解的是,目标待处理数据段中排在最后的待处理数据即为目标待处理数据段中最后一个待处理数据。若指示光标当前指示目标待处理数据段中排在最后的待处理数据且当前指示的数据已经完成压缩,则结束对目标待处理数据段的压缩,并在目标压缩数据段 中的下一个位置处加入结束帧标记。
307、若指示光标当前所在的位置满足二阶差分压缩对应的压缩条件,则将指示光标当前所在的位置及后面的帧长度/二阶帧长度个数据进行二阶差分压缩。
具体的,计算指示光标所在的位置及后面的帧长度/二阶帧长度个数据的二阶差分值,并将计算得到的数值转换为二进制数按照时间顺序依次排列。将每8位组成一个字节,组成一帧。其中,二阶差分的计算方法为:(data[i]-data[i-1])-(data[i-1]-data[i-2]),其中i是指示光标当前所在的位置,data是目标待处理数据段,data[i]代表目标待处理数据段中的第i个数据。
308、判断目标压缩数据段中排在最后的压缩模式标记是否为二阶差分标记。
具体的,目标压缩数据段中排在最后的压缩模式标记为目标压缩数据段中最新加入的压缩模式标记。可以理解的是,目标压缩数据段中排在最后的压缩模式标记的后面还包括与该压缩模式标记相对应的压缩数据。示例性的,若标压缩数据段中排在最后的压缩模式标记为关键帧标记,则该压缩模式标记后面还包括关键帧数据;若目标压缩数据段中排在最后的压缩模式标记为一阶差分压缩标记,则该压缩模式标记后面还包括一阶差分压缩数据。
309、若目标压缩数据段中排在最后的压缩模式标记是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分压缩后的数据。
可以理解的是,若目标压缩数据段中排在最后的压缩模式标记是二阶差分标记,则表明目标压缩数据段中二阶差分标记后面的数据为上一次进行二阶差分压缩后得到的数据。在上述情况下,直接在目标压缩数据段的下一个位置处加入本次二阶差分压缩后的数据,这种实施方式可以保证在目标压缩数据段中,多个二阶差分压缩数据只需一个二阶差分标记进行标识,能够提高数据的压缩效率。
310、若目标压缩数据段中排在最后的压缩模式标记不是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分标记,并在二阶差分标记的下一个位置处加入二阶差分压缩后的数据。
可以理解的是,若目标压缩数据段中排在最后的压缩模式标记不是二阶差分标记,则表明目标压缩数据段中上一次压缩的方式不是二阶差分压缩,则需要在目标压缩数据段中先加入二阶差分标记,然后在该二阶差分标记的下一个位置处加入二阶差分压缩后的数据。
具体的,加入目标压缩数据段中的数据为二进制的形式,即需要将二阶差分计算后得到的值转换为二进制的形式,再加入目标压缩数据段中。示例性的,若帧长度为3个字节,当满足二阶差分压缩的压缩条件时,每一帧需要包括6个二阶差分数据,若二阶差分运算后得到的值为:14,13,14,13,14,13,则对该6个二阶差分数据进行二进制转换的过程如图4所示。
311、将指示光标后移帧长度/二阶帧长度个位置。
进一步地,若判断出指示光标当前所在的位置不满足二阶差分压缩对应的压缩条件,则可以继续判断指示光标所在的位置是否满足一阶差分压缩对应的压缩条件,具体包括以下步骤312~317。
312、判断指示光标当前所在的位置是否满足一阶差分压缩对应的压缩条件。
其中,一阶差分压缩对应的压缩条件包括数据长度条件、压缩可行性条件和冲突避免条件。其中一阶差分压缩的数据长度条件为:指示光标当前所在的位置前面至少有一个压缩过的数据,且指示光标当前所在的位置及后面至少有帧长度/一阶帧长度个数据;一阶差分压缩的压缩可行性条件为:指示光标当前所在的位置及后面的帧长度/一阶帧长度个数据的一阶差分值都小于一阶帧最大值,该一阶帧最大值为一阶帧长度的二进制数表示的最大值;一阶差分压缩的冲突避免条件为:一阶差分压缩后得到的数据与控制帧标记不相同。
具体的,一阶差分压缩的数据长度条件用于确保当前位置的数据能够进行一阶差分运算,且进行一阶差分运算后刚好生成一帧数据。一阶差分压缩的压缩可行性条件用于确保一阶差分运算得到的数值能够用一阶帧长度的二进制数来进行表示。一阶差分压缩的冲突避免条件用于确保控制帧的独有性。
313、若指示光标当前所在的位置满足一阶差分压缩对应的压缩条件,则将指示光标当前所在的位置及后面的帧长度/一阶帧长度个数据进行一阶差分压缩。
具体的,若指示光标当前所在的位置同时满足一阶差分压缩对应的数据长度条件、压缩可行性条件和冲突避免条件,数据处理装置将指示光标当前所在的位置及后面的帧长度/一阶帧长度个数据进行一阶差分压缩。其中,一阶差分的计算方法为data[i]-data[i-1],i是指示光标当前所在的位置,data为目标待处理数据段,data[i]代表目标待处理数据段中第i个数据。
314、判断目标压缩数据段中排在最后的压缩模式标记是否为一阶差分标记。
可以理解的是,目标压缩数据段中排在最后的压缩模式标记为该目标压缩数据段中最新加入的压缩模式标记。在目标压缩数据段中排在最后的压缩模式标记之后包括与该压缩模式标记对应的压缩数据。示例性的,若目标压缩数据段中排在最后的压缩模式标记为二阶差分标记,则在目标压缩数据段中的二阶差分标记后还包括二阶差分数据;若目标压缩数据段中排在最后的压缩模式标记为关键帧标记,则在目标压缩数据段中关键帧标记之后还包括二进制形式的关键帧数据。
315、若目标压缩数据段中排在最后的压缩模式标记是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分压缩后的数据。
可以理解的是,若目标压缩数据段中排在最后的压缩模式标记是一阶差分标记,则表明上一次进行的压缩为一阶差分压缩,则将本次一阶差分压缩后的数据直接加入该目标压缩数据段中。
316、若目标压缩数据段中排在最后的压缩模式标记不是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分标记,并在一阶差分标记的下一个位置处加入一阶差分压缩后的数据。
可以理解的是,若目标压缩数据段中排在最后的压缩模式标记不是一阶差分标记,则表明上一次进行的数据压缩不是一阶差分压缩,因此需要在目标压缩数据段中先加入一阶差分标记,再在一阶差分标记的下一个位置处加入一阶差分压缩后的数据。
317、将指示光标后移帧长度/一阶帧长度个位置。
进一步地,若判断出指示光标当前所在的位置也不满足一阶差分压缩对应的压缩条件,则所述方法还可包括以下步骤318~322。
318、若指示光标当前所在的位置不满足一阶差分压缩对应的压缩条件,将指示光标当前指示的待处理数据转化为二进制形式的数据。
具体的,数据处理装置将指示光标当前指示的待处理数据转化为二进制形式的数据即是将一个十进制数转换为二进制数表示的形式。示例性的,如图5所示,对十进制数12345转换为2个字节的二进制数的实现方法。指示光标所在的位置可能既不满足二阶差分条件,也不满足一阶差分条件,此时将对目标待处理数据段中的数据不进行差分压缩,而是作为关键帧数据进行转换。
319、判断目标压缩数据段中排在最后的压缩模式标记是否为关键帧标记。
可以理解的是,目标压缩数据段中的第一个位置处为开始帧标记,而根据一阶差分压缩和二阶差分压缩的压缩条件可知,在开始帧标记之后的数据为关键帧数据。在本发明实施例中,若在目标压缩数据段中没有找到压缩模式标记,则在开始帧标记的下一个位置处先加入一个关键帧标记,再进行压缩模式标记的判断。
320、若目标压缩数据段中排在最后的压缩模式标记是关键帧标记,则在目标压缩数据段的下一个位置处加入二进制形式的数据。
可以理解的是,目标压缩数据段中排在最后的关键帧标记可以是步骤319中在开始帧标记的下一个位置处加入的关键帧标记,也可以是目标压缩数据段中上一次压缩过程中加入的关键帧标记。
321、若目标压缩数据段中排在最后的压缩模式标记不是关键帧标记,则在目标压缩数据段的下一个位置处加入关键帧标记,并在关键帧标记的下一个位置处加入二进制形式的数据。
具体的,目标压缩数据段中排在最后的压缩模式标记不是关键帧标记,则说明上一次压缩为二阶差分压缩或一阶差分压缩,需在目标压缩数据段中的下一个位置处加入关键帧标记后再加入二进制形式的数据。
322、将指示光标后移一个位置。
通过本发明实施例,可以根据指示光标当前所在的位置所满足的压缩条件确定出对应的压缩方式,如一阶差分压缩和二阶差分压缩。若指示光标所在的位置满足二阶差分压缩,则进行二阶差分压缩;当指示光标所在的位置不满足二阶差分压缩对应的压缩条件时,才继续判断指示光标当前所在的位置是否满足一阶差分压缩对应的压缩条件;若指示光标所在的位置也不满足一阶差分压缩对应的压缩条件,才以关键帧数据的形式存储该指示光标指示的待处理数据。其中,二阶差分压缩的压缩率要高于一阶差分压缩的压缩率。可以看出,通过上述方式,能够实现对待处理数据集合所包括的待处理数据以较小的计算量达到较大的压缩率。
可选的,所述数据处理方法还包括数据解压缩的过程,如图6所示,数据的解压缩过程包括:
601、根据压缩参数确定待解压数据段。
其中,待解压数据段为压缩数据数组中第一帧为开始帧标记,且最后一帧为结束帧标记的任一压缩数据段。
具体的,按照时间顺序一帧一帧地读取压缩数据数组中的数据,并判断每一帧的数据是否是控制帧标记,如开始帧标记、结束帧标记。当找到一对开始帧标记和结束帧标记时,确定该开始帧标记和结束帧标记之间即为一个目标待处理数据段。可以理解的是,判断每一帧的数据是否是控制帧标记的具体实现方法可以是按位进行比对,还可以将每一帧的数据转换为十进制数值的形式,与十进制表示形式的控制帧进行数值比对。压缩数据数组中包括多个待解压数据段。
602、根据待解压数据段包括的压缩模式标记将待解压数据段划分为多个待解压子数据段。
其中,每一个待解压子数据段包括各自的压缩模式标记和待解压数据。
具体的,若待解压子数据段中的压缩模式标记为关键帧标记,则确定关键帧标记之后的数据为关键帧数据;若待解压子数据段中的压缩模式标记为一阶差分标记,则确定一阶差分标记之后的数据为一阶差分压缩后的数据;若待解压子数据段中的压缩模式标记为二阶差分标记,则确定二阶差分标记之后的数据为二阶差分压缩后的数据。可以理解的是,所述待解压子数据段中只包含一个压缩模式标记,但该压缩模式标记后包含一个或多个压缩后的数据。
603、按照各自的压缩模式标记分别对多个待解压子数据段进行解压缩。
具体的,若压缩模式标记为关键帧标记,则利用将二进制形式转换为十进制形式的方式对待解压子数据段所包括的待解压数据进行解压缩。
若压缩模式标记为一阶差分标记,则按照一阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据。具体的,以一阶帧长度为单位,将待解压子数据段中的当前帧按顺序划分为多个数据块;并根据二进制形式表示的数值将各个数据块转换为十进制形式的数据,得到的数值即为压缩过程中计算得出的一阶差分值;按照公式data[i]=data[i-1]+L1[i]依次解压数据,其中,data[i]代表第i个待解压数据,data[i-1]为上一个已经解压完成的数据,L1[i]为第i个解压数据对应的一阶差分,与当前帧转换出来的一阶差分依次对应。
若压缩模式标记为二阶差分标记,则按照二阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据。具体的,以二阶帧长度为单位,将待解压子数据段中的当前帧按顺序划分为多个数据块;并根据二进制形式表示的数值将各个数据块转换为十进制形式的数据,得到的数值即为压缩过程中计算得出的二阶差分值;按照公式data[i]=L2[i]+2*data[i-1]-data[i-2]依次解压数据,其中,data[i]代表第i个待解压数据,data[i-1]为上一个已经解压完成的数据,data[i-2]为上上一个已经解压完成的数据,L2[i]为第i个解压数据对应的二阶差分,与当前帧转换出来的一阶差分依次对应。
根据压缩参数包括的偏移量对解压缩后得到的数据进行偏移,得到待解压数据段压缩前对应的待处理数据段。
可以理解的是,若未完成待解压数据段中所有帧的解压,则继续解压下一帧数据,直到完成所有帧的解压。具体的,可以通过判断待解压数据段中结束帧之前的数据是否都已经完成解压缩,来判断是否完成待解压数据段中所有帧的解压。进一步的,若未完成待解压数据中所有数据段的解压,则继续获取下一待解压数据段,直到完成所有数据段的解压过程。具体的,可以通过判断是否能够匹配到控制帧标记,如开始帧标记和结束帧标记等来判断是否完成所有数据段的解压,或者,可以通过判断已解压的数据数量和压缩过程中记录的数据数量是否一致来判断是否完成所有数据段的解压。
604、将对压缩数据数组包括的全部压缩数据段进行解压缩得到的待处理数据段按照时间顺序重新组合,得到待处理数据集合。
为了更好地理解本发明实施例,下面对本发明实施例中的压缩和解压缩过程做一个示例性的说明。如图7所示,以对二维数据的压缩和解压缩过程为例,首先在数据的压缩过程中,将对目标待处理数据段{(x 1,y 1),(x 2,y 2),(x 3,y 3),(x 4,y 4),…(x n,y n)}中各个维度的数据进行分离,得到子集合{x 1,x 2,x 3,x 4,…,x n}和{y 1,y 2,y 3,y 4,...,y n};再根据压缩参数对两个数据段(数据段1和数据段2)进行压缩,具体的压缩过程请参见图1或图3所对应的实施例中的方法,得到压缩后的压缩数据数组。在数据的解压缩过程中,首先根据控制帧标记如开始帧标记和结束帧标记找到待解压数据段,按照上述实施例中图6所示的步骤对待解压数据段中的数据进行解压缩。解压缩得到两个维度的数据集合,即{x 1,x 2,x 3,x 4,…,x n}和{y 1,y 2,y 3,y 4,…,y n},按照时间顺序重新组合为原始待处理数据集合:{(x 1,y 1),(x 2,y 2),(x 3,y 3),(x 4,y 4),…(x n,y n)}。
请参见图8,图8是本发明实施例提供的一种数据处理装置的示意性框图,用于实现图1实施例中数据处理装置中的相应功能,如图8所示,该数据处理装置包括如下单元:
获取单元801,用于获取针对待处理数据集合的压缩参数,该压缩参数包括偏移量、最大压缩长度和控制帧标记。
偏移单元802,用于根据偏移量对待处理数据集合包括的待处理数据进行偏移。
划分单元803,用于按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。
处理单元804,用于对多个待处理数据段分别进行压缩,并利用压缩过程中采用的压 缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。
通过本发明实施例,由获取单元801获取针对待处理数据集合的压缩参数,并由偏移单元802根据偏移量对待处理数据集合包括的待处理数据进行偏移。划分单元803按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。处理单元804对多个待处理数据段分别进行压缩,并利用压缩过程中采用的压缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。可以看出,上述对待处理数据集合包括的待处理数据的压缩方式,能够以较小的计算量实现较高的压缩效率。
请参见图9,图9是本发明实施例提供的另一种数据处理装置的示意性框图,用于实现图3实施例中数据处理装置中的相应功能,如图9所示,该数据处理装置包括如下单元:
获取单元901,用于获取待处理数据集合包括的待处理数据的取值范围。
确定单元902,用于根据待处理数据集合包括的待处理数据的取值范围,确定针对待处理数据集合的偏移量、帧长度、一阶帧长度、二阶帧长度和控制帧标记。
划分单元903,用于根据偏移量对待处理数据集合包括的待处理数据进行偏移,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。
所述确定单元902,还用于针对多个数据段中的目标待处理数据段,确定指示光标在目标待处理数据段中当前所在的位置。
处理单元904,用于若指示光标当前指示的是目标待处理数据段中排在最前的待处理数据,则将压缩数据数组中所述目标待处理数据段对应的目标压缩数据段的第一个位置处加入开始帧标记。
判断单元905,用于若指示光标当前所在的位置未超过目标待处理数据段中排在最后的待处理数据所在的位置,则判断指示光标当前所在的位置是否满足二阶差分压缩对应的压缩条件。
压缩单元906,用于若指示光标所在的位置满足二阶差分压缩对应的压缩条件,则将指示光标所在的位置及后面的帧长度/二阶帧长度个数据进行二阶差分压缩。
所述判断单元905,还用于判断目标压缩数据段中排在最后的压缩模式标记是否为二阶差分标记。
所述处理单元904,还用于若目标压缩数据段中排在最后的压缩模式标记是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分压缩后的数据。
所述处理单元904,还用于若目标压缩数据段中排在最后的压缩模式标记不是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分标记,并在二阶差分标记的下一个位置处加入二阶差分压缩后的数据。
移动单元907,用于将指示光标后移帧长度/二阶帧长度个位置。
作为一种可能的实施方式,所述数据处理装置中的所述判断单元905,还用于判断指示光标当前所在的位置是否满足一阶差分压缩对应的压缩条件。
所述压缩单元906,还用于若指示光标当前所在的位置满足一阶差分压缩对应的压缩条件,则将指示光标当前所在的位置及后面的帧长度/一阶帧长度个数据进行一阶差分压缩。
所述判断单元905,还用于判断目标压缩数据段中排在最后的压缩模式标记是否为一阶差分标记。
所述处理单元904,还用于若目标压缩数据段中排在最后的压缩模式标记是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分压缩后的数据。
所述处理单元904,还用于若目标压缩数据段中排在最后的压缩模式标记不是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分标记,并在一阶差分标记的下 一个位置处加入一阶差分压缩后的数据。
所述移动单元907,还用于将指示光标后移帧长度/一阶帧长度个位置。
作为一种可能的实施方式,所述数据处理装置中的所述处理单元904,还用于若指示光标当前所在的位置不满足一阶差分压缩对应的压缩条件,将指示光标当前指示的待处理数据转化为二进制形式的数据。
所述判断单元905,还用于判断目标压缩数据段中排在最后的压缩模式标记是否为关键帧标记。
所述处理单元904,还用于若目标压缩数据段中排在最后的压缩模式标记是关键帧标记,则在目标压缩数据段的下一个位置处加入二进制形式的数据。
所述处理单元904,还用于若目标压缩数据段中排在最后的压缩模式标记不是关键帧标记,则在目标压缩数据段的下一个位置处加入关键帧标记,并在关键帧标记的下一个位置处加入二进制形式的数据。
所述移动单元907,还用于将指示光标后移一个位置。
作为一种可能的实施方式,所述数据处理装置中的所述确定单元902,还用于根据压缩参数确定待解压数据段,该待解压数据段为压缩数据数组中第一帧为开始帧标记,且最后一帧为结束帧标记的任一压缩数据段。
所述划分单元903,还用于根据待解压数据段包括的压缩模式标记将待解压数据段划分为多个待解压子数据段,其中,每一个待解压子数据段包括各自的压缩模式标记和待解压数据。
作为一种可能的实施方式,所述数据处理装置还包括:
解压缩单元908,用于按照各自的压缩模式标记分别对多个待解压子数据段进行解压缩。
作为一种可能的实施方式,所述解压缩单元908具体用于:若压缩模式标记为关键帧标记,则利用将二进制形式转换为十进制形式的方式对待解压子数据段所包括的待解压数据进行解压缩;若压缩模式标记为一阶差分标记,则按照一阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据;若压缩模式标记为二阶差分标记,则按照二阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据。
作为一种可能的实施方式,所述数据处理装置还包括:
偏移单元909,用于根据压缩参数包括的偏移量对解压缩后得到的数据进行偏移,得到待解压数据段压缩前对应的待处理数据段。
所述处理单元904,还用于将对压缩数据数组包括的全部压缩数据段进行解压缩得到的待处理数据段按照时间顺序重新组合,得到待处理数据集合。
通过本发明提供的实施例,由获取单元901获取待处理数据集合包括的待处理数据的取值范围,并利用确定单元902根据待处理数据集合包括的待处理数据的取值范围,确定针对待处理数据集合的压缩参数。由划分单元903根据偏移量对待处理数据集合包括的待处理数据进行偏移,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段。根据指示光标当前所在的位置由所述确定单元902确定出压缩方式,具体包括二阶差分压缩、一阶差分压缩;按照确定出的压缩方式对待处理数据进行压缩,并将压缩后的数据按顺序加入压缩数据数组。可以看出,所述实现方式能够实现以较小的计算量达到对待处理数据较高的压缩效率。
请参见图10,图10是本发明实施例提供的又一种数据处理装置的示意性框图,该装置可以包括:一个或多个处理器1001、一个或多个通信接口1002和存储器1003,所述处理器1001、通信接口1002和存储器1003通过总线1004相互连接,其中,所述存储器1003 用于存储计算机程序,所述计算机程序包括程序指令,所述处理器1001被配置用于调用所述程序指令。在本发明实施例中,由处理器1001加载并执行计算机存储介质中存放的一条或一条以上指令,以实现图1或图3所示方法流程的相应步骤;具体实现中,计算机存储介质中的一条或一条以上指令由处理器1001加载并执行如下步骤:
获取针对待处理数据集合的压缩参数,该压缩参数包括偏移量、最大压缩长度和控制帧标记。
根据偏移量对待处理数据集合包括的待处理数据进行偏移,并按照最大压缩长度将偏移后的待处理数据划分为多个待处理数据段;
对多个待处理数据段分别进行压缩,并利用压缩过程中采用的压缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。
作为一种可能的实施方式,处理器1001获取针对待处理数据集合的压缩参数的具体实现方式可以为:获取待处理数据集合包括的待处理数据的取值范围;根据待处理数据集合包括的待处理数据的取值范围,确定针对待处理数据集合的偏移量、帧长度、一阶帧长度、二阶帧长度和控制帧标记,该控制帧标记包括开始帧标记、压缩模式标记和结束帧标记。
作为一种可能的实施方式,处理器1001对多个待处理数据段分别进行压缩的具体实现方式可以为:针对多个待处理数据段中的目标待处理数据段,确定指示光标在目标待处理数据段中当前所在的位置,该指示光标用于指示下一个待处理数据,其中,目标待处理数据段为多个待处理数据段中的任一个数据段;若指示光标当前所在的位置未超过目标待处理数据段中排在最后的待处理数据所在的位置,则根据指示光标当前所在位置满足的压缩条件确定压缩方式;按照确定出的压缩方式对目标待处理数据段进行压缩。
作为一种可能的实施方式,所述处理器1001,还用于:若指示光标当前指示的是目标待处理数据段中排在最前的待处理数据,则在压缩数据数组中目标待处理数据段对应的目标压缩数据段的第一个位置处加入开始帧标记。
作为一种可能的实施方式,压缩模式标记还包括二阶差分标记,压缩方式包括二阶差分压缩,处理器1001按照确定出的压缩方式对目标待处理数据段进行压缩的具体实现方式可以为:判断指示光标当前所在的位置是否满足二阶差分压缩对应的压缩条件;若满足,则将指示光标当前所在的位置及后面的帧长度/二阶帧长度个数据进行二阶差分压缩;判断目标压缩数据段中排在最后的压缩模式标记是否为二阶差分标记;若是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分压缩后的数据;若不是二阶差分标记,则在目标压缩数据段的下一个位置处加入二阶差分标记,并在二阶差分标记的下一个位置处加入二阶差分压缩后的数据;将指示光标后移帧长度/二阶帧长度个位置。
作为一种可能的实施方式,压缩模式标记还包括一阶差分标记,压缩方式还包括一阶差分压缩,若指示光标当前所在的位置不满足二阶差分压缩对应的压缩条件,所述处理器1001还用于:判断指示光标当前所在的位置是否满足一阶差分压缩对应的压缩条件;若满足,则将指示光标所在的位置及后面的帧长度/一阶帧长度个数据进行一阶差分压缩;判断目标压缩数据段中排在最后的压缩模式标记是否为一阶差分标记;若是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分压缩后的数据;若不是一阶差分标记,则在目标压缩数据段的下一个位置处加入一阶差分标记,并在一阶差分标记的下一个位置处加入一阶差分压缩后的数据;将指示光标后移帧长度/一阶帧长度个位置。
作为一种可能的实施方式,若指示光标当前所在的位置不满足一阶差分压缩对应的压缩条件,所述处理器1001还用于:将指示光标当前指示的待处理数据转化为二进制形式的数据;判断目标压缩数据段中排在最后的压缩模式标记是否为关键帧标记;若是关键帧标记,则在目标压缩数据段的下一个位置处加入二进制形式的数据;若不是关键帧标记,则在目标压缩数据段的下一个位置处加入关键帧标记,并在关键帧标记的下一个位置处加入 二进制形式的数据;将指示光标后移一个位置。
作为一种可能的实施方式,压缩条件包括数据长度条件、压缩可行性条件和冲突避免条件;二阶差分压缩的数据长度条件为:指示光标所在的位置前面至少有两个压缩过的数据,且指示光标所在的位置及后面至少有帧长度/二阶帧长度个数据;二阶差分压缩的压缩可行性条件为:指示光标所在的位置及后面的帧长度/二阶帧长度个数据的二阶差分值都小于二阶帧最大值,二阶帧最大值为二阶帧长度的二进制数表示的最大值;二阶差分压缩的冲突避免条件为:二阶差分压缩后得到的数据与控制帧标记不相同;一阶差分压缩的数据长度条件为:指示光标所在的位置前面至少有一个压缩过的数据,且指示光标所在的位置及后面至少有帧长度/一阶帧长度个数据;一阶差分压缩的压缩可行性条件为:指示光标所在的位置及后面的帧长度/一阶帧长度个数据的一阶差分值都小于一阶帧最大值,一阶帧最大值为一阶帧长度的二进制数表示的最大值;一阶差分压缩的冲突避免条件为:一阶差分压缩后得到的数据与控制帧标记不相同。
作为一种可能的实施方式,所述处理器1001,还用于:根据压缩参数确定待解压数据段,待解压数据段为压缩数据数组中第一帧为开始帧标记,且最后一帧为结束帧标记的任一压缩数据段;根据待解压数据段包括的压缩模式标记将待解压数据段划分为多个待解压子数据段,每一个待解压子数据段包括各自的压缩模式标记和待解压数据;按照各自的压缩模式标记分别对多个待解压子数据段进行解压缩。
作为一种可能的实施方式,处理器1001按照各自的压缩模式标记分别对多个待解压子数据段进行解压缩的具体实施方式可以为:若压缩模式标记为关键帧标记,则利用将二进制形式转换为十进制形式的方式对待解压子数据段所包括的待解压数据进行解压缩;若压缩模式标记为一阶差分标记,则按照一阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据;若压缩模式标记为二阶差分标记,则按照二阶差分压缩对应的解压缩方式解压缩待解压子数据段所包括的待解压数据;根据压缩参数包括的偏移量对解压缩后得到的数据进行偏移,得到待解压数据段压缩前对应的待处理数据段。
作为一种可能的实施方式,所述处理器1001,还用于:将对压缩数据数组包括的全部压缩数据段进行解压缩得到的待处理数据段按照时间顺序重新组合,得到待处理数据集合。
在本发明的另一实施例中提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时实现本发明实施例提供的图1或图3所描述的数据处理方法的实现方式。
所述计算机可读存储介质可以是前述任一实施例所述的数据处理平台中的内部存储单元,或者服务器的硬盘或内存。所述计算机可读存储介质也可以是所述服务器的外部存储设备,例如所述服务器上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。

Claims (15)

  1. 一种数据处理方法,其特征在于,所述方法包括:
    获取针对待处理数据集合的压缩参数,所述压缩参数包括偏移量、最大压缩长度和控制帧标记;
    根据所述偏移量对所述待处理数据集合包括的待处理数据进行偏移,并按照所述最大压缩长度将偏移后的待处理数据划分为多个待处理数据段;
    对所述多个待处理数据段分别进行压缩,并利用压缩过程中采用的压缩方式对应的控制帧标记,将压缩后得到的数据按照时间顺序分别加入压缩数据数组。
  2. 如权利要求1所述的方法,其特征在于,所述压缩参数还包括帧长度、一阶帧长度和二阶帧长度,所述获取针对待处理数据集合的压缩参数包括:
    获取待处理数据集合包括的待处理数据的取值范围;
    根据所述待处理数据集合包括的待处理数据的取值范围,确定针对所述待处理数据集合的所述偏移量、所述帧长度、所述一阶帧长度、所述二阶帧长度和所述控制帧标记,所述控制帧标记包括开始帧标记、压缩模式标记和结束帧标记。
  3. 如权利要求2所述的方法,其特征在于,所述开始帧标记用于标记所述压缩数据数组中一个压缩数据段的开始,所述开始帧标记位于所述压缩数据段的第一个位置;
    所述结束帧标记用于标记所述压缩数据数组中一个压缩数据段的结束,所述结束帧标记位于所述压缩数据段的最后一个位置。
  4. 如权利要求2或3所述的方法,其特征在于,所述对所述多个待处理数据段分别进行压缩包括:
    针对所述多个待处理数据段中的目标待处理数据段,确定指示光标在所述目标待处理数据段中当前所在的位置,所述指示光标用于指示下一个待处理数据,所述目标待处理数据段为所述多个待处理数据段中的任一个数据段;
    若所述指示光标当前所在的位置未超过所述目标待处理数据段中排在最后的待处理数据所在的位置,则根据所述指示光标当前所在位置满足的压缩条件确定压缩方式;
    按照确定出的所述压缩方式对所述目标待处理数据段进行压缩。
  5. 如权利要求4所述的方法,其特征在于,所述方法还包括:
    若所述指示光标当前指示的是所述目标待处理数据段中排在最前的待处理数据,则在所述压缩数据数组中所述目标待处理数据段对应的目标压缩数据段的第一个位置处加入所述开始帧标记。
  6. 如权利要求4或5任一项所述的方法,其特征在于,所述压缩模式标记包括二阶差分标记,所述压缩方式包括二阶差分压缩,所述按照确定出的所述压缩方式对所述目标待处理数据段进行压缩包括:
    判断所述指示光标当前所在的位置是否满足所述二阶差分压缩对应的压缩条件;
    若满足,则将所述指示光标当前所在的位置及后面的所述帧长度/所述二阶帧长度个数据进行二阶差分压缩;
    判断所述目标压缩数据段中排在最后的压缩模式标记是否为所述二阶差分标记;
    若是所述二阶差分标记,则在所述目标压缩数据段的下一个位置处加入所述二阶差分压缩后的数据;
    若不是所述二阶差分标记,则在所述目标压缩数据段的下一个位置处加入所述二阶差分标记,并在所述二阶差分标记的下一个位置处加入所述二阶差分压缩后的数据;
    将所述指示光标后移所述帧长度/所述二阶帧长度个位置。
  7. 如权利要求6所述的方法,其特征在于,所述压缩模式标记还包括一阶差分标记,所述压缩方式还包括一阶差分压缩,若所述指示光标当前所在的位置不满足所述二阶差分压缩对应的压缩条件,所述方法还包括:
    判断所述指示光标当前所在的位置是否满足所述一阶差分压缩对应的压缩条件;
    若满足,则将所述指示光标当前所在的位置及后面的所述帧长度/所述一阶帧长度个数据进行一阶差分压缩;
    判断所述目标压缩数据段中排在最后的压缩模式标记是否为所述一阶差分标记;
    若是所述一阶差分标记,则在所述目标压缩数据段的下一个位置处加入所述一阶差分压缩后的数据;
    若不是所述一阶差分标记,则在所述目标压缩数据段的下一个位置处加入所述一阶差分标记,并在所述一阶差分标记的下一个位置处加入所述一阶差分压缩后的数据;
    将所述指示光标后移所述帧长度/所述一阶帧长度个位置。
  8. 如权利要求7所述的方法,其特征在于,所述压缩模式标记还包括关键帧标记,若所述指示光标当前所在的位置不满足所述一阶差分压缩对应的压缩条件,所述方法还包括:
    将所述指示光标当前指示的待处理数据转化为二进制形式的数据;
    判断所述目标压缩数据段中排在最后的压缩模式标记是否为所述关键帧标记;
    若是所述关键帧标记,则在所述目标压缩数据段的下一个位置处加入所述二进制形式的数据;
    若不是所述关键帧标记,则在所述目标压缩数据段的下一个位置处加入所述关键帧标记,并在所述关键帧标记的下一个位置处加入所述二进制形式的数据;
    将所述指示光标后移一个位置。
  9. 如权利要求4-8所述的方法,其特征在于,所述压缩条件包括数据长度条件、压缩可行性条件和冲突避免条件;
    所述二阶差分压缩的数据长度条件为:所述指示光标当前所在的位置前面至少有两个压缩过的数据,且所述指示光标当前所在的位置及后面至少有所述帧长度/所述二阶帧长度个数据;所述二阶差分压缩的压缩可行性条件为:所述指示光标当前所在的位置及后面的所述帧长度/所述二阶帧长度个数据的二阶差分值都小于二阶帧最大值,所述二阶帧最大值为所述二阶帧长度的二进制数表示的最大值;所述二阶差分压缩的冲突避免条件为:所述二阶差分压缩后得到的数据与所述控制帧标记不相同;
    所述一阶差分压缩的数据长度条件为:所述指示光标当前所在的位置前面至少有一个压缩过的数据,且所述指示光标当前所在的位置及后面至少有所述帧长度/所述一阶帧长度个数据;所述一阶差分压缩的压缩可行性条件为:所述指示光标当前所在的位置及后面的所述帧长度/所述一阶帧长度个数据的一阶差分值都小于一阶帧最大值,所述一阶帧最大值为所述一阶帧长度的二进制数表示的最大值;所述一阶差分压缩的冲突避免条件为:所述一阶差分压缩后得到的数据与所述控制帧标记不相同。
  10. 如权利要求1所述的方法,其特征在于,所述控制帧标记包括开始帧标记、压缩模式标记和结束帧标记,所述压缩数据数组包括至少一个压缩数据段,所述方法还包括:
    根据所述压缩参数确定待解压数据段,所述待解压数据段为所述压缩数据数组中第一 帧为开始帧标记,且最后一帧为结束帧标记的任一压缩数据段;
    根据所述待解压数据段包括的压缩模式标记将所述待解压数据段划分为多个待解压子数据段,每一个所述待解压子数据段包括各自的压缩模式标记和待解压数据;
    按照所述各自的压缩模式标记分别对所述多个待解压子数据段进行解压缩。
  11. 如权利要求10所述的方法,其特征在于,所述压缩模式标记包括关键帧标记、一阶差分标记和二阶差分标记,所述按照所述各自的压缩模式标记分别对所述多个待解压子数据段进行解压缩包括:
    若所述压缩模式标记为所述关键帧标记,则利用将二进制形式转换为十进制形式的方式对所述待解压子数据段所包括的待解压数据进行解压缩;
    若所述压缩模式标记为所述一阶差分标记,则按照所述一阶差分压缩对应的解压缩方式解压缩所述待解压子数据段所包括的待解压数据;
    若所述压缩模式标记为所述二阶差分标记,则按照所述二阶差分压缩对应的解压缩方式解压缩所述待解压子数据段所包括的待解压数据;
    根据所述压缩参数包括的所述偏移量对解压缩后得到的数据进行偏移,得到所述待解压数据段压缩前对应的待处理数据段。
  12. 如权利要求11所述的方法,其特征在于,所述方法还包括:
    将对所述压缩数据数组包括的全部压缩数据段进行解压缩得到的待处理数据段按照所述时间顺序重新组合,得到所述待处理数据集合。
  13. 一种数据处理装置,其特征在于,包括用于执行权利要求1-12任一项所述方法的单元。
  14. 一种数据处理装置,其特征在于,包括处理器、输入设备、输出设备和存储器,所述处理器、输入设备、输出设备和存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行如权利要求1-12任一项所述的方法。
  15. 一种计算机可读存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1-12任一项所述的方法。
PCT/CN2018/081757 2018-04-03 2018-04-03 一种数据处理方法及装置 WO2019191904A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880086748.4A CN111602111A (zh) 2018-04-03 2018-04-03 一种数据处理方法及装置
PCT/CN2018/081757 WO2019191904A1 (zh) 2018-04-03 2018-04-03 一种数据处理方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/081757 WO2019191904A1 (zh) 2018-04-03 2018-04-03 一种数据处理方法及装置

Publications (1)

Publication Number Publication Date
WO2019191904A1 true WO2019191904A1 (zh) 2019-10-10

Family

ID=68099742

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/081757 WO2019191904A1 (zh) 2018-04-03 2018-04-03 一种数据处理方法及装置

Country Status (2)

Country Link
CN (1) CN111602111A (zh)
WO (1) WO2019191904A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120063517A1 (en) * 2010-09-14 2012-03-15 Samsung Electronics Co., Ltd. Method and apparatus for hierarchical picture encoding and decoding
CN103309621A (zh) * 2012-12-12 2013-09-18 珠海金山网络游戏科技有限公司 读取分段压缩包中数据的方法
CN105009584A (zh) * 2013-04-02 2015-10-28 明达半导体股份有限公司 视频处理方法及视频处理装置
US20160345260A1 (en) * 2005-05-30 2016-11-24 Invent.ly LLC Self Powered Device and Methods Conserving Energy in Communication
CN107295036A (zh) * 2016-03-31 2017-10-24 华为技术有限公司 一种数据发送方法及数据合并设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1129232C (zh) * 2001-03-22 2003-11-26 谭伟祥 一种对数据库中的数据进行压缩与解压缩的方法
CN101355364A (zh) * 2008-09-08 2009-01-28 北大方正集团有限公司 文件压缩方法及装置、文件解压缩方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160345260A1 (en) * 2005-05-30 2016-11-24 Invent.ly LLC Self Powered Device and Methods Conserving Energy in Communication
US20120063517A1 (en) * 2010-09-14 2012-03-15 Samsung Electronics Co., Ltd. Method and apparatus for hierarchical picture encoding and decoding
CN103309621A (zh) * 2012-12-12 2013-09-18 珠海金山网络游戏科技有限公司 读取分段压缩包中数据的方法
CN105009584A (zh) * 2013-04-02 2015-10-28 明达半导体股份有限公司 视频处理方法及视频处理装置
CN107295036A (zh) * 2016-03-31 2017-10-24 华为技术有限公司 一种数据发送方法及数据合并设备

Also Published As

Publication number Publication date
CN111602111A (zh) 2020-08-28

Similar Documents

Publication Publication Date Title
CN106549673B (zh) 一种数据压缩方法及装置
CN108733317B (zh) 数据存储方法和装置
CN116506073B (zh) 一种工业计算机平台数据快速传输方法及系统
CN108628898B (zh) 数据入库的方法、装置和设备
CN101751440A (zh) 一种数据压缩/解压缩方法及其装置
CN115208414B (zh) 数据压缩方法、数据压缩装置、计算机设备及存储介质
WO2021051532A1 (zh) 数据压缩方法、装置、设备及计算机可读存储介质
KR20200094364A (ko) 이미지 파일의 블록 간 차이를 통한 압축율 향상 방법 및 시스템
CN113630125A (zh) 数据压缩、编码解压缩方法、装置、电子设备及存储介质
CN102197599A (zh) 用于将数据记录压缩和解压缩的方法和设备
CN111061722B (zh) 一种数据压缩、数据解压缩方法、装置及设备
US11581903B2 (en) Data compression method and apparatus, computer-readable storage medium, and electronic device
CN105320669A (zh) 数据存储、读取方法及数据存储、读取装置
US10515092B2 (en) Structured record compression and retrieval
CN108880559B (zh) 数据压缩方法、数据解压缩方法、压缩设备及解压缩设备
WO2020258942A1 (zh) 一种数据压缩方法及装置
CN112332854A (zh) 霍夫曼编码的硬件实现方法、装置及存储介质
WO2019191904A1 (zh) 一种数据处理方法及装置
CN115630614A (zh) 数据传输方法、装置、电子设备与介质
CN115765754A (zh) 一种数据编码方法及一种编码数据比较方法
CN113141508B (zh) 算术编码器及实现算术编码的方法和图像编码方法
CN112612427B (zh) 一种车辆停靠点数据处理方法、装置、存储介质及终端
CN110545107B (zh) 数据处理方法、装置、电子设备及计算机可读存储介质
CN116431585A (zh) 文件的压缩方法及其装置、文件的解压方法及其装置
CN111259177B (zh) 一种黑白二值签名图片存储方法和系统

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: 18913499

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: 18913499

Country of ref document: EP

Kind code of ref document: A1