WO2018068634A1 - 二进制数据的编码、解码方法和装置 - Google Patents
二进制数据的编码、解码方法和装置 Download PDFInfo
- Publication number
- WO2018068634A1 WO2018068634A1 PCT/CN2017/103429 CN2017103429W WO2018068634A1 WO 2018068634 A1 WO2018068634 A1 WO 2018068634A1 CN 2017103429 W CN2017103429 W CN 2017103429W WO 2018068634 A1 WO2018068634 A1 WO 2018068634A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- bit
- byte
- data
- binary data
- bytes
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/70—Media network packetisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0001—Systems modifying transmission characteristics according to link quality, e.g. power backoff
- H04L1/0014—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the source coding
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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/02—Conversion to or from weighted codes, i.e. the weight given to a digit depending on the position of the digit within the block or code word
- H03M7/04—Conversion to or from weighted codes, i.e. the weight given to a digit depending on the position of the digit within the block or code word the radix thereof being two
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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/14—Conversion to or from non-weighted codes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F5/00—Methods or arrangements for data conversion without changing the order or content of the data handled
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/3066—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction by means of a mask or a bit-map
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/004—Arrangements for detecting or preventing errors in the information received by using forward error control
- H04L1/0041—Arrangements at the transmitter end
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/004—Arrangements for detecting or preventing errors in the information received by using forward error control
- H04L1/0045—Arrangements at the receiver end
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/75—Media network packet handling
- H04L65/765—Media network packet handling intermediate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Definitions
- the present application relates to the field of network communication technologies, and in particular, to a method and an apparatus for encoding binary data, and a method and apparatus for decoding binary data.
- Base64 is the most commonly used binary data encoding and decoding technology.
- Base64 encodes binary data with 64 characters. For N bytes of binary data, each of the corresponding 8*N bits is divided into 1 part, and each part has a value between 0 and 63. The value corresponds to an ASCII (American Standard Code for Information Interchange) character, and all the corresponding ASCII characters are spliced together to obtain Base64 encoding of the binary data.
- ASCII American Standard Code for Information Interchange
- Base64 encoded data of 3-byte binary data is 4 bytes, and the file length is increased by about 33% after converting a binary file into a Base64 encoded file.
- the Base64 encoded binary file increases the traffic used by the transfer by about one-third.
- reducing the interaction traffic between the server and the user's handheld device is a critical issue for all businesses.
- Base64 encoded character files are large and difficult to meet the requirements of some demanding application scenarios.
- the present application provides a method for encoding binary data, including:
- the length of the binary data is k bytes, and k is a natural number;
- the k-byte binary data is converted into 7-bit encoded data of (k+t) bytes using a predetermined encoding algorithm, and t is the smallest integer greater than or equal to k divided by 7.
- a method for decoding binary data provided by the present application includes:
- the length of the 7-bit encoded data is p bytes, and p is a natural number greater than 1;
- the p-byte 7-bit encoded data is converted into (p-t) bytes of binary data using a predetermined decoding algorithm, and t is the smallest integer greater than or equal to p divided by 8.
- the application also provides an encoding device for binary data, comprising:
- a binary data obtaining unit configured to acquire binary data;
- the binary data has a length of k bytes, and k is a natural number;
- a 7-bit coding unit for converting k-byte binary data into (k+t) bytes of 7-bit encoded data using a predetermined encoding algorithm, and t is a minimum integer greater than or equal to k divided by 7.
- a decoding device for binary data provided by the application includes:
- a data to be decoded unit configured to acquire 7-bit encoded data to be decoded;
- the length of the 7-bit encoded data is p bytes, and p is a natural number greater than 1;
- a 7-bit decoding unit for converting p-bit 7-bit encoded data into (p-t) bytes of binary data using a predetermined decoding algorithm, where t is the smallest integer greater than or equal to p divided by 8.
- the binary data is 7-bit encoded by using a predetermined encoding algorithm during encoding; when decoding, the 7-bit encoding is restored to binary data by using a predetermined decoding algorithm;
- the binary data can be converted into 8-byte 7-bit encoded data, and the length of the binary data is increased by about 14.3% after being converted into 7-bit encoded data, so the encoded file obtained by the technical solution of the present application is smaller than the length of the Base64 encoded file. It consumes less traffic when transmitted over the network and can adapt to more demanding application scenarios.
- FIG. 1 is a flowchart of a method for encoding binary data in an embodiment of the present application
- FIG. 2 is a flowchart of a method for decoding binary data in an embodiment of the present application
- FIG. 3 is a schematic diagram of an example of a first predetermined encoding algorithm in the embodiment of the present application.
- FIG. 4 is a schematic diagram of an example of a second predetermined encoding algorithm in the embodiment of the present application.
- FIG. 5 is a hardware structural diagram of a device running an embodiment of the present application.
- FIG. 6 is a logical structural diagram of an apparatus for encoding binary data in an embodiment of the present application.
- FIG. 7 is a logical structural diagram of a decoding apparatus for binary data in the embodiment of the present application.
- the characters corresponding to decimal values 0 to 127 can be supported by various network protocols or network applications in network transmission.
- ASCII encoding UTF-7 (Unicode Transformation Format 7, 7-bit Unicode conversion format), 7-bit monospace coding, and the like. That is to say, after the binary file is converted into the 7-bit encoded file of the above encoding modes, the file transfer can be performed in various applications and based on various protocols.
- the 7-bit encoding is a coding method that uses the lower 7 bits of one byte to carry data.
- 7-bit encoding can convert 7-byte binary data into 8-byte encoded data. Converting 3-byte binary data to 4-byte encoding compared to Base64 encoding, the conversion efficiency is higher, the converted encoding The file size is smaller and the transmission traffic is saved.
- an embodiment of the present application proposes a new binary data encoding method and a corresponding binary data decoding method for converting binary data into 7-bit encoded data and 7-bit encoded data to binary data, respectively.
- the traffic consumed by the encoded data in the network transmission is saved, thereby solving the problems in the prior art.
- the embodiment of the present application can be applied to any device having computing and storage capabilities, such as a physical device or a logical device such as a mobile phone, a tablet computer, a PC (Personal Computer), a notebook, a server, a virtual machine, or the like;
- the functions in the embodiments of the present application are implemented by two or more physical or logical devices that share different responsibilities.
- the encoding method and the decoding method may be respectively run on different devices or on the same device.
- Step 110 Obtain binary data.
- the binary data to be converted may be a binary file or a piece of binary data that is a component of a file, and is not limited.
- the binary data can be read from a storage location in a certain network, and the binary data to be converted can be obtained from the specified cache.
- the embodiment of the present application is also not limited.
- Step 120 Convert k-byte binary data into (k+t) bytes of 7-bit encoded data using a predetermined encoding algorithm, where t is the smallest integer greater than or equal to k divided by 7.
- the one-bit binary data valid bit is 8 bits
- the one-bit 7-bit encoded data valid bit is 7 bits. Therefore, when converting binary data into 7-bit encoded data, binary data of 1 to 7 bytes can be expressed by 2 to 8 bytes of 7-bit encoded data, respectively, and the length added after encoding is 1 byte. 8 to 14 bytes of binary data can be expressed by 10 to 16 bytes of 7-bit encoded data, and the length added after encoding is 2 bytes; and so on, k-byte binary data can be obtained by (k) +t) 7-bit encoded data of bytes, t is the smallest integer greater than or equal to k divided by 7. In other words, when converting k-byte binary data into 7-bit encoded data, the added length is t bytes.
- Any of the algorithms that can map the k-bit binary data one-to-one to the (k+t)-byte 7-bit encoded data can be used as the predetermined encoding algorithm, which is not limited in the embodiment of the present application.
- the flow of the decoding method of the binary data is as shown in FIG. 2.
- Step 210 Acquire 7-bit encoded data to be decoded.
- the 7-bit encoded data to be decoded may be an encoded file, or a 7-bit encoded data that is a component of a file, which is not limited.
- the 7-bit encoded data can be read from the storage location in a certain network, and the 7-bit encoded data to be decoded can be obtained from the specified cache.
- the embodiment of the present application is also not limited.
- the length of the 7-bit encoded data to be decoded is p (p is a natural number greater than 1) bytes.
- Step 220 converting a p-byte 7-bit encoded data into a (p-t) word by using a predetermined decoding algorithm
- the binary data of the section, t is the smallest integer greater than or equal to p divided by 8.
- 2 to 8 bytes of 7-bit encoded data can express 1 to 7 bytes of binary data, respectively, and the reduced length is 1 byte after decoding; 7 to 16 bytes of 7-bit encoding
- the data can respectively express 8 to 14 bytes of binary data, and the reduced length after decoding is 2 bytes; and so on, the p-byte 7-bit encoded data can express (pt) bytes of binary data, t is greater than or equal to p is the smallest integer of 8.
- the reduced length is t bytes.
- An algorithm that can reverse the 7-bit encoded data of p bytes to the binary data of (pt) bytes before encoding, which is inverse to the predetermined encoding algorithm used when converting binary data into 7-bit encoded data, can be used as the algorithm.
- the predetermined decoding algorithm in the embodiment is applied.
- encoding can be based on the following idea: one byte of binary data consists of 8 bits, since 7-bit encoding can only use the lower 7 bits of a byte, one byte Binary data requires one byte of 7-bit encoding and one bit of an extra byte.
- One byte of 8-bit binary data can be split into two parts, and a predetermined bit (which can be any one of bits 0 to 7) is used as 1 bit represented by an extra byte, except The remaining 7 bits outside the pre-location are represented by a one-byte 7-bit code.
- the other 6 bits in the extra byte can be used to carry the predetermined bits of the other 6 bytes of binary data.
- every 7 bytes of binary data is increased by 1 byte when mapped to 7-bit encoding, and less than 7 bytes of binary data is also increased by 1 byte when mapping 7-bit encoding, then k bytes Binary data will be incremented by t bytes when mapped to 7-bit encoding.
- the predetermined encoding algorithm in this implementation may operate by extracting a predetermined bit of each byte in k-byte binary data and combining them into a combination of t-byte 7-bit encoding in a set bit order.
- Bit data, the remaining 7 bits of each byte in the k-byte binary data are used as the remaining bit data of the k-byte 7-bit encoding; the combination of the remaining bit data of the k-byte 7-bit encoding and the t-byte 7-bit encoding
- the bit data is arranged in the set byte order to obtain 7-bit encoded data of (k + t) bytes.
- the predetermined decoding algorithm of this implementation can be operated as follows: Since p is equal to (k+t), the p-byte 7-bit encoded data includes the combined data of the t-byte 7-bit code and the remaining bit data of the k-byte 7-bit code arranged in the set byte order; The fixed byte order distinguishes which combination bit data of t bytes and which is the remaining bit data of k bytes, and extracts k bits from the combined bit data of t bytes according to the set bit order, and each extracted 1 bit The bit inserts a predetermined bit of k-byte remaining bit data corresponding to the set bit order of the bit, thereby obtaining k-byte binary data.
- the set bit order and the set byte order can be arbitrarily set, as long as the predetermined encoding algorithm and the predetermined decoding algorithm adopt the same set bit order and set bytes.
- the set bit order may be from the 0th bit to the (s-1)th bit of the bit combination bit data, or from the (s-1)th bit to the 0th bit, which in turn correspond to consecutive s(s)
- the remaining bit data of the byte for example, the byte order may be k bytes of the remaining bit data before the t byte combined bit data, or k bytes of the remaining bit data in the t byte combination After the bit data, and the remaining data of the k bytes are arranged in accordance with the corresponding binary data.
- the highest bit can be used as a predetermined bit, and the highest bit (bit 7) of the k-byte binary data is sequentially combined with the bit data from the first byte.
- the set bit order of the 6th bit to the 0th bit and the 2nd bit of the 2nd bit combined bit data, the combined bit data of the t byte is generated; each of the k bytes of binary data is generated.
- the 0th to 6th bytes of the byte are used as the remaining bit data of k bytes; the combined bit data of t bytes is arranged before the remaining bit data of k bytes, and the (k+t) word of k byte binary data is obtained.
- Section 7-bit encoded data is used as a predetermined bit, and the highest bit (bit 7) of the k-byte binary data is sequentially combined with the bit data from the first byte.
- the combined bit data of the section extracts k in the order of the set bit from the 6th bit to the 0th bit of the first byte combined bit data and the 6th bit to the 0th bit of the combined bit data of the second byte.
- Pre-positioning sequentially inserting the k predetermined bits into the highest bit of the k remaining bits of data, and inserting the predetermined bits to obtain k-byte binary data.
- the fourth bit is used as a pre- Positioning, the continuous 7-byte binary data is grouped into one group. If the last remaining less than 7 bytes is also used as a group, the k-byte binary data will form t groups. Extracting a predetermined bit of each byte in a set of binary data in units of groups, and generating one-byte combined bit data in the order of the 0th to 6th bit sets, each byte in the set is binary The 5th to 7th bits of the data are shifted to the right by one bit to obtain the remaining bit data of the 7-bit code. Before the combined bit data of each group is arranged before the remaining bit data of the group, t groups are sequentially arranged in units of groups to obtain 7-bit encoded data of (k + t) bytes.
- the data will form t groups.
- Set the squad (s+1) (s is a natural number not greater than 7) bytes in a group, and the first byte in the group is the combined bit data, the second to the (s+1)
- the bytes are the remaining bit data of the s-byte; the 0th to the sth bits of the combined bit data in the group are respectively inserted into the 4th to the (s+1)th remaining bit data of the group.
- Bit get s bytes of binary data.
- the binary data obtained from each group is sequentially arranged, and the decoded k-byte binary data can be obtained.
- the binary data is converted into 7-bit encoded data by using a predetermined encoding algorithm; when decoding, the 7-bit encoded data is restored to binary data by using a corresponding predetermined decoding algorithm. Since the length of the binary data is increased by 14.3% after being converted into 7-bit encoded data, which is much smaller than the length of the Base64 encoding, the encoded file obtained by applying the embodiment of the present application consumes less traffic when transmitted over the network, and can adapt to more. Requirements for demanding application scenarios.
- an encoding algorithm is used to convert the data of the image origin.jpg into 7-bit ASCII encoded data, and a corresponding decoding algorithm restores the 7-bit ASCII encoded data to binary data.
- JavaScript program that implements the encoding method is as follows:
- Var buf new Buffer(1024);//Open the buffer used in encoding
- Var data fs.readFileSync('origin.jpg');//data is the binary data of the image origin.jpg
- Var length data.length+Math.ceil(data.length/7); //length is the length of the 7-bit encoded data after conversion
- Var body new Buffer(length);//body is the converted 7-bit encoded data
- the highest bit of every 7 bytes is sequentially combined into an ASCII code combination bit data, wherein the highest bit of the 7th byte binary data in every 7 bytes is Bit 0, the highest byte of the first byte of binary data is in the sixth bit; until the last byte of data; the combined bit data is written to the body one by one.
- the lower 7 bits of each byte are sequentially generated into the remaining bit data of ASCII code, and written to the body one by one.
- Var len temp.length-Math.ceil(temp.length/8);//len is the length of the decoded binary data
- Var buf new Buffer(len);//buf is the decoded binary data
- the front (temp.length-len) bytes of ⁇ //temp are combined bit data, followed by the remaining bits According to the first byte of the combined bit data, the sixth bit to the zeroth bit of each byte are sequentially extracted, and each bit extracted is sequentially inserted into the highest bit of the remaining bit data, and written into the buf.
- the embodiment of the present application further provides an encoding device for binary data, and a decoding device for binary data.
- Both devices can be implemented by software or by hardware or a combination of hardware and software.
- the CPU Central Process Unit
- the device in which the encoding device of the binary data or the decoding device of the binary data is located usually includes a chip for transmitting and receiving wireless signals, and the like.
- Other hardware, and/or other hardware such as boards used to implement network communication functions.
- FIG. 6 is a schematic diagram of an apparatus for encoding binary data according to an embodiment of the present disclosure, including a binary data acquiring unit and a 7-bit encoding unit, wherein: a binary data acquiring unit is configured to acquire binary data; the length of the binary data is k. Byte, k is a natural number; a 7-bit coding unit is used to convert k-byte binary data into 7-bit encoded data of (k+t) bytes using a predetermined encoding algorithm, and t is the smallest integer greater than or equal to k divided by 7. .
- the predetermined encoding algorithm includes: extracting a predetermined bit of each byte in k-byte binary data, and combining the combined bit data of the t-byte 7-bit encoding according to the set bit order; The remaining 7 bits of each byte in the binary data are used as k-byte 7-bit encoded residual bit data; the k-byte 7-bit encoded residual bit data and the t-byte 7-bit encoded combined bit data are set according to the set word.
- the sections are arranged in order to generate 7-bit encoded data of the binary data.
- the setting byte order includes: the k-byte remaining bit data is arranged according to the corresponding binary data before or after the t-byte combined bit data.
- the setting bit sequence includes: sequentially, the predetermined bits extracted from the consecutive s-byte binary data as the 0th bit to the (s-1)th bit of the byte combination bit data, or the ( S-1) to the 0th position; s is a natural number not greater than 7.
- the predetermined bit is the highest bit of each byte.
- FIG. 7 is a schematic diagram of a decoding device for binary data according to an embodiment of the present application, including to be solved a code data obtaining unit and a 7-bit decoding unit, wherein: the data to be decoded acquiring unit is configured to acquire 7-bit encoded data to be decoded; the length of the 7-bit encoded data is p bytes, and p is a natural number greater than 1; 7 bits
- the decoding unit is configured to convert p-byte 7-bit encoded data into (pt) bytes of binary data using a predetermined decoding algorithm, and t is a minimum integer equal to or greater than p divided by 8.
- the predetermined decoding algorithm includes: acquiring, according to a set byte order, k-bit remaining bit data and t-byte combined bit data from p-byte 7-bit encoded data, where k is p Subtracting the difference of t; extracting k bits from the combined data of the t-byte 7-bit code, and inserting each bit of the interpolation into a predetermined bit of the k-byte remaining bit data corresponding to the set bit order of the bit , get k bytes of binary data.
- the setting byte order includes: the k-byte remaining bit data is arranged according to the corresponding binary data before or after the t-byte combined bit data.
- the setting bit sequence includes: a 0th bit to a (s-1)th bit of the byte combination bit data, or a (s-1)th bit to a 0th bit, which sequentially correspond to consecutive s bytes remaining bit data; s is a natural number not greater than 7.
- the predetermined bit is the highest bit of each byte.
- a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media includes both permanent and non-persistent, removable and non-removable media.
- Information storage can be implemented by any method or technology.
- the information can be computer readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of Machine Access Memory (RAM), Read Only Memory (ROM), EEPROM, Flash Memory or other memory technology, CD-ROM, digital A versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape storage or other magnetic storage device or any other non-transportable medium can be used to store information that can be accessed by a computing device.
- PRAM phase change memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM Read Only Memory
- ROM Read Only Memory
- EEPROM Electrically erasable programmable read-only memory
- Flash Memory or other memory technology
- CD-ROM compact disc
- DVD digital A versatile disc
- embodiments of the present application can be provided as a method, system, or computer program product.
- the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
- the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Reduction Or Emphasis Of Bandwidth Of Signals (AREA)
Abstract
Description
Claims (20)
- 一种二进制数据的编码方法,其特征在于,包括:获取二进制数据;所述二进制数据的长度为k字节,k为自然数;采用预定编码算法将k字节的二进制数据转换为(k+t)字节的7位编码数据,t为大于等于k除以7的最小整数。
- 根据权利要求1所述的方法,其特征在于,所述预定编码算法包括:在k字节二进制数据中提取每个字节的预定位,按照设定位顺序组合为t字节7位编码的组合位数据;将k字节二进制数据中每个字节剩余的7位作为k字节7位编码的剩余位数据;将k字节7位编码的剩余位数据和t字节7位编码的组合位数据按照设定字节顺序进行排列,生成所述二进制数据的7位编码数据。
- 根据权利要求2所述的方法,其特征在于,所述设定字节顺序包括:k字节剩余位数据在t字节组合位数据之前或之后,按照所对应的二进制数据排列。
- 根据权利要求2所述的方法,其特征在于,所述设定位顺序包括:将连续的s字节二进制数据中提取的预定位依次作为一个字节组合位数据的第0位到第(s-1)位、或第(s-1)位到第0位;s为不大于7的自然数。
- 根据权利要求2所述的方法,其特征在于,所述预定位为每个字节的最高位。
- 一种二进制数据的解码方法,其特征在于,包括:获取待解码的7位编码数据;所述7位编码数据的长度为p字节,p为大于1的自然数;采用预定解码算法将p字节的7位编码数据转换为(p-t)字节的二进制数据,t为大于等于p除以8的最小整数。
- 根据权利要求6所述的方法,其特征在于,所述预定解码算法包括:按照设定字节顺序,从p字节的7位编码数据中获取k字节的剩余位数据和 t字节的组合位数据,k为p减去t的差值;从t字节7位编码的组合位数据中提取k位,将提取的每1位插入与所述位的设定位顺序对应的k字节剩余位数据的预定位,得到k字节二进制数据。
- 根据权利要求7所述的方法,其特征在于,所述设定字节顺序包括:k字节剩余位数据在t字节组合位数据之前或之后,按照所对应的二进制数据排列。
- 根据权利要求7所述的方法,其特征在于,所述设定位顺序包括:一个字节组合位数据的第0位到第(s-1)位、或第(s-1)位到第0位,依次对应于连续的s字节剩余位数据;s为不大于7的自然数。
- 根据权利要求7所述的方法,其特征在于,所述预定位为每个字节的最高位。
- 一种二进制数据的编码装置,其特征在于,包括:二进制数据获取单元,用于获取二进制数据;所述二进制数据的长度为k字节,k为自然数;7位编码单元,用于采用预定编码算法将k字节的二进制数据转换为(k+t)字节的7位编码数据,t为大于等于k除以7的最小整数。
- 根据权利要求11所述的装置,其特征在于,所述预定编码算法包括:在k字节二进制数据中提取每个字节的预定位,按照设定位顺序组合为t字节7位编码的组合位数据;将k字节二进制数据中每个字节剩余的7位作为k字节7位编码的剩余位数据;将k字节7位编码的剩余位数据和t字节7位编码的组合位数据按照设定字节顺序进行排列,生成所述二进制数据的7位编码数据。
- 根据权利要求12所述的装置,其特征在于,所述设定字节顺序包括:k字节剩余位数据在t字节组合位数据之前或之后,按照所对应的二进制数据排列。
- 根据权利要求12所述的装置,其特征在于,所述设定位顺序包括:将连续的s字节二进制数据中提取的预定位依次作为一个字节组合位数据的 第0位到第(s-1)位、或第(s-1)位到第0位;s为不大于7的自然数。
- 根据权利要求12所述的装置,其特征在于,所述预定位为每个字节的最高位。
- 一种二进制数据的解码装置,其特征在于,包括:待解码数据获取单元,用于获取待解码的7位编码数据;所述7位编码数据的长度为p字节,p为大于1的自然数;7位解码单元,用于采用预定解码算法将p字节的7位编码数据转换为(p-t)字节的二进制数据,t为大于等于p除以8的最小整数。
- 根据权利要求16所述的装置,其特征在于,所述预定解码算法包括:按照设定字节顺序,从p字节的7位编码数据中获取k字节的剩余位数据和t字节的组合位数据,k为p减去t的差值;从t字节7位编码的组合位数据中提取k位,将提取的每1位插入与所述位的设定位顺序对应的k字节剩余位数据的预定位,得到k字节二进制数据。
- 根据权利要求17所述的装置,其特征在于,所述设定字节顺序包括:k字节剩余位数据在t字节组合位数据之前或之后,按照所对应的二进制数据排列。
- 根据权利要求17所述的装置,其特征在于,所述设定位顺序包括:一个字节组合位数据的第0位到第(s-1)位、或第(s-1)位到第0位,依次对应于连续的s字节剩余位数据;s为不大于7的自然数。
- 根据权利要求17所述的装置,其特征在于,所述预定位为每个字节的最高位。
Priority Applications (14)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2019519660A JP6931050B2 (ja) | 2016-10-11 | 2017-09-26 | バイナリデータをエンコード及びデコードする方法及び装置 |
MX2019004256A MX2019004256A (es) | 2016-10-11 | 2017-09-26 | Metodos y dispositivos para codificar y decodificar datos binarios. |
RU2019113976A RU2725763C1 (ru) | 2016-10-11 | 2017-09-26 | Способы и устройства для кодирования и декодирования двоичных данных |
EP17860029.2A EP3528389A4 (en) | 2016-10-11 | 2017-09-26 | METHODS AND DEVICES FOR ENCODING AND DECODING BINARY DATA |
KR1020197013004A KR102249267B1 (ko) | 2016-10-11 | 2017-09-26 | 2진 데이터를 인코딩 및 디코딩하기 위한 방법 및 디바이스 |
MYPI2019001978A MY196192A (en) | 2016-10-11 | 2017-09-26 | Methods and Devices for Encoding And Decoding Binary Data |
AU2017342863A AU2017342863B2 (en) | 2016-10-11 | 2017-09-26 | Methods and devices for encoding and decoding binary data |
BR112019007284A BR112019007284A2 (pt) | 2016-10-11 | 2017-09-26 | métodos e dispositivos de codificação e decodificação de dados binários |
CA3040003A CA3040003C (en) | 2016-10-11 | 2017-09-26 | Methods and devices for encoding and decoding binary data |
SG11201903176RA SG11201903176RA (en) | 2016-10-11 | 2017-09-26 | Methods and devices for encoding and decoding binary data |
US16/380,643 US10785277B2 (en) | 2016-10-11 | 2019-04-10 | Methods and devices for encoding and decoding binary data |
PH12019500783A PH12019500783B1 (en) | 2016-10-11 | 2019-04-11 | Methods and devices for encoding and decoding binary data |
ZA2019/02948A ZA201902948B (en) | 2016-10-11 | 2019-05-10 | Methods and devices for encoding and decoding binary data |
AU2019101588A AU2019101588A4 (en) | 2016-10-11 | 2019-12-13 | Methods and devices for encoding and decoding binary data |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610887650.1 | 2016-10-11 | ||
CN201610887650.1A CN107919943B (zh) | 2016-10-11 | 2016-10-11 | 二进制数据的编码、解码方法和装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/380,643 Continuation US10785277B2 (en) | 2016-10-11 | 2019-04-10 | Methods and devices for encoding and decoding binary data |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018068634A1 true WO2018068634A1 (zh) | 2018-04-19 |
Family
ID=61892693
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/103429 WO2018068634A1 (zh) | 2016-10-11 | 2017-09-26 | 二进制数据的编码、解码方法和装置 |
Country Status (16)
Country | Link |
---|---|
US (1) | US10785277B2 (zh) |
EP (1) | EP3528389A4 (zh) |
JP (1) | JP6931050B2 (zh) |
KR (1) | KR102249267B1 (zh) |
CN (1) | CN107919943B (zh) |
AU (2) | AU2017342863B2 (zh) |
BR (1) | BR112019007284A2 (zh) |
CA (1) | CA3040003C (zh) |
MX (1) | MX2019004256A (zh) |
MY (1) | MY196192A (zh) |
PH (1) | PH12019500783B1 (zh) |
RU (1) | RU2725763C1 (zh) |
SG (1) | SG11201903176RA (zh) |
TW (1) | TW201815074A (zh) |
WO (1) | WO2018068634A1 (zh) |
ZA (1) | ZA201902948B (zh) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110504973A (zh) * | 2018-05-16 | 2019-11-26 | 北京京东尚科信息技术有限公司 | 文件压缩、解压方法和装置 |
CN110120819B (zh) * | 2019-04-26 | 2023-07-21 | 矩阵元技术(深圳)有限公司 | 一种布尔电路编码方法、装置及系统 |
CN110569487B (zh) * | 2019-08-19 | 2023-07-18 | 积成电子股份有限公司 | 一种基于高频率字符替代算法的Base64扩展编码方法及系统 |
CN112422491B (zh) * | 2020-05-08 | 2024-09-20 | 上海幻电信息科技有限公司 | 数字编码的加密解密方法、服务器和存储介质 |
CN111600610B (zh) * | 2020-05-26 | 2023-04-28 | 北京思特奇信息技术股份有限公司 | 一种变长整数的通用编码方法、系统及电子设备 |
CN112148673A (zh) * | 2020-09-22 | 2020-12-29 | 北京中房智宝科技有限公司 | 一种多二进制合并成一个二进制文件读写错误的解决方法 |
CN112818639A (zh) * | 2020-12-30 | 2021-05-18 | 平安普惠企业管理有限公司 | 数据编码方法、装置、计算机设备和存储介质 |
CN112910568A (zh) * | 2021-01-18 | 2021-06-04 | 猫岐智能科技(上海)有限公司 | 一种数据通信方法、数据发送方法及数据接收方法 |
KR102627365B1 (ko) * | 2021-04-28 | 2024-01-18 | 한전케이디엔주식회사 | 배전설비 pd 진단시스템의 prpd 데이터 포맷변환 및 압축 방법 |
CN113542762A (zh) * | 2021-07-20 | 2021-10-22 | 中交信捷科技有限公司 | 一种车辆红外图像的压缩与增强方法和系统 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1994021051A1 (en) * | 1993-03-10 | 1994-09-15 | Awacs Communications (Nz) Limited | Enhanced one way radio seven bit data network |
JP2000307431A (ja) * | 1999-04-23 | 2000-11-02 | Victor Co Of Japan Ltd | 変調装置及び復調装置 |
CN1466342A (zh) * | 2002-07-02 | 2004-01-07 | 深圳市中兴通讯股份有限公司 | 一种在网关上还原电子邮件内容的方法 |
CN1703108A (zh) * | 2005-06-01 | 2005-11-30 | 海信集团有限公司 | 移动终端短消息加密的方法 |
CN1816170A (zh) * | 2005-11-08 | 2006-08-09 | 杭州华为三康技术有限公司 | 短信收发的编码转换方法及其应用的网络设备 |
CN101080038A (zh) * | 2007-06-22 | 2007-11-28 | 中国移动通信集团广东有限公司 | 一种基于ussd协议的中文信息传输方法 |
CN105740215A (zh) * | 2016-01-23 | 2016-07-06 | 北京掌阔移动传媒科技有限公司 | 一种数据通信编码和解码方法 |
Family Cites Families (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4597057A (en) | 1981-12-31 | 1986-06-24 | System Development Corporation | System for compressed storage of 8-bit ASCII bytes using coded strings of 4 bit nibbles |
US5007013A (en) | 1986-04-01 | 1991-04-09 | Westinghouse Electric Corp. | Bidirectional communication and control network with programmable microcontroller interfacing digital ICS and controlled product |
US4789852A (en) | 1987-06-05 | 1988-12-06 | Bailey Guy R | Method and apparatus for converting data in a binary format |
US5136291A (en) | 1990-11-30 | 1992-08-04 | Unisys Corporation | Transmitting binary data files using electronic mail |
US5406279A (en) | 1992-09-02 | 1995-04-11 | Cirrus Logic, Inc. | General purpose, hash-based technique for single-pass lossless data compression |
US5406280A (en) | 1993-08-26 | 1995-04-11 | Commerce Clearing House | Data retrieval system using compression scheme especially for serial data stream |
US5974464A (en) | 1995-10-06 | 1999-10-26 | Silicon Image, Inc. | System for high speed serial video signal transmission using DC-balanced coding |
JP2840589B2 (ja) | 1996-02-09 | 1998-12-24 | 富士通株式会社 | データ圧縮装置及びデータ復元装置 |
US5818032A (en) | 1997-01-03 | 1998-10-06 | Sun; Tsu-Hung Tom | Encoded color halftone micro-dots for high density digital information storage |
US7190257B2 (en) | 1999-03-16 | 2007-03-13 | Intermec Ip Corp. | Data encoding in radio frequency identification transponders |
US6801625B1 (en) * | 1999-12-08 | 2004-10-05 | Intel Corporation | Apparatus and method for stripping parity bits from an input stream |
US7451229B2 (en) | 2002-06-24 | 2008-11-11 | Microsoft Corporation | System and method for embedding a streaming media format header within a session description message |
CN1251522C (zh) * | 2002-10-29 | 2006-04-12 | 蔡宁 | 一种利用pocsag编码传送图形文件的方法 |
US7590837B2 (en) | 2003-08-23 | 2009-09-15 | Softex Incorporated | Electronic device security and tracking system and method |
US7519274B2 (en) | 2003-12-08 | 2009-04-14 | Divx, Inc. | File format for multiple track digital data |
US7769904B2 (en) | 2004-06-09 | 2010-08-03 | L-3 Communications Integrated Systems L.P. | Extensible binary mark-up language for efficient XML-based data communications and related systems and methods |
CN100423582C (zh) * | 2005-11-03 | 2008-10-01 | 浙江大学 | 一种用于将待编码数据进行二进制化编码的方法和装置 |
CN1937582B (zh) * | 2006-08-11 | 2012-08-15 | 白杰 | 待压缩数据的预处理方法以及压缩数据的传输方法 |
US10175990B2 (en) * | 2009-12-22 | 2019-01-08 | Intel Corporation | Gathering and scattering multiple data elements |
CN101840394B (zh) * | 2010-03-04 | 2012-12-19 | 英华达(南昌)科技有限公司 | 数据解码方法 |
CN103067022B (zh) * | 2012-12-19 | 2015-10-21 | 中国石油天然气集团公司 | 一种整型数据无损压缩方法、解压缩方法及装置 |
US20140204994A1 (en) * | 2013-01-24 | 2014-07-24 | Silicon Image, Inc. | Auxiliary data encoding in video data |
US9626184B2 (en) * | 2013-06-28 | 2017-04-18 | Intel Corporation | Processors, methods, systems, and instructions to transcode variable length code points of unicode characters |
WO2016132430A1 (ja) * | 2015-02-16 | 2016-08-25 | 三菱電機株式会社 | データ圧縮装置、データ伸張装置、データ圧縮方法、データ伸張方法及びプログラム |
-
2016
- 2016-10-11 CN CN201610887650.1A patent/CN107919943B/zh active Active
-
2017
- 2017-09-13 TW TW106131352A patent/TW201815074A/zh unknown
- 2017-09-26 EP EP17860029.2A patent/EP3528389A4/en not_active Withdrawn
- 2017-09-26 AU AU2017342863A patent/AU2017342863B2/en active Active
- 2017-09-26 RU RU2019113976A patent/RU2725763C1/ru active
- 2017-09-26 MY MYPI2019001978A patent/MY196192A/en unknown
- 2017-09-26 CA CA3040003A patent/CA3040003C/en active Active
- 2017-09-26 WO PCT/CN2017/103429 patent/WO2018068634A1/zh unknown
- 2017-09-26 SG SG11201903176RA patent/SG11201903176RA/en unknown
- 2017-09-26 KR KR1020197013004A patent/KR102249267B1/ko active IP Right Grant
- 2017-09-26 JP JP2019519660A patent/JP6931050B2/ja active Active
- 2017-09-26 MX MX2019004256A patent/MX2019004256A/es active IP Right Grant
- 2017-09-26 BR BR112019007284A patent/BR112019007284A2/pt not_active IP Right Cessation
-
2019
- 2019-04-10 US US16/380,643 patent/US10785277B2/en active Active
- 2019-04-11 PH PH12019500783A patent/PH12019500783B1/en unknown
- 2019-05-10 ZA ZA2019/02948A patent/ZA201902948B/en unknown
- 2019-12-13 AU AU2019101588A patent/AU2019101588A4/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1994021051A1 (en) * | 1993-03-10 | 1994-09-15 | Awacs Communications (Nz) Limited | Enhanced one way radio seven bit data network |
JP2000307431A (ja) * | 1999-04-23 | 2000-11-02 | Victor Co Of Japan Ltd | 変調装置及び復調装置 |
CN1466342A (zh) * | 2002-07-02 | 2004-01-07 | 深圳市中兴通讯股份有限公司 | 一种在网关上还原电子邮件内容的方法 |
CN1703108A (zh) * | 2005-06-01 | 2005-11-30 | 海信集团有限公司 | 移动终端短消息加密的方法 |
CN1816170A (zh) * | 2005-11-08 | 2006-08-09 | 杭州华为三康技术有限公司 | 短信收发的编码转换方法及其应用的网络设备 |
CN101080038A (zh) * | 2007-06-22 | 2007-11-28 | 中国移动通信集团广东有限公司 | 一种基于ussd协议的中文信息传输方法 |
CN105740215A (zh) * | 2016-01-23 | 2016-07-06 | 北京掌阔移动传媒科技有限公司 | 一种数据通信编码和解码方法 |
Also Published As
Publication number | Publication date |
---|---|
MY196192A (en) | 2023-03-22 |
TW201815074A (zh) | 2018-04-16 |
BR112019007284A2 (pt) | 2019-07-09 |
CA3040003C (en) | 2021-02-09 |
JP6931050B2 (ja) | 2021-09-01 |
US20190245906A1 (en) | 2019-08-08 |
CA3040003A1 (en) | 2018-04-19 |
JP2019537332A (ja) | 2019-12-19 |
SG11201903176RA (en) | 2019-05-30 |
ZA201902948B (en) | 2020-08-26 |
CN107919943A (zh) | 2018-04-17 |
PH12019500783A1 (en) | 2019-12-11 |
RU2725763C1 (ru) | 2020-07-06 |
AU2017342863B2 (en) | 2020-10-22 |
PH12019500783B1 (en) | 2019-12-11 |
EP3528389A4 (en) | 2020-05-13 |
KR20190064621A (ko) | 2019-06-10 |
KR102249267B1 (ko) | 2021-05-10 |
AU2019101588A4 (en) | 2020-01-23 |
AU2017342863A1 (en) | 2019-05-02 |
CN107919943B (zh) | 2020-08-04 |
MX2019004256A (es) | 2019-07-01 |
US10785277B2 (en) | 2020-09-22 |
EP3528389A1 (en) | 2019-08-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018068634A1 (zh) | 二进制数据的编码、解码方法和装置 | |
WO2016029801A1 (zh) | 编码、解码方法以及编码装置和解码装置 | |
CN107395209B (zh) | 数据压缩方法、数据解压缩方法及其设备 | |
US9710415B2 (en) | Asynchronous FIFO buffer with Johnson code write pointer | |
JP6381546B2 (ja) | 多バイト・フレームのパイプライン化圧縮のための方法、符号化データ・ストリームへの高帯域圧縮のための装置、およびコンピュータ・プログラム製品 | |
WO2017059798A1 (zh) | 序列化与反序列化的方法、装置、系统以及电子设备 | |
US10019409B2 (en) | Extending remote direct memory access operations for storage class memory access | |
WO2017054597A1 (zh) | 表情字符串的处理方法及装置 | |
JP2019537332A5 (zh) | ||
US10757227B2 (en) | Security-oriented compression | |
TW201728182A (zh) | 音頻-視頻資料的發送方法、接收方法和音頻-視頻資料的傳輸系統 | |
CN111464189A (zh) | 一种斐波那契进制译码装置、方法 | |
CN110750388A (zh) | 一种备份解析方法、装置、设备和介质 | |
CN114189331B (zh) | 一种密钥存储和读取方法、装置、设备及存储介质 | |
KR20160008386A (ko) | 펄스폭 변조 데이터 복원 장치 및 이의 구동 방법 | |
CN111178010B (zh) | 显示数字签名的方法及系统、数据编辑方法及终端 | |
WO2018228238A1 (zh) | 一种进程之间的通信方法和装置 | |
Zeng et al. | Research on LZW Algorithm Based on AES in Data Backup Under Data Block Compression and Encryption | |
US20100202468A1 (en) | Bridge, data compressing method thereof and computer system applying the same | |
CN113283215B (zh) | 一种基于utf-32编码的数据混淆方法及装置 | |
CN115001628B (zh) | 数据编码的方法及装置、数据解码的方法及装置和数据结构 | |
KR100660057B1 (ko) | 패스트 인포셋을 이용한 이진 엑스엠엘 저장 방법 및 복원방법 | |
CN110888999A (zh) | 一种图片与字符相互转换的方法 | |
CN117850661A (zh) | 用于处理压缩数据的方法、设备和计算机程序产品 | |
CN116431630A (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: 17860029 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 3040003 Country of ref document: CA |
|
ENP | Entry into the national phase |
Ref document number: 2019519660 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
REG | Reference to national code |
Ref country code: BR Ref legal event code: B01A Ref document number: 112019007284 Country of ref document: BR |
|
ENP | Entry into the national phase |
Ref document number: 2017342863 Country of ref document: AU Date of ref document: 20170926 Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 20197013004 Country of ref document: KR Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 2017860029 Country of ref document: EP Effective date: 20190513 |
|
ENP | Entry into the national phase |
Ref document number: 112019007284 Country of ref document: BR Kind code of ref document: A2 Effective date: 20190410 |