CN111274950A - Feature vector data encoding and decoding method, server and terminal - Google Patents
- ️Fri Jun 12 2020
CN111274950A - Feature vector data encoding and decoding method, server and terminal - Google Patents
Feature vector data encoding and decoding method, server and terminal Download PDFInfo
-
Publication number
- CN111274950A CN111274950A CN202010061721.9A CN202010061721A CN111274950A CN 111274950 A CN111274950 A CN 111274950A CN 202010061721 A CN202010061721 A CN 202010061721A CN 111274950 A CN111274950 A CN 111274950A Authority
- CN
- China Prior art keywords
- binary
- data
- node
- text
- server Prior art date
- 2020-01-19 Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/50—Maintenance of biometric data or enrolment thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/31—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/51—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The application discloses a feature vector data coding and decoding method, a server and a terminal. In the application, a server obtains an image feature vector in an image database, wherein the image feature vector is floating point type data; the server converting the floating-point data into a binary data text comprising a binary encoding of ASCII characters, wherein a valid bit in a floating-point data corresponds to a binary encoding of an ASCII character; the server encodes the binary code of each ASCII character in the binary data text to obtain an encoded binary data text; the server compresses the encoded binary data text.
Description
Technical Field
The present application relates to the field of communications, and in particular, to a feature vector data encoding and decoding method, a server, and a terminal.
Background
With the wide application of image recognition technology, the extraction amount of image feature data is increasing. Taking face recognition based on a deep learning algorithm as an example, when extracting features of an image, feature vector data to be extracted is generally 128, 512 or 1024 floating point (float) data.
One floating point type data (including single-precision floating point number or double-precision floating point number) occupies 4 bytes, and for example, 512 feature vectors are extracted from a single image, and the size of the feature vector data extracted from the single image reaches 2048 bytes. Taking the face database capable of storing 30 ten thousand face pictures as an example, the storage capacity of the feature vector data can reach 60MB, and for a larger face database, such as a face database with the scale from million figures to hundred million figures, the storage capacity occupied by the feature vector data is larger, and the network transmission overhead is higher.
Therefore, how to improve the coding efficiency of the feature vector data, thereby reducing the storage amount of the feature vector data and further reducing the overhead of network transmission is a problem to be solved at present.
Disclosure of Invention
The exemplary embodiments of the present application provide a feature vector data encoding and decoding method, a server, and a terminal device, so as to improve the encoding efficiency of feature vector data.
According to an aspect of the exemplary embodiments, there is provided a feature vector data encoding method including:
the method comprises the steps that a server obtains image feature vectors in an image database, wherein the image feature vectors are floating point data;
the server converting the floating-point data into a binary data text comprising a binary encoding of ASCII characters, wherein a valid bit in a floating-point data corresponds to a binary encoding of an ASCII character;
the server encodes the binary code of each ASCII character in the binary data text to obtain an encoded binary data text;
the server compresses the encoded binary data text.
In some exemplary embodiments, the server converts the floating point type data into a binary data text, including: removing invalid bits in the floating-point data by the server to obtain valid bits in the floating-point data, wherein the invalid bits in the floating-point data comprise all zeros after the last non-zero bit after a decimal point; the server converts each valid bit into a binary encoding of the corresponding ASCII character according to an ASCII character table.
In some exemplary embodiments, the server encodes a binary encoding of each ASCII character in the binary data text, including:
the server takes each ASCII character in the binary data text as a node, and sorts all the nodes according to the weight of each node, wherein the weight of one node is used for representing the probability of the ASCII character corresponding to the node appearing in all the ASCII characters in the binary data text;
the server merges two nodes with the minimum probability, the weight of the merged node is the sum of the weights of the two nodes, all the nodes are ranked again according to the weight of each node after the nodes are merged, the two nodes with the minimum probability are merged until the two nodes are merged into one node, a binary tree which takes the node obtained by final merging as a root node is obtained, each leaf node of the binary tree corresponds to one ASCII character, and two child nodes under one father node in the binary tree correspond to a coded
value0 and a coded
value1 respectively;
and the server obtains the binary coding value corresponding to each leaf node according to the coding value corresponding to the node on the path of each leaf node.
In some exemplary embodiments, the method further comprises: the server sends the compressed binary data text and the coding table to a terminal, so that the terminal decodes the binary data text according to the coding table to obtain a feature vector of an image; wherein the encoding table includes a mapping between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters.
According to an aspect of the exemplary embodiments, there is provided a feature vector data decoding method including:
a terminal receives feature vector data and a coding table sent by a server, wherein the feature vector data is a compressed and coded binary data text; wherein the encoding table includes a mapping relationship between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters;
the terminal decompresses the binary text data, and the decompressed binary text comprises a coded value obtained by coding the binary code of the ASCII characters;
the terminal decodes the decompressed binary text data according to the coding table to obtain a binary code of each ASCII character in the binary text;
and the terminal converts the decoded binary text data into floating-point type data to obtain a floating-point type image characteristic vector, wherein one effective bit in one piece of floating-point type data corresponds to a binary code of an ASCII character.
According to an aspect of the exemplary embodiments, there is provided a server including:
the acquisition module is used for acquiring image feature vectors in an image database, wherein the image feature vectors are floating point data;
a conversion module for converting the floating-point data into a binary data text comprising a binary encoding of ASCII characters, wherein a significant bit in a floating-point data corresponds to a binary encoding of an ASCII character;
the encoding module is used for encoding the binary code of each ASCII character in the binary data text to obtain an encoded binary data text;
and the compression module is used for compressing the coded binary data text.
In some exemplary embodiments, the conversion module is specifically configured to: removing invalid bits in the floating-point data to obtain valid bits in the floating-point data, wherein the invalid bits in the floating-point data comprise all zeros after the last non-zero bit after a decimal point; each valid bit is converted to a binary encoding of the corresponding ASCII character according to the ASCII character table.
In some exemplary embodiments, the encoding module is specifically configured to: taking each ASCII character in the binary data text as a node, and sequencing all the nodes according to the weight of each node, wherein the weight of one node is used for representing the probability of the ASCII character corresponding to the node appearing in all the ASCII characters in the binary data text; combining two nodes with the minimum probability, wherein the weight of the combined node is the sum of the weights of the two nodes, sequencing all the nodes again according to the weight of each node after the nodes are combined, combining the two nodes with the minimum probability until the two nodes are combined into one node, and obtaining a binary tree with the finally combined node as a root node, wherein each leaf node of the binary tree corresponds to one ASCII character, and two child nodes under one father node in the binary tree correspond to a coded
value0 and a coded
value1 respectively; and respectively obtaining a binary coding value corresponding to each leaf node according to the coding value corresponding to the node on the path of each leaf node.
In some exemplary embodiments, further comprising: the transmitting module is used for transmitting the compressed binary data text and the coding table to a terminal, so that the terminal decodes the binary data text according to the coding table to obtain a feature vector of an image; wherein the encoding table includes a mapping between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters.
According to an aspect of the exemplary embodiments, there is provided a terminal including:
the receiving module is used for receiving the feature vector data and the coding table sent by the server, wherein the feature vector data is a compressed and coded binary data text; wherein the encoding table includes a mapping relationship between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters;
the decompression module is used for decompressing the binary text data, and the decompressed binary text comprises a coded value obtained by coding the binary code of the ASCII characters;
the decoding module is used for decoding the decompressed binary text data according to the coding table to obtain a binary code of each ASCII character in the binary text;
and the conversion module is used for converting the decoded binary text data into floating-point type data to obtain a floating-point type image characteristic vector, wherein one effective bit in one piece of floating-point type data corresponds to the binary code of one ASCII character.
According to an aspect of the exemplary embodiments, there is provided a server including: a processor and a memory, the memory storing computer instructions, the processor being configured to execute the computer instructions to implement the method performed by the server described above.
According to an aspect of the exemplary embodiments, there is provided a terminal including: a processor and a memory, the memory storing computer instructions, the processor being configured to execute the computer instructions to implement the method performed by the terminal described above.
According to an aspect of the exemplary embodiments, there is provided a computer-readable storage medium having stored thereon computer instructions to cause a processor to execute the computer instructions to implement the above-described server-side method.
According to an aspect of exemplary embodiments, there is provided a computer-readable storage medium having stored thereon computer instructions to cause a processor to execute the computer instructions to implement the above-described terminal-side method.
In the above embodiment of the present application, the floating-point type data is converted into a binary data text comprising a binary code of ASCII characters, wherein one significant bit in one floating-point type data corresponds to the binary code of one ASCII character; and then, coding the binary code of each ASCII character in the binary data text to obtain a coded binary data text, and then compressing the coded binary data text, thereby improving the coding efficiency of the feature vector data, reducing the storage capacity of the feature vector data and further reducing the network transmission overhead of the feature vector data.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 schematically illustrates a flow chart of an encoding method of feature vector data provided by an embodiment of the present application;
fig. 2a and 2b are schematic diagrams illustrating huffman coding in the embodiment of the present application;
fig. 3 is a schematic flowchart illustrating a decoding method of feature vector data according to an embodiment of the present application;
fig. 4 is a schematic structural diagram illustrating a server provided in an embodiment of the present application;
fig. 5 schematically illustrates a structure of a terminal provided in an embodiment of the present application.
Detailed Description
The technical solution in the embodiments of the present application will be described in detail and removed with reference to the accompanying drawings. Wherein in the description of the embodiments of the present application, "/" means or, unless otherwise stated, for example, a/B may mean a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: three cases of a alone, a and B both, and B alone exist, and in addition, "a plurality" means two or more than two in the description of the embodiments of the present application.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of the application, "plurality" means two or more unless stated otherwise.
Furthermore, the terms "comprises" and "comprising," as well as any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or device that comprises a list of elements is not necessarily limited to those elements explicitly listed, but may include other elements not expressly listed or inherent to such product or device.
The term "module" as used herein refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and/or software code that is capable of performing the functionality associated with that element.
Fig. 1 schematically illustrates a feature vector encoding process provided by an embodiment of the present application, and as shown in the figure, the process may include:
s101: the server obtains image feature vectors in an image database, wherein the image feature vectors are floating point data.
In this step, the server may obtain the image feature vector in the image database and perform subsequent encoding processing when the image feature vector in the image database needs to be sent to the terminal. The server may also obtain the image feature vector in the updated image database after the image database is updated, and perform subsequent encoding processing. The server can also obtain the image feature vector in the image database based on the request of the terminal for obtaining the image feature vector, and perform subsequent coding processing.
The image database may be a face database for storing face images and face feature vectors extracted from the face images.
Wherein, the server can be a server with image database management function, and the server can also be responsible for the distribution of the image feature vector. The terminal can perform image recognition based on the image feature vector, for example, face recognition based on the face feature vector. In some application scenarios, the terminal may be a face acquisition and recognition device deployed at an entrance of a specific place (such as an airport or a station); in other application scenarios, the terminal may also be a mobile handheld device for face acquisition and recognition.
S102: the server converts the floating-point data to binary data text comprising a binary encoding of ASCII characters, wherein a valid bit in a floating-point data corresponds to a binary encoding of an ASCII character.
Optionally, in this step, the server may first remove an invalid bit in the floating-point data to obtain a valid bit in the floating-point data, where the invalid bit in the floating-point data includes all zeros after a last non-zero bit after the decimal point; the server then converts each valid bit to a binary encoding of the corresponding ASCII character according to the ASCII character table.
The decimal representation range for a floating point type number is: 0.000000000000000000000000000000000000034-340000000000000000000000000000000000000. The binary representation of a decimal number (e.g., 313645) is 1001100100100101101. In 0.31364500000000000000000000000000000000, in a floating-point type value, the 0 following the last non-zero bit "5" following the decimal point can be regarded as invalid bit and can be discarded without any loss of valid information, so that each bit (including the bit where the decimal point is located) in 0.313645 can be converted into corresponding ASCII character according to the ASCII character table, thereby obtaining 8 bytes of ASCII code data. Where the decimal point may be converted to a period in an ASCII character table.
S103: and the server encodes the binary code of each ASCII character in the binary data text to obtain the encoded binary data text.
In this step, a binary code of each ASCII character in the binary data text may be encoded using a huffman (huffman) encoding algorithm, or a gzip encoding algorithm, or a brotli encoding algorithm, or a zstd encoding algorithm, or a PPM encoding algorithm to compress the storage amount of the binary data text.
S104: the server compresses the encoded binary data text.
By further compression processing, the amount of memory of the text of the progress data can be further compressed. In this step, the encoded binary data text may be compressed losslessly according to the encoding table, and the range of the text compression may be 10 times to 1000 times, so as to offset the data size amplified when the floating point type data is converted into ASCII characters in S102.
Further, the above process may further include the following steps:
s105: and the server sends the compressed binary data text and the coding table to the terminal, so that the terminal decodes the binary data text according to the coding table to obtain the feature vector of the image. Wherein the encoding table includes a mapping between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters. Taking huffman coding algorithm as an example, the coding table may be a huffman tree structure, where each leaf node corresponds to one ASCII character, and the corresponding ASCII character may be determined based on the tree according to the coding value.
Next, the encoding process in S103 in the above flow will be described by taking the huffman coding algorithm as an example.
Based on the huffman coding principle, in S103 of the above flow, the server may use each ASCII character in the binary data text as a node, and rank all the nodes according to the weight of each node, where the weight of a node is used to represent the probability that the ASCII character corresponding to the node appears in all ASCII characters in the binary data text; then, the server merges two nodes with the minimum probability, the weight of the merged node is the sum of the weights of the two nodes, all the nodes are sorted again according to the weight of each node after the nodes are merged, the two nodes with the minimum probability are merged until the two nodes are merged into one node, a binary tree which takes the node finally obtained by merging as a root node is obtained, each leaf node of the binary tree corresponds to one ASCII character, the node with the small weight in two child nodes under one father node in the binary tree corresponds to the
code value0, and the node with the large weight corresponds to the
code value1. And finally, the server obtains the binary coding value corresponding to each leaf node according to the coding value corresponding to the node on the path of each leaf node.
The principle of huffman coding is explained in the following with an example.
In this example, the ASCII character sequence is: "AFTERDATAEARAREARTAREA", the ASCII character sequence may be encoded by:
firstly, counting the occurrence frequency of each character as the weight of a corresponding node (one character corresponds to one node):
A:8,D:1,E:4,F:1,R:5,T:3。
then, a Huffman tree was constructed in the following way:
repeating the following steps:
sequencing all the nodes according to the weight to obtain: D-F-T-E-R-A;
selecting two nodes with the minimum weight, namely D and F, to generate a new node, wherein the weight of the node is the sum of the weights of the two nodes, namely 2;
and then, returning to the step of sequencing all the nodes according to the weight until only one node is left, wherein the node is the root node of the Huffman tree.
According to the above steps, the generation process of the Huffman tree corresponding to the ASCII character sequence can be seen in fig. 2 a.
According to the Huffman tree generated in fig. 2a, each leaf node in the number corresponds to an ASCII character in the sequence of ASCII characters.
Based on the above-described Huffman tree structure, each ASCII character may be encoded using the Huffman tree. Specifically, the following can be agreed: and taking the node with small weight as a left node, taking the node with large weight as a right node, wherein the left node is coded into 0, and the right node is coded into 1. Thus, the above-described encoding format is shown in fig. 2 b. As can be derived from the graph of fig. 2b, the code value of each leaf node is:
E:00;R:01;F:1000;D:1001;T:101;A:11。
in the above example, the ASCII character sequence including letters is taken as an example, and after the image feature vector of the floating point type is converted into the ASCII character sequence, the ASCII character sequence is a sequence including decimal digits, but the encoding principle and method thereof are the same as those described above.
Fig. 3 schematically illustrates a flow chart of feature vector data decoding provided by an embodiment of the present application, and as shown in the figure, the flow chart may include the following steps:
s301: a terminal receives feature vector data and a coding table sent by a server, wherein the feature vector data is a compressed and coded binary data text; wherein the encoding table includes a mapping between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters.
S302: the terminal decompresses the binary text data, the decompressed binary text comprising encoded values encoding the binary encoding of the ASCII characters.
S303: and the terminal decodes the decompressed binary text data according to the coding table to obtain the binary code of each ASCII character in the binary text.
S304: and the terminal converts the decoded binary text data into floating-point type data to obtain a floating-point type image characteristic vector, wherein one effective bit in one floating-point type data corresponds to a binary code of an ASCII character.
The decoding process at the terminal side corresponds to the encoding process at the server side, and the related description can refer to the encoding process at the server side.
In the above embodiment of the present application, the floating-point type data is converted into a binary data text comprising a binary code of ASCII characters, wherein one significant bit in one floating-point type data corresponds to the binary code of one ASCII character; and then, coding the binary code of each ASCII character in the binary data text to obtain a coded binary data text, and then compressing the coded binary data text, thereby improving the coding efficiency of the feature vector data, reducing the storage capacity of the feature vector data and further reducing the network transmission overhead of the feature vector data.
Based on the same technical concept, the embodiment of the application also provides a server.
Fig. 4 exemplarily shows a schematic structural diagram of a server provided in an embodiment of the present application, where the server can implement the functions of the server side in the foregoing embodiments. As shown, the server may include: an obtaining
module401, a converting
module402, an
encoding module403, and a
compressing module404.
An obtaining
module401, configured to obtain an image feature vector in an image database, where the image feature vector is floating-point data;
a
conversion module402 for converting the floating-point data into a binary data text comprising a binary encoding of ASCII characters, wherein a significant bit in a floating-point data corresponds to a binary encoding of an ASCII character;
the
encoding module403 is configured to encode a binary code of each ASCII character in the binary data text to obtain an encoded binary data text;
and a
compression module404, configured to compress the encoded binary data text.
Optionally, the
conversion module402 is specifically configured to: removing invalid bits in the floating-point data to obtain valid bits in the floating-point data, wherein the invalid bits in the floating-point data comprise all zeros after the last non-zero bit after a decimal point; each valid bit is converted to a binary encoding of the corresponding ASCII character according to the ASCII character table.
Optionally, the
encoding module403 is specifically configured to: taking each ASCII character in the binary data text as a node, and sequencing all the nodes according to the weight of each node, wherein the weight of one node is used for representing the probability of the ASCII character corresponding to the node appearing in all the ASCII characters in the binary data text; combining two nodes with the minimum probability, wherein the weight of the combined node is the sum of the weights of the two nodes, sequencing all the nodes again according to the weight of each node after the nodes are combined, combining the two nodes with the minimum probability until the two nodes are combined into one node, and obtaining a binary tree with the finally combined node as a root node, wherein each leaf node of the binary tree corresponds to one ASCII character, and two child nodes under one father node in the binary tree correspond to a
coded value0 and a
coded value1 respectively; and respectively obtaining a binary coding value corresponding to each leaf node according to the coding value corresponding to the node on the path of each leaf node.
Optionally, the shang shui yuan server may further include: a sending
module405, configured to send the compressed binary data text and the code table to a terminal, so that the terminal decodes the binary data text according to the code table to obtain a feature vector of an image; wherein the encoding table includes a mapping between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters.
Based on the same technical concept, the embodiment of the application also provides a terminal.
Fig. 5 illustrates an example of the structure of a terminal provided in an embodiment of the present application, where the terminal can implement the functions of the terminal side in the foregoing embodiments. As shown, the terminal may include: a receiving
module501, a
decompression module502, a
decoding module503 and a
conversion module504.
A receiving
module501, configured to receive feature vector data and a coding table sent by a server, where the feature vector data is a compressed and coded binary data text; wherein the encoding table includes a mapping relationship between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters;
a
decompression module502, configured to decompress the binary text data, where the decompressed binary text includes an encoded value obtained by encoding a binary code of ASCII characters;
the
decoding module503 is configured to decode the decompressed binary text data according to the coding table to obtain a binary code of each ASCII character in the binary text;
a
conversion module504, configured to convert the decoded binary text data into floating-point data to obtain a floating-point image feature vector, where one valid bit in one floating-point data corresponds to a binary code of an ASCII character.
Since the communication terminal and the computer storage medium in the embodiment of the present application may be applied to the processing method, reference may also be made to the above method embodiment for obtaining technical effects, and details of the embodiment of the present application are not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
While specific embodiments of the present application have been described above, it will be appreciated by those skilled in the art that these are by way of example only, and that the scope of the present application is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and principles of this application, and these changes and modifications are intended to be included within the scope of this application.
Claims (10)
1. A method for encoding feature vector data, comprising:
the method comprises the steps that a server obtains image feature vectors in an image database, wherein the image feature vectors are floating point data;
the server converting the floating-point data into a binary data text comprising a binary encoding of ASCII characters, wherein a valid bit in a floating-point data corresponds to a binary encoding of an ASCII character;
the server encodes the binary code of each ASCII character in the binary data text to obtain an encoded binary data text;
the server compresses the encoded binary data text.
2. The method of claim 1, wherein the server converts the floating point type data to binary data text, comprising:
removing invalid bits in the floating-point data by the server to obtain valid bits in the floating-point data, wherein the invalid bits in the floating-point data comprise all zeros after the last non-zero bit after a decimal point;
the server converts each valid bit into a binary encoding of the corresponding ASCII character according to an ASCII character table.
3. The method of claim 1, wherein the server encodes a binary encoding of each ASCII character in the binary data text, comprising:
the server takes each ASCII character in the binary data text as a node, and sorts all the nodes according to the weight of each node, wherein the weight of one node is used for representing the probability of the ASCII character corresponding to the node appearing in all the ASCII characters in the binary data text;
the server merges two nodes with the minimum probability, the weight of the merged node is the sum of the weights of the two nodes, all the nodes are ranked again according to the weight of each node after the nodes are merged, the two nodes with the minimum probability are merged until the two nodes are merged into one node, a binary tree which takes the node obtained by final merging as a root node is obtained, each leaf node of the binary tree corresponds to one ASCII character, and two child nodes under one father node in the binary tree correspond to a coded value 0 and a coded value 1 respectively;
and the server obtains the binary coding value corresponding to each leaf node according to the coding value corresponding to the node on the path of each leaf node.
4. The method of any one of claims 1-3, further comprising two
The server sends the compressed binary data text and the coding table to a terminal, so that the terminal decodes the binary data text according to the coding table to obtain a feature vector of an image; wherein the encoding table includes a mapping between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters.
5. A method for decoding feature vector data, comprising:
a terminal receives feature vector data and a coding table sent by a server, wherein the feature vector data is a compressed and coded binary data text; wherein the encoding table includes a mapping relationship between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters;
the terminal decompresses the binary text data, and the decompressed binary text comprises a coded value obtained by coding the binary code of the ASCII characters;
the terminal decodes the decompressed binary text data according to the coding table to obtain a binary code of each ASCII character in the binary text;
and the terminal converts the decoded binary text data into floating-point type data to obtain a floating-point type image characteristic vector, wherein one effective bit in one piece of floating-point type data corresponds to a binary code of an ASCII character.
6. A server, comprising:
the acquisition module is used for acquiring image feature vectors in an image database, wherein the image feature vectors are floating point data;
a conversion module for converting the floating-point data into a binary data text comprising a binary encoding of ASCII characters, wherein a significant bit in a floating-point data corresponds to a binary encoding of an ASCII character;
the encoding module is used for encoding the binary code of each ASCII character in the binary data text to obtain an encoded binary data text;
and the compression module is used for compressing the coded binary data text.
7. The server according to claim 6, wherein the conversion module is specifically configured to:
removing invalid bits in the floating-point data to obtain valid bits in the floating-point data, wherein the invalid bits in the floating-point data comprise all zeros after the last non-zero bit after a decimal point;
each valid bit is converted to a binary encoding of the corresponding ASCII character according to the ASCII character table.
8. The server according to claim 6, wherein the encoding module is specifically configured to:
taking each ASCII character in the binary data text as a node, and sequencing all the nodes according to the weight of each node, wherein the weight of one node is used for representing the probability of the ASCII character corresponding to the node appearing in all the ASCII characters in the binary data text;
combining two nodes with the minimum probability, wherein the weight of the combined node is the sum of the weights of the two nodes, sequencing all the nodes again according to the weight of each node after the nodes are combined, combining the two nodes with the minimum probability until the two nodes are combined into one node, and obtaining a binary tree with the finally combined node as a root node, wherein each leaf node of the binary tree corresponds to one ASCII character, and two child nodes under one father node in the binary tree correspond to a coded value 0 and a coded value 1 respectively;
and respectively obtaining a binary coding value corresponding to each leaf node according to the coding value corresponding to the node on the path of each leaf node.
9. The server according to any one of claims 6-8, further comprising:
the transmitting module is used for transmitting the compressed binary data text and the coding table to a terminal, so that the terminal decodes the binary data text according to the coding table to obtain a feature vector of an image; wherein the encoding table includes a mapping between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters.
10. A terminal, comprising:
the receiving module is used for receiving the feature vector data and the coding table sent by the server, wherein the feature vector data is a compressed and coded binary data text; wherein the encoding table includes a mapping relationship between binary encodings of the ASCII characters and encoded values resulting from binary encodings of the corresponding ASCII characters;
the decompression module is used for decompressing the binary text data, and the decompressed binary text comprises a coded value obtained by coding the binary code of the ASCII characters;
the decoding module is used for decoding the decompressed binary text data according to the coding table to obtain a binary code of each ASCII character in the binary text;
and the conversion module is used for converting the decoded binary text data into floating-point type data to obtain a floating-point type image characteristic vector, wherein one effective bit in one piece of floating-point type data corresponds to the binary code of one ASCII character.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010061721.9A CN111274950B (en) | 2020-01-19 | 2020-01-19 | Feature vector data encoding and decoding method, server and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010061721.9A CN111274950B (en) | 2020-01-19 | 2020-01-19 | Feature vector data encoding and decoding method, server and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111274950A true CN111274950A (en) | 2020-06-12 |
CN111274950B CN111274950B (en) | 2023-09-05 |
Family
ID=71001784
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010061721.9A Active CN111274950B (en) | 2020-01-19 | 2020-01-19 | Feature vector data encoding and decoding method, server and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111274950B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114125072A (en) * | 2021-11-24 | 2022-03-01 | 中国银行股份有限公司 | Data processing method and device |
CN114398856A (en) * | 2022-01-19 | 2022-04-26 | 广州启辰电子科技有限公司 | Image-text coding method based on depth decoupling frame |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105740215A (en) * | 2016-01-23 | 2016-07-06 | 北京掌阔移动传媒科技有限公司 | Data communication coding and decoding method |
-
2020
- 2020-01-19 CN CN202010061721.9A patent/CN111274950B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105740215A (en) * | 2016-01-23 | 2016-07-06 | 北京掌阔移动传媒科技有限公司 | Data communication coding and decoding method |
Non-Patent Citations (2)
Title |
---|
卢冰;刘兴海;: "利用改进的哈夫曼编码实现文件的压缩与解压" * |
王防修;周康;: "基于二叉排序树的哈夫曼编码" * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114125072A (en) * | 2021-11-24 | 2022-03-01 | 中国银行股份有限公司 | Data processing method and device |
CN114398856A (en) * | 2022-01-19 | 2022-04-26 | 广州启辰电子科技有限公司 | Image-text coding method based on depth decoupling frame |
Also Published As
Publication number | Publication date |
---|---|
CN111274950B (en) | 2023-09-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101783788B (en) | 2014-09-03 | File compression method, file compression device, file decompression method, file decompression device, compressed file searching method and compressed file searching device |
US7365658B2 (en) | 2008-04-29 | Method and apparatus for lossless run-length data encoding |
JP3278297B2 (en) | 2002-04-30 | Data compression method, data decompression method, data compression device, and data decompression device |
EP1147612B1 (en) | 2004-04-21 | Code book construction for variable to variable length entropy encoding |
JP6242074B2 (en) | 2017-12-06 | Method and apparatus for signal data compression and decompression (signal data compression and decompression) |
US20110181448A1 (en) | 2011-07-28 | Lossless compression |
CN112332853B (en) | 2022-06-03 | Time sequence data compression and recovery method based on power system |
EP2455853A2 (en) | 2012-05-23 | Data compression method |
CN116521093B (en) | 2023-09-15 | Smart community face data storage method and system |
CN111274950B (en) | 2023-09-05 | Feature vector data encoding and decoding method, server and terminal |
CN116805537B (en) | 2023-11-07 | Data processing method for heart-lung rehabilitation management system |
CN114614829B (en) | 2024-12-31 | Satellite data frame processing method, device, electronic device and readable storage medium |
US6748520B1 (en) | 2004-06-08 | System and method for compressing and decompressing a binary code image |
CN116614139A (en) | 2023-08-18 | User transaction information compression storage method in wine selling applet |
CN111918071A (en) | 2020-11-10 | Data compression method, device, equipment and storage medium |
JP6005273B2 (en) | 2016-10-12 | Data stream encoding method, transmission method, transmission method, encoding device for encoding data stream, transmission device, and transmission device |
CN102891730B (en) | 2015-04-22 | Method and device for encoding satellite short message based on binary coded decimal (BCD) code |
Al-Bahadili et al. | 2010 | A bit-level text compression scheme based on the ACW algorithm |
CN115190182B (en) | 2024-01-19 | Data lossless compression method, device and equipment suitable for Beidou system |
Kieffer et al. | 2022 | Survey of grammar-based data structure compression |
CN118244993B (en) | 2024-08-20 | Data storage method, data processing method and device, electronic equipment and medium |
Sudhamsu et al. | 2024 | Efficient Lossless Data Compression Using Adaptive Arithmetic Coding |
Kaur et al. | 2015 | Lossless text data compression using modified Huffman Coding-A review |
CN118842474A (en) | 2024-10-25 | LZW coding-based data compression method |
Prasetyo et al. | 2017 | Comparison of Text Data Compression Using Run Length Encoding, Arithmetic Encoding, Punctured Elias Code and Goldbach Code |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
2020-06-12 | PB01 | Publication | |
2020-06-12 | PB01 | Publication | |
2020-07-07 | SE01 | Entry into force of request for substantive examination | |
2020-07-07 | SE01 | Entry into force of request for substantive examination | |
2023-07-28 | CB02 | Change of applicant information |
Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11 Applicant after: Qingdao Hisense Mobile Communication Technology Co.,Ltd. Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11 Applicant before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd. |
2023-07-28 | CB02 | Change of applicant information | |
2023-09-05 | GR01 | Patent grant | |
2023-09-05 | GR01 | Patent grant |