WO2020207410A1 - 一种数据压缩方法、电子设备及存储介质 - Google Patents

一种数据压缩方法、电子设备及存储介质 Download PDF

Info

Publication number
WO2020207410A1
WO2020207410A1 PCT/CN2020/083767 CN2020083767W WO2020207410A1 WO 2020207410 A1 WO2020207410 A1 WO 2020207410A1 CN 2020083767 W CN2020083767 W CN 2020083767W WO 2020207410 A1 WO2020207410 A1 WO 2020207410A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
boolean
compressed
compression
type
Prior art date
Application number
PCT/CN2020/083767
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 深圳市道通智能航空技术有限公司
Publication of WO2020207410A1 publication Critical patent/WO2020207410A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction

Definitions

  • This application relates to the field of data processing, and in particular to a data compression method, electronic equipment and storage medium.
  • each data variable occupies one port, which requires at least hundreds. Thousands of ports are used to transmit and store data, which will cause serious waste of port resources. Moreover, the sampling frequency of data is very high, and a large amount of data output can easily cause a shortage of storage units.
  • the more comprehensive the data record storage the more comprehensive the information for analyzing flight failures, the faster the location of problems, and the higher the research and development efficiency. Therefore, for the aircraft, the less data variables to be transferred and stored, the better; for developers, the more data variables stored, the better, which is a contradiction.
  • Each data variable occupies a data port, which is a serious waste of resources; in order to transmit and store important data as much as possible, the number of ports needs to be increased, which seriously affects the calculation rate of the aircraft , And a large number of ports are not easy to manage and will take up a lot of storage space.
  • most of the data compression is achieved by encoding technology, which is complicated in operation and slow in decoding speed.
  • the purpose of the present invention is to provide a data compression method, electronic equipment and storage medium to solve the problems of complex operations and low computational efficiency in existing data processing.
  • the present invention provides a data compression method, including:
  • Identifying data types of the several data the data types including Boolean type and non-Boolean type;
  • the non-Boolean data whose data type is the non-Boolean type is formed into second compressed data according to a second data compression rule, wherein the second data compression rule is different from the first data compression rule.
  • forming the first compressed data of the Boolean data whose data type is the Boolean type according to the first data compression rule includes:
  • the grouped groups of Boolean data are respectively operated according to the first formula to obtain a plurality of the first compressed data corresponding to the groups of Boolean data one-to-one.
  • v 1 , v 2 ..., v N represents N Boolean data in a group of Boolean data
  • v bool represents the first compressed data
  • Boolean data includes aircraft flag data during the flight of the aircraft.
  • forming the second compressed data of the non-Boolean data whose data type is the non-Boolean type according to the second data compression rule includes:
  • each grouping includes two non-Boolean data;
  • the grouped non-Boolean data are respectively operated according to the second formula to obtain a plurality of the second compressed data corresponding to each group of non-Boolean data one-to-one.
  • non-Boolean data in the data set includes a candidate data set and a grouped data set
  • grouping the non-Boolean data includes:
  • the two non-Boolean data meet the preset compression condition, the two non-Boolean data are taken as a group and added to the grouped data set.
  • the method further includes:
  • the two non-Boolean data do not meet the preset compression condition, the two non-Boolean data are re-inserted into the candidate data set.
  • forming the second compressed data of the non-Boolean data whose data type is the non-Boolean type according to the second data compression rule includes:
  • each grouping includes two non-Boolean data;
  • each group includes two pending compressed data
  • the grouped undetermined compressed data are respectively operated according to the second formula to obtain a plurality of the second compressed data corresponding to each group of undetermined compressed data one-to-one.
  • v 1_2 (int) K 1 v 1 + (int) 2K 2 K 1 M 1 v 2 ,
  • v 1 , v 2 are two non-Boolean data in a set of non-Boolean data, v 1_2 is the second compressed data,
  • e 1 and e 2 are the truncation errors of v 1 and v 2 respectively.
  • the preset compression condition is:
  • M 1 and M 2 are the ranges of variables corresponding to two non-Boolean data in a set of non-Boolean data, and N is the number of bits of the variable.
  • non-Boolean data includes aircraft state variables and sensor data during the flight of the aircraft.
  • the method further includes:
  • the first compressed data and the second compressed data are stored.
  • the present invention also provides an electronic device including a processor and a memory, and a computer-readable program is stored in the memory, the computer-readable program is configured to be executed by the processor, and the computer-readable program is executed by the processor When implementing the above method.
  • the present invention also relates to a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to realize the above-mentioned method.
  • the present invention has the beneficial effect of classifying the acquired data set according to Boolean type and non-Boolean type, for Boolean type, according to the first compression rule, for non-Boolean data, according to the second compression rule Compression, thereby simplifying the calculation process and improving calculation efficiency.
  • FIG. 1 is a flowchart of a data compression method provided by an embodiment of the present invention
  • FIG. 2 is a flowchart of forming first compressed data from Boolean data whose data type is a Boolean type according to a first data compression rule according to an embodiment of the present invention
  • FIG. 3 is a flowchart of forming second compressed data according to a second data compression rule for non-Boolean data whose data type is a non-Boolean type according to an embodiment of the present invention
  • FIG. 5 is a flowchart of forming second compressed data with non-Boolean data whose data type is a non-Boolean type according to a second data compression rule according to an embodiment of the present invention
  • Fig. 6 is a schematic diagram of an electronic device provided by an embodiment of the present invention.
  • the data compression method provided by the present invention is applied to unmanned aerial vehicles and is used to compress data collected during the flight of the unmanned aerial vehicles.
  • the data compression method provided by the embodiment of the present invention includes:
  • Step S101 Obtain a data set, the data set including several data.
  • the data set is a collection of data generated during the flight of the drone, for example, including the state variables of the aircraft, various flags of the aircraft, and sensor data.
  • the state variables of the aircraft include the position, speed, acceleration, etc. of the aircraft
  • the flags of the aircraft include the stationary state and the motion state
  • the sensor data include the data of the acceleration sensor.
  • Step S102 Identify the data types of the several data, the data types including Boolean type and non-Boolean type.
  • Boolean type is a logical variable.
  • the flag bit of the aircraft includes the static state and the motion state
  • the flag bit of the aircraft is Boolean data
  • the state variable of the aircraft And sensor data is non-Boolean data.
  • Each data is associated with an identity.
  • the identity represents the variable corresponding to the data. According to the identity, it is recognized whether the data is of Boolean type.
  • Step S103 The Boolean data whose data type is the Boolean type is formed into first compressed data according to the first data compression rule.
  • the first data compression rule may be a calculation formula, and multiple Boolean data are superimposed and calculated according to the calculation formula to obtain one data, so as to realize the compression of the Boolean data of the Boolean type.
  • Step S104 The non-Boolean data whose data type is the non-Boolean type is formed into second compressed data according to a second data compression rule, wherein the second data compression rule is different from the first data compression rule.
  • the second compression rule may be a calculation formula, which superimposes a larger amount of non-Boolean data according to the calculation formula to obtain a smaller amount of data, so as to realize the compression of the non-Boolean data.
  • Boolean data and non-Boolean data are respectively compressed, simplifying the operation process and improving the operation efficiency.
  • step S103 includes:
  • Step S201 Group the Boolean data.
  • the 100 data are divided into 10 groups of data, and each group includes 10 data. It should be noted that the number of Boolean data in each group can be the same or different.
  • Step S202 The grouped groups of Boolean data are respectively operated according to a first formula to obtain a plurality of the first compressed data corresponding to each group of Boolean data one-to-one.
  • the first formula is:
  • v 1 , v 2 ..., v N represents N Boolean data in a group of Boolean data
  • v bool represents the first compressed data
  • each group has 5 data
  • the obtained superimposed data is converted into binary and rounded to obtain the first compressed data, thereby compressing N data into one data.
  • the first compressed data is stored or sent to a terminal device, for example, sent to a mobile phone, and the mobile phone decompresses according to a decompression formula.
  • the decompression formula is:
  • v i bitand(2 i-1 , v bool .
  • v bool is 10100, which corresponds to the first compressed data of 5 original data. After converting 1, 2, 4, 8, and 16 to binary, the bitwise AND operation is performed with 10100 to obtain 5 original data.
  • step S104 includes:
  • Step S301 Group the non-Boolean data, and each group includes two non-Boolean data.
  • step S301 includes:
  • Step S401 Select two non-Boolean data from the candidate data set according to the first preset rule.
  • the non-Boolean data in the data set includes a candidate data set and a grouped data set.
  • the grouped data set is data that has been grouped, and the candidate data set is data to be selected for grouping.
  • the first preset rule may be the time sequence of acquiring the data, or the data type, or randomly selected.
  • two non-Boolean data are selected in sequence according to the time sequence of acquiring the data, or one sensor data and one aircraft speed data are arbitrarily selected from the acquired data.
  • the acquired non-Boolean data includes velocity data, direction data, and acceleration data. According to the five velocity data, Three acceleration data and two direction data are the rule of one group. The obtained data is divided into multiple groups, and then two non-Boolean data are selected from each group.
  • Step S402 Determine whether the two non-Boolean data meet a preset compression condition.
  • the preset compression conditions are:
  • M 1 and M 2 are respectively the range of the variable corresponding to the two non-Boolean data in a set of non-Boolean data, and N is the number of digits of the variable.
  • the two data are both speed.
  • the maximum speed is 10m/s, then the values of M 1 and M 2 are both 10.
  • the Boolean data and non-Boolean data during the flight of the aircraft are data in binary form, and N is the value of one of the two non-Boolean data. Digits.
  • e 1 and e 2 are the truncation errors of two non-Boolean data respectively.
  • the truncation error is the difference between the approximate value and the exact value of the data. For example, for data with a large number of decimal places, if the approximate value is stored during the data storage process, there will be a truncation error.
  • Step S403 If the two non-Boolean data meet the preset compression condition, the two non-Boolean data are taken as a group and added to the grouped data set.
  • Step S404 If the two non-Boolean data do not meet the preset compression condition, put the two non-Boolean data into the candidate data set again.
  • the two data are compressed into one data; if the two non-Boolean data do not meet the compression condition, the two data are put into the candidate data set to determine whether Whether other data satisfies the compression condition, if it does not meet the compression condition with other data, enter the original data.
  • the two non-Boolean data are directly output.
  • Step S302 Operate the grouped non-Boolean data respectively according to the second formula to obtain a plurality of the second compressed data corresponding to each group of non-Boolean data.
  • the second formula is:
  • v 1_2 (int) K 1 v 1 + (int) 2K 2 K 1 M 1 v 2 ,
  • v 1 and v 2 are two non-Boolean data in a group of non-Boolean data, and v 1_2 is the second compressed data,
  • e 1 and e 2 are the truncation errors of v 1 and v 2 respectively.
  • two non-Boolean data are calculated by the second formula to obtain one data, thereby compressing the two data into one second compressed data.
  • Two non-Boolean data can save 1 port and save 50% of storage space. .
  • the second compressed data is stored or sent to a terminal device, for example, sent to a mobile phone, and the mobile phone decompresses according to a decompression formula.
  • the decompression formula is:
  • two original non-Boolean data can be calculated from one second compressed data.
  • step S104 includes:
  • Step S501 Group the non-Boolean data, and each group includes two non-Boolean data.
  • Step S502 Operate the grouped non-Boolean data respectively according to the second formula to obtain a plurality of undetermined compressed data corresponding to each group of non-Boolean data.
  • non-Boolean data that meets a preset compression condition are taken as one group, and compressed to obtain one undetermined compressed data, and multiple groups are compressed to obtain multiple undetermined compressed data.
  • non-Boolean data that does not meet the preset compression conditions can also be used as pending compressed data.
  • Step S503 Group the multiple pending compressed data into groups, and each group includes two pending compressed data.
  • Step S504 Operate the grouped pending compressed data respectively according to the second formula to obtain a plurality of said second compressed data corresponding to each group of pending compressed data one-to-one.
  • multiple undetermined compressed data are grouped again according to preset compression conditions, and two non-Boolean data that meet the preset compression conditions are grouped together, and a second compressed data is obtained after compression, which does not meet the preset compression Conditional non-Boolean data directly outputs pending compressed data. Compress the compressed pending compressed data again to further save storage space.
  • the two non-Boolean data that meet the preset compression condition are grouped as one group, and after one compression, the compressed data that satisfies the preset compression adjustment is further grouped and compressed.
  • the compressed data Further select two data that meet the preset compression conditions and perform compression again, thereby performing multiple compressions.
  • two non-Boolean data satisfying the preset compression condition may be reselected for compression from the compressed data and the data that does not satisfy the preset compression condition.
  • the original data is obtained by decompressing multiple times according to the compression times.
  • the electronic device provided by the embodiment of the present invention includes a processor 11 and a memory 2.
  • a computer readable program is stored in the memory 12, and the computer readable program is configured to be executed by the processor 11.
  • the above-mentioned method is implemented.
  • the electronic device in this embodiment and the method in the foregoing embodiment are based on two aspects under the same inventive concept.
  • the method implementation process has been described in detail above, so those skilled in the art can clearly understand from the foregoing description For the sake of brevity of the description, the implementation process of the electronic device in this embodiment will not be repeated here.
  • the present invention also relates to a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., on which a computer program is stored, and the computer program is executed by a processor to realize the above method.
  • a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc.
  • the data compression method, electronic equipment and storage medium provided by the present invention classify the acquired data set according to Boolean type and non-Boolean type.
  • Boolean type compress according to the first compression rule, and for non-Boolean data, according to the second compression rule Compression is performed to simplify the calculation process, improve calculation efficiency, and save storage space.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

一种数据压缩方法、电子设备及存储介质,方法包括:获取数据集,数据集包括若干数据(S101);识别若干数据的数据类型,数据类型包括布尔类型和非布尔类型(S102);将数据类型为布尔类型的布尔数据按照第一数据压缩规则形成第一压缩数据(S103);将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据(S104),其中,第二数据压缩规则与第一数据压缩规则不同,从而简化运算过程,提高运算效率。

Description

一种数据压缩方法、电子设备及存储介质
本申请要求于2019年04月09日提交中国专利局、申请号为201910281884.5、申请名称为“一种数据压缩方法、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理领域,尤其涉及一种数据压缩方法、电子设备及存储介质。
背景技术
无人机飞行过程中,所产生的数据类型多、数据量庞大、更新速率快,而飞机运算单元的输出端口有限,按照常规的方法,每一个数据变量均占用一个端口,至少需要成百上千个端口来传输和存储数据,这就会造成端口资源严重地浪费。并且,数据的采样频率很高,大量的数据输出很容易造成存储单元的匮乏。而对于开发人员而言,数据记录存储越全面,分析飞行故障的信息就越全面,定位问题就越快,研发效率就越高。因此,对于飞机而言,传输存储的数据变量越少越好;对于开发人员而言,则存储的数据变量越多越好,这是一个矛盾。
现有的数据处理方法包括两种:一是优先传输和存储特别重要的数据,将数据按照重要程度依次排序进行存储,直至端口资源被全部占用,未能“排上队”的数据变量,则将其舍弃;二是将数据进行整理,通过压缩算法来对数据进行压缩,争取用少量的端口传输更多的数据以进行存储,在后续分析时,采用相应的解压缩算法来进行数据解包处理,还原真实数据。对于方法一,能够传输存储的数据变量十分有限,每一个数据变量占用一个数据端口,严重浪费资源;为了尽可能多的传输存储重要数据,需要将端口数增多,这严重影响了飞机的计算速率,且大量的端口不易于管理,还会占用大量的存储空间。对于方法二,大多数是通过编码技术来实现数据的压缩,运算比较复杂,解码速度较慢。
发明内容
为了克服现有技术中数据运算复杂,计算效率低的问题,本发明的目的在于提供一种数据压缩方法、电子设备及存储介质,以解决现有数据处理中运算复杂,计算效率低的问题。
本发明提供一种数据压缩方法,包括:
获取数据集,所述数据集包括若干数据;
识别所述若干数据的数据类型,所述数据类型包括布尔类型和非布尔类型;
将数据类型为布尔类型的布尔数据按照第一数据压缩规则形成第一压缩数据;
将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据,其中,所述第二数据压缩规则与所述第一数据压缩规则不同。
进一步地,将数据类型为布尔类型的布尔数据按照第一数据压缩规则形成第一压缩数据包括:
将所述布尔数据分组;
将分组后的各组布尔数据分别按照第一公式进行运算得到与所述各组布尔数据一一对应的多个所述第一压缩数据。
进一步地,所述第一公式为:
Figure PCTCN2020083767-appb-000001
其中,v 1,v 2…,v N表示一组布尔数据中的N个布尔数据,v bool表示第一压缩数据。
进一步地,所述布尔数据包括飞机飞行过程中的飞机标志位数据。
进一步地,将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据包括:
将所述非布尔数据分组,每个分组包括两个非布尔数据;
将分组后的非布尔数据分别按照第二公式进行运算得到与各组非布尔数据一一对应的多个所述第二压缩数据。
进一步地,所述数据集中的非布尔数据包括候选数据集和已分组数据集,将所述非布尔数据分组包括:
按照第一预设规则从所述候选数据集中选取两个非布尔数据;
判断所述两个非布尔数据是否满足预设压缩条件;
若所述两个非布尔数据满足预设压缩条件,则将所述两个非布尔数据作为一个分组并加入已分组数据集中。
进一步地,所述方法还包括:
若所述两个非布尔数据不满足预设压缩条件,则将所述两个非布尔数据重新放入所述候选数据集。
进一步地,将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据包括:
将所述非布尔数据分组,每个分组包括两个非布尔数据;
将分组后的非布尔数据分别按照第二公式进行运算得到与各组非布尔数据一一对应的多个待定压缩数据;
将所述多个待定压缩数据分组,每个分组包括两个待定压缩数据;
将分组后的待定压缩数据分别按照第二公式进行运算得到与各组待定压缩数据一一对应的多个所述第二压缩数据。
进一步地,所述第二公式为:
v 1_2=(int)K 1v 1+(int)2K 2K 1M 1v 2
其中,v 1,v 2为一组非布尔数据中的两个非布尔数据,v 1_2为第二压缩数据,
Figure PCTCN2020083767-appb-000002
e 1和e 2分别是v 1和v 2的截断误差。
进一步地,所述预设压缩条件为:
K 1M 1+2K 2K 1M 1M 2≤2 N-1
其中,M 1和M 2分别为一组非布尔数据中的两个非布尔数据所对应的变量的量程,N为所述变量的位数。
进一步地,所述非布尔数据包括飞机飞行过程中的飞机状态变量和传感器数据。
进一步地,所述方法还包括:
存储所述第一压缩数据和第二压缩数据。
本发明还提供一种电子设备,包括处理器和存储器,所述存储器中存储有计算机可读程序,所述计算机可读程序被配置成由处理器执行,所述计算机可读程序被处理器执行时实现上述的方法。
本发明还涉及一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的方法。
相比现有技术,本发明的有益效果在于:将获取到的数据集按照布尔类型和非布尔类型分类,对于布尔类型,按照第一压缩规则压缩,对于非布尔数据,按照第二压缩规则进行压缩,从而简化运算过程,提高运算效率。
附图说明
图1为本发明一实施例提供的数据压缩方法流程图;
图2为本发明一实施例提供的将数据类型为布尔类型的布尔数据按照第一数据压缩规则形成第一压缩数据的流程图;
图3为本发明一实施例提供的将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据的流程图;
图4为本发明一实施例提供的将非布尔数据分组的流程图;
图5为本发明一实施例提供的将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据的流程图;
图6为本发明实施例提供的电子设备的示意图。
具体实施方式
下面,结合附图以及具体实施方式,对本发明做进一步描述,需要说明的是,在不相冲突的前提下,以下描述的各实施例之间或各技术特征之间可以任意组合形成新的实施例。
本发明提供的数据压缩方法应用于无人机,用于对无人机飞行过程中所采集到的数据进行压缩。
如图1所示,本发明实施例提供的数据压缩方法,包括:
步骤S101:获取数据集,所述数据集包括若干数据。
其中,数据集是由无人机飞行过程中所产生的数据的集合,例如,包括飞机的状态变量、飞机的各类标志位和传感器数据等。其中,飞机的状态变量包括飞机的位置、速度、加速度等,飞机的标志位包括静止状态和运动状态,传感器数据包括加速度传感器的数据。
步骤S102:识别所述若干数据的数据类型,所述数据类型包括布尔类型和非布尔类型。
将数据按照是否是逻辑变量进行分类,分为布尔类型和非布尔类型,布尔类型为逻辑变量,例如,飞机的标志位包括静止状态和运动状态,飞机的标志位为布尔数据,飞机的状态变量和传感器数据为非布尔数据。每个数据与一个身份标识关联,身份标识代表数据所对应的变量,根据身份标识识别出数据是否为布尔类型。
步骤S103:将数据类型为布尔类型的布尔数据按照第一数据压缩规则形成第一压缩数据。
其中,第一数据压缩规则可以为计算公式,多个布尔数据根据计算公式叠加计算得出一个数据,实现对布尔类型的布尔数据的压缩。
步骤S104:将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据,其中,所述第二数据压缩规则与所述第一数据压缩规则不同。
其中,第二压缩规则可以为计算公式,将数量较多的非布尔数据根据计算公式叠加计算得出数量较少的数据,实现对非布尔数据的压缩。
通过将数据集中的数据分为布尔数据和非布尔数据,对布尔数据和非布尔数据分别进行压缩,简化运算过程,提高运算效率。
如图2所示,在一种实施方式中,步骤S103包括:
步骤S201:将所述布尔数据分组。
例如,若某个时刻获取到的布尔数据的数量为100个,则将100个数据分为10组数据,每组包括10个数据。需要说明的是,每组布尔数据的数量可以相同,也可以不同。
步骤S202:将分组后的各组布尔数据分别按照第一公式进行运算得到与所述各组布尔数据一一对应的多个所述第一压缩数据。
在一种实施方式中,第一公式为:
Figure PCTCN2020083767-appb-000003
其中,v 1,v 2…,v N表示一组布尔数据中的N个布尔数据,v bool表示第一压缩数据。
例如,每组有5个数据,其中一组数据为0、0、1、0、1,则根据1*0+2*0+4*1+8*0+16*1=20计算出叠加数据,对得出的叠加数据转化为二进制取整后即得出第一压缩数据,从而将N个数据压缩为一个数据。
将第一压缩数据存储或者发送给终端设备,例如发送给手机,手机根据解压公式进行解压。解压公式为:
v i=bitand(2 i-1,v bool
例如,v bool为10100,对应的是5个原始数据的第一压缩数据,则将1、2、4、8、16转化为二进制后分别与10100按位进行与运算得到5个原始数据。
在上述实施例中,对于布尔数据,将N个数据压缩为一个数据,可以节约N-1个端口,存储空间节省(N-1)/N×100%。
如图3所示,在一种实施方式中,步骤S104包括:
步骤S301:将所述非布尔数据分组,每个分组包括两个非布尔数据。
如图4所示,在一种实施方式中,步骤S301包括:
步骤S401:按照第一预设规则从所述候选数据集中选取两个非布尔数据。
其中,数据集中的非布尔数据包括候选数据集和已分组数据集,已分组数据集为已经完成分组的数据,候选数据集为待选取以进行分组的数据。第一预设规则可以是获取数据的时间顺序,也可以是数据类型,也可以是随机选取。例如,按照获取数据的时间顺序依次选取两个非布尔数据,或者从获取到的数据中任意选取一个传感器数据和一个飞机速度数据。也可以将获取到的非布尔数据按照设定规则分成小组后,再从中选取两个非布尔数据,例如,获取到的非布尔数据包括速度数据、方向数据和加速度数据,按照5个速度数据、3个加速度数据和2个方向数据为一个小组的规则,将获取到的数据分为多个小组,再从每个小组中选取两个非布尔数据。
步骤S402:判断所述两个非布尔数据是否满足预设压缩条件。
其中,预设压缩条件为:
K 1M 1+2K 2K 1M 1M 2≤2 N-1
其中,M 1和M 2分别为一组非布尔数据中的两个非布尔数据所对应的变量的量程,N为所述变量的位数,例如,两个数据均为速度,飞机飞行过程中速度的最大值为10m/s,则M 1和M 2的值均为10,飞机飞行过程中的布尔数据和非布尔数据均为二进制形式的数据,N为两个非布尔数据中其中一个的位数。
Figure PCTCN2020083767-appb-000004
e 1和e 2分别是两个非布尔数据的截断误差。截断误差为数据的近似值与准确值之间的差值,例如,对于小数位数较多的数据,数据存储过程中取近似值进行存储,则存在截断误差。
步骤S403:若所述两个非布尔数据满足预设压缩条件,则将所述两个非 布尔数据作为一个分组并加入已分组数据集中。
步骤S404:若所述两个非布尔数据不满足预设压缩条件,则将所述两个非布尔数据重新放入所述候选数据集。
具体的,若两个非布尔数据满足预设压缩条件,则将两个数据压缩为一个数据,若两个非布尔数据不满足压缩条件,则将两个数据放入候选数据集,以判断与其他数据是否满足压缩条件,若与其他数据均不满足压缩条件,则输入原始数据。在非限制性实施例中,若两个数据不满足预设压缩条件,则直接输出两个非布尔数据。
步骤S302:将分组后的非布尔数据分别按照第二公式进行运算得到与各组非布尔数据一一对应的多个所述第二压缩数据。
在一种实施方式中,第二公式为:
v 1_2=(int)K 1v 1+(int)2K 2K 1M 1v 2
其中,v 1、v 2为一组非布尔数据中的两个非布尔数据,v 1_2为第二压缩数据,
Figure PCTCN2020083767-appb-000005
e 1和e 2分别是v 1和v 2的截断误差。
在上述实施例中,将两个非布尔数据通过第二公式计算得到一个数据,从而将两个数据压缩为一个第二压缩数据,两个非布尔数据可以节约1个端口,存储空间节省50%。
将第二压缩数据存储或者发送给终端设备,例如发送给手机,手机根据解压公式进行解压。解压公式为:
Figure PCTCN2020083767-appb-000006
Figure PCTCN2020083767-appb-000007
根据解压公式,由一个第二压缩数据即可计算出两个原始的非布尔数据。
如图5所示,在另一实施方式中,步骤S104包括:
步骤S501:将所述非布尔数据分组,每个分组包括两个非布尔数据。
步骤S502:将分组后的非布尔数据分别按照第二公式进行运算得到与各组非布尔数据一一对应的多个待定压缩数据。
在一种实施方式中,将满足预设压缩条件的两个非布尔数据作为一个分组,进行压缩得到一个待定压缩数据,多个分组压缩得到多个待定压缩数据。其中,不满足预设压缩条件的非布尔数据也可以作为待定压缩数据。
步骤S503:将所述多个待定压缩数据分组,每个分组包括两个待定压缩数据。
步骤S504:将分组后的待定压缩数据分别按照第二公式进行运算得到与各组待定压缩数据一一对应的多个所述第二压缩数据。
在一个实施方式中,将多个待定压缩数据重新按照预设压缩条件进行分组,满足预设压缩条件的两个非布尔数据作为一个分组,压缩后得到一个第二压缩数据,不满足预设压缩条件的非布尔数据直接输出待定压缩数据。将压缩后的待定压缩数据再次压缩,以进一步节省存储空间。
在另一实施方式中,将满足预设压缩条件的两个非布尔数据作为一个分组,进行一次压缩后,将满足预设压缩调节的压缩后的数据进一步分组进行压缩,在压缩后的数据中进一步选取满足预设压缩条件的两个数据,再次进行压缩,以此进行多次压缩。在非限制性实施例中,也可以在压缩后的数据与不满足预设压缩条件的数据中重新选取出满足预设压缩条件的两个非布尔数据进行压缩。在解压过程中根据压缩次数进行多次解压得到原始数据。
如图6所示,本发明实施例提供的电子设备,包括处理器11和存储器2,存储器12中存储有计算机可读程序,计算机可读程序被配置成由处理器11执行,计算机可读程序被处理器11执行时实现上述的方法。
本实施例中的电子设备与前述实施例中的方法是基于同一发明构思下的两个方面,在前面已经对方法实施过程作了详细的描述,所以本领域技术人员 可根据前述描述清楚地了解本实施例中的电子设备的实施过程,为了说明书的简洁,在此就不再赘述。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来。
本发明还涉及一种计算机可读存储介质,如ROM/RAM、磁碟、光盘等,其上存储有计算机程序,计算机程序被处理器执行时实现上述的方法。
本发明提供的数据压缩方法、电子设备及存储介质,将获取到的数据集按照布尔类型和非布尔类型分类,对于布尔类型,按照第一压缩规则压缩,对于非布尔数据,按照第二压缩规则进行压缩,从而简化运算过程,提高运算效率,且节省存储空间。
上述实施方式仅为本发明的优选实施方式,不能以此来限定本发明保护的范围,本领域的技术人员在本发明的基础上所做的任何非实质性的变化及替换均属于本发明所要求保护的范围。

Claims (14)

  1. 一种数据压缩方法,其特征在于,包括:
    获取数据集,所述数据集包括若干数据;
    识别所述若干数据的数据类型,所述数据类型包括布尔类型和非布尔类型;
    将数据类型为布尔类型的布尔数据按照第一数据压缩规则形成第一压缩数据;
    将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据,其中,所述第二数据压缩规则与所述第一数据压缩规则不同。
  2. 根据权利要求1所述的数据压缩方法,其特征在于,将数据类型为布尔类型的布尔数据按照第一数据压缩规则形成第一压缩数据包括:
    将所述布尔数据分组;
    将分组后的各组布尔数据分别按照第一公式进行运算得到与所述各组布尔数据一一对应的多个所述第一压缩数据。
  3. 根据权利要求2所述的数据压缩方法,其特征在于,所述第一公式为:
    Figure PCTCN2020083767-appb-100001
    其中,v 1,v 2…,v N表示一组布尔数据中的N个布尔数据,v bool表示第一压缩数据。
  4. 根据权利要求1所述的数据压缩方法,其特征在于,所述布尔数据包括飞机飞行过程中的飞机标志位数据。
  5. 根据权利要求1所述的数据压缩方法,其特征在于,将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据包括:
    将所述非布尔数据分组,每个分组包括两个非布尔数据;
    将分组后的非布尔数据分别按照第二公式进行运算得到与各组非布尔数据一一对应的多个所述第二压缩数据。
  6. 根据权利要求5所述的数据压缩方法,其特征在于,所述数据集中的非布尔数据包括候选数据集和已分组数据集,将所述非布尔数据分组包括:
    按照第一预设规则从所述候选数据集中选取两个非布尔数据;
    判断所述两个非布尔数据是否满足预设压缩条件;
    若所述两个非布尔数据满足预设压缩条件,则将所述两个非布尔数据作为一个分组并加入已分组数据集中。
  7. 根据权利要求6所述的数据压缩方法,其特征在于,所述方法还包括:
    若所述两个非布尔数据不满足预设压缩条件,则将所述两个非布尔数据重新放入所述候选数据集。
  8. 根据权利要求1所述的数据压缩方法,其特征在于,将数据类型为非布尔类型的非布尔数据按照第二数据压缩规则形成第二压缩数据包括:
    将所述非布尔数据分组,每个分组包括两个非布尔数据;
    将分组后的非布尔数据分别按照第二公式进行运算得到与各组非布尔数据一一对应的多个待定压缩数据;
    将所述多个待定压缩数据分组,每个分组包括两个待定压缩数据;
    将分组后的待定压缩数据分别按照第二公式进行运算得到与各组待定压缩数据一一对应的多个所述第二压缩数据。
  9. 根据权利要求7或8任一项所述的数据压缩方法,其特征在于,所述第二公式为:
    v 1_2=(int)K 1v 1+(int)2K 2K 1M 1v 2
    其中,v 1,v 2为一组非布尔数据中的两个非布尔数据,v 1_2为第二压缩数据,
    Figure PCTCN2020083767-appb-100002
    e 1和e 2分别是v 1和v 2的截断误差。
  10. 根据权利要求9所述的数据压缩方法,其特征在于,所述预设压缩条件为:
    K 1M 1+2K 2K 1M 1M 2≤2 N-1
    其中,M 1和M 2分别为一组非布尔数据中的两个非布尔数据所对应的变量的量程,N为所述变量的位数。
  11. 根据权利要求1所述的数据压缩方法,其特征在于,所述非布尔数据包括飞机飞行过程中的飞机状态变量和传感器数据。
  12. 根据权利要求1所述的数据压缩方法,其特征在于,所述方法还包括:
    存储所述第一压缩数据和第二压缩数据。
  13. 一种电子设备,其特征在于,包括处理器和存储器,所述存储器中存储有计算机可读程序,所述计算机可读程序被配置成由处理器执行,所述计算机可读程序被处理器执行时实现如权利要求1-12任意一项所述的方法。
  14. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-12任意一项所述的方法。
PCT/CN2020/083767 2019-04-09 2020-04-08 一种数据压缩方法、电子设备及存储介质 WO2020207410A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910281884.5 2019-04-09
CN201910281884.5A CN109962711B (zh) 2019-04-09 2019-04-09 一种数据压缩方法、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020207410A1 true WO2020207410A1 (zh) 2020-10-15

Family

ID=67025944

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/083767 WO2020207410A1 (zh) 2019-04-09 2020-04-08 一种数据压缩方法、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN109962711B (zh)
WO (1) WO2020207410A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109962711B (zh) * 2019-04-09 2022-07-08 深圳市道通智能航空技术股份有限公司 一种数据压缩方法、电子设备及存储介质
CN111526151A (zh) * 2020-04-28 2020-08-11 网易(杭州)网络有限公司 一种数据传输方法、装置、电子设备及存储介质
CN112260694B (zh) * 2020-09-21 2022-01-11 广州中望龙腾软件股份有限公司 一种仿真文件的数据压缩方法
CN112804271B (zh) * 2021-04-15 2021-07-20 中国气象科学研究院 数据压缩方法、装置、终端及计算机可读存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199927A (zh) * 2014-09-03 2014-12-10 腾讯科技(深圳)有限公司 数据处理方法及数据处理装置
CN106354774A (zh) * 2016-08-22 2017-01-25 东北大学 一种实时工业过程大数据压缩存储***及方法
CN106372181A (zh) * 2016-08-31 2017-02-01 东北大学 一种基于工业过程的大数据压缩方法
CN106778959A (zh) * 2016-12-05 2017-05-31 宁波亿拍客网络科技有限公司 一种可基于计算机视觉感知识别的特定标记及方法***
WO2018051696A1 (ja) * 2016-09-14 2018-03-22 株式会社ターボデータラボラトリー データ圧縮方法、データ圧縮装置、コンピュータプログラム及びデータベースシステム
CN107925418A (zh) * 2015-05-21 2018-04-17 零点科技公司 用于混合式数据压缩和解压缩的方法、设备和***
CN109962711A (zh) * 2019-04-09 2019-07-02 深圳市道通智能航空技术有限公司 一种数据压缩方法、电子设备及存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69627391T2 (de) * 1995-12-01 2004-03-04 Sand Technology Systems International, Inc., Westmount Verfahren und system zum durchführen einer booleschen operation auf bitketten unter benutzung einer maximalen bitscheibe
US6507877B1 (en) * 1999-09-03 2003-01-14 Whamtech, Inc. Asynchronous concurrent dual-stream FIFO

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104199927A (zh) * 2014-09-03 2014-12-10 腾讯科技(深圳)有限公司 数据处理方法及数据处理装置
CN107925418A (zh) * 2015-05-21 2018-04-17 零点科技公司 用于混合式数据压缩和解压缩的方法、设备和***
CN106354774A (zh) * 2016-08-22 2017-01-25 东北大学 一种实时工业过程大数据压缩存储***及方法
CN106372181A (zh) * 2016-08-31 2017-02-01 东北大学 一种基于工业过程的大数据压缩方法
WO2018051696A1 (ja) * 2016-09-14 2018-03-22 株式会社ターボデータラボラトリー データ圧縮方法、データ圧縮装置、コンピュータプログラム及びデータベースシステム
CN106778959A (zh) * 2016-12-05 2017-05-31 宁波亿拍客网络科技有限公司 一种可基于计算机视觉感知识别的特定标记及方法***
CN109962711A (zh) * 2019-04-09 2019-07-02 深圳市道通智能航空技术有限公司 一种数据压缩方法、电子设备及存储介质

Also Published As

Publication number Publication date
CN109962711B (zh) 2022-07-08
CN109962711A (zh) 2019-07-02

Similar Documents

Publication Publication Date Title
WO2020207410A1 (zh) 一种数据压缩方法、电子设备及存储介质
CN106549673B (zh) 一种数据压缩方法及装置
WO2022257436A1 (zh) 基于无线通信网络数据仓库构建方法、***、设备及介质
EP4008057B1 (en) Lossless exponent and lossy mantissa weight compression for training deep neural networks
CN112118010A (zh) 一种字符串的压缩处理方法、装置和存储介质
CN109460398B (zh) 时间序列数据的补全方法、装置及电子设备
CN114116635A (zh) 压缩数据流的并行解压缩
CN114726823B (zh) 一种基于生成对抗网络的域名生成方法、装置和设备
CN114529741A (zh) 一种图片去重方法、装置及电子设备
CN117082118A (zh) 基于数据推导及端口预测的网络连接方法
US10769517B2 (en) Neural network analysis
CN112396166A (zh) 基于混合粒度聚合器的图卷积神经网络训练方法及装置
WO2024040870A1 (zh) 文本图像生成、训练、文本图像处理方法以及电子设备
CN115169489B (zh) 数据检索方法、装置、设备以及存储介质
Dube et al. A novel approach of IoT stream sampling and model update on the IoT edge device for class incremental learning in an edge-cloud system
CN115880508A (zh) 图像数据处理方法、装置、设备以及存储介质
CN112612762B (zh) 数据处理方法及相关设备
CN114897067A (zh) 基于联邦学习的决策模型训练方法、装置和联邦学习***
CN111460214B (zh) 分类模型训练方法、音频分类方法、装置、介质及设备
CN114565105A (zh) 处理数据的方法和深度学习模型的训练方法、装置
CN110647942B (zh) 一种用于卫星网络的入侵检测方法、装置和设备
CN108287817A (zh) 一种信息处理方法及设备
CN111049836A (zh) 数据处理方法、电子设备及计算机可读存储介质
CN116827682B (zh) 数据处理方法、装置及计算机设备
CN112100453A (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: 20788185

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

Country of ref document: EP

Kind code of ref document: A1