CN108123721B - Encoding method and device - Google Patents

Encoding method and device Download PDF

Info

Publication number
CN108123721B
CN108123721B CN201611073831.7A CN201611073831A CN108123721B CN 108123721 B CN108123721 B CN 108123721B CN 201611073831 A CN201611073831 A CN 201611073831A CN 108123721 B CN108123721 B CN 108123721B
Authority
CN
China
Prior art keywords
character
characters
basic
version
prefix
Prior art date
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.)
Active
Application number
CN201611073831.7A
Other languages
Chinese (zh)
Other versions
CN108123721A (en
Inventor
许丰
吕和胜
于永庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
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 Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN201611073831.7A priority Critical patent/CN108123721B/en
Publication of CN108123721A publication Critical patent/CN108123721A/en
Application granted granted Critical
Publication of CN108123721B publication Critical patent/CN108123721B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H03M7/3084Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method
    • H03M7/3088Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction using adaptive string matching, e.g. the Lempel-Ziv method employing the use of a dictionary, e.g. LZ78

Landscapes

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

Abstract

An encoding method and apparatus, the method comprising the steps of: acquiring universal characters which can be identified by a plurality of communication systems according to the plurality of communication systems for transmitting data to be transmitted; selecting at least one part of the general characters as basic characters, and constructing different code words based on the basic characters to obtain a code library, wherein the different code words correspond to different characters; and encoding the data to be transmitted by utilizing the code library. The embodiment of the invention can ensure that the receiver correctly identifies the characters in the received code words without ambiguity, and further stores the received information, thereby improving the communication efficiency.

Description

Encoding method and device
Technical Field
The present invention relates to the field of communications, and in particular, to a coding method and apparatus.
Background
At present, each communication system has a specific coding rule, for example, a mail system adopts Base64 coding, a website protocol adopts Http coding, a short message adopts mobile communication coding standard, and the like, although a binary coding and decoding mode can be adopted to convert code words of each system into binary bit streams, and then physical layer transmission is performed to other systems, a receiver is likely to be unable to correctly identify characters in received code words, which results in communication failure. Specifically, a plurality of characters have different binary bit streams corresponding to the characters in different systems, and the meanings of many characters in different systems are different, so that when a receiving party receives the binary bit stream carrying transmission information, the receiving party may identify the ambiguous characters incorrectly to cause communication failure: for example, the instruction obtained by error recognition is decoded by error, thereby causing error operation; or stopping decoding because the code word obtained by error identification does not accord with the preset rule of the receiving party. In the above case, the receiving party does not normally save the received information.
In the prior art, in order to enable a receiver to correctly identify characters in a codeword, a decoding library needs to be prepared and sent in advance according to different coding standards of the sender and the receiver, so that the opposite side can correctly identify the codeword and smoothly decode the codeword through code conversion after loading a plug-in or installing macro application. However, if the decoding banks are transmitted simultaneously for each transmission, bandwidth is wasted seriously; if the decoding library is transmitted after the communication fails due to the recognition error of the receiving party, the transmission time and transmission resource for the first transmission are wasted, and the communication efficiency is reduced.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a coding method and a coding device, which can enable a receiver to correctly identify characters in received code words without ambiguity, and further store received information, thereby improving communication efficiency.
To solve the above technical problem, an embodiment of the present invention provides an encoding method, including the following steps: acquiring universal characters which can be identified by a plurality of communication systems according to the plurality of communication systems for transmitting data to be transmitted; selecting at least one part of the general characters as basic characters, and constructing different code words based on the basic characters to obtain a code library, wherein the different code words correspond to different characters; and encoding the data to be transmitted by utilizing the code library.
Optionally, the universal characters are selected from arabic numerals and english capital and lower case letters.
Optionally, the constructing mutually different code words based on the basic characters includes: selecting the basic characters to form different code words, wherein each code word comprises 3 basic characters; wherein the total number of the basic characters is greater than or equal to 41.
Optionally, the basic character includes: 1. 2, 3, 4, 5, 6, 7, 8, 9, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, Z, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, Z.
Optionally, encoding the data to be transmitted by using the code library includes: replacing characters in the data to be transmitted with corresponding code words to generate one or more coded character strings; at least one general character except the basic character is selected from the general characters as a prefix character and is arranged in front of each code character string.
Optionally, the encoding method further includes: and selecting at least one general character other than the basic character and the prefix character from the general characters to be used as a version character, wherein the version character is arranged between the prefix character and the coding character string.
Optionally, a version number is set between the version character and the prefix character.
Optionally, the encoding method further includes: selecting at least one general character other than the basic character, the prefix character and the version character among the general characters as a length character, and the length character is interposed between the version character and the encoded character string.
Optionally, the length of the encoded string is set between the length character and the version character.
Optionally, the encoding method further includes: selecting at least one general character other than the basic character and the prefix character among the general characters as a length character, and the length character is interposed between the prefix character and the code string.
Optionally, the length of the encoded string is set between the length character and the prefix character.
To solve the above technical problem, an embodiment of the present invention provides an encoding apparatus, including: the device comprises an acquisition module, a display module and a control module, wherein the acquisition module is suitable for acquiring universal characters which can be identified by a plurality of communication systems according to the plurality of communication systems for transmitting data to be transmitted; the construction module is suitable for selecting at least one part of the general characters as basic characters, and constructing different code words based on the basic characters to obtain a code library, wherein the different code words correspond to different characters; and the coding module is suitable for coding the data to be transmitted by utilizing the code library.
Optionally, the universal characters are selected from arabic numerals and english capital and lower case letters.
Optionally, the building module includes: the construction submodule is suitable for selecting the basic characters to form different code words, and each code word comprises 3 basic characters; wherein the total number of the basic characters is greater than or equal to 41.
Optionally, the basic character includes: 1. 2, 3, 4, 5, 6, 7, 8, 9, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, Z, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, Z.
Optionally, the encoding module includes: the substitution submodule is suitable for substituting characters in the data to be transmitted into corresponding code words so as to generate one or more coding character strings; and the prefix placement sub-module is suitable for selecting at least one universal character except the basic character from the universal characters as a prefix character and placing the prefix character in front of each code character string.
Optionally, the encoding apparatus further includes: and the version placement module is suitable for selecting at least one general character except the basic character and the prefix character from the general characters to be used as a version character, and the version character is placed between the prefix character and the coding character string.
Optionally, a version number is set between the version character and the prefix character.
Optionally, the encoding apparatus further includes: a first length placement module adapted to select at least one general character other than the basic character, the prefix character, and the version character among the general characters as a length character, and the length character is placed between the version character and the encoded character string.
Optionally, the length of the encoded string is set between the length character and the version character.
Optionally, the encoding apparatus further includes: a second length placement module adapted to select at least one general character other than the basic character and the prefix character among the general characters as a length character and the length character is placed between the prefix character and the encoded character string.
Optionally, the length of the encoded string is set between the length character and the prefix character.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides an encoding method, which comprises the following steps: acquiring universal characters which can be identified by a plurality of communication systems according to the plurality of communication systems for transmitting data to be transmitted; selecting at least one part of the general characters as basic characters, and constructing different code words based on the basic characters to obtain a code library, wherein the different code words correspond to different characters; and encoding the data to be transmitted by utilizing the code library. The embodiment of the invention adopts the characters which can be identified by both the sender and the receiver to construct the code word transmission information, so that the receiver can correctly identify the characters in the received code words without ambiguity, and further can still store the received characters under the condition that the code words cannot be decoded without repeatedly sending information by the sender, thereby improving the communication efficiency.
Further, by adopting the embodiment of the invention, the total number of the code words in the code library can cover the total number of the states of the binary number of two bytes by selecting more than or equal to 41 basic characters, so that the code words formed by the least basic characters are adopted to replace the binary number of the same number, and the communication efficiency is further improved.
Further, in the embodiment of the present invention, from general characters selected from arabic numbers and english upper and lower case letters compatible with a plurality of communication systems, characters which are easy to be confused with each other and characters which are most frequently appeared in texts are filtered out, 41 preferable basic characters are obtained, and the error rate of manual input can be reduced by forming codewords from the basic characters.
Further, in the embodiments of the present invention, a general character other than the basic character is selected from the general characters as a prefix character, and is placed before one or more encoded character strings, which may be used to identify an initial position of the encoded character string, so that when a transmission error occurs, for example, when at least one codeword in the obtained encoded character string is an incomplete codeword, the erroneous encoded character string may be skipped, and reception may be started from a position of a next prefix character.
Further, in the embodiment of the present invention, the general characters other than the basic character and the prefix character are selected from the general characters as version characters, and are placed between the prefix character and the code character string, so that a receiving party can distinguish different encryption algorithm versions or verification algorithm versions, thereby improving the transmission security and confidentiality.
Further, in the embodiment of the present invention, the general characters other than the basic character, the prefix character and the version character are selected from the general characters as length characters and are placed between the version character and the encoded character string, so that a receiving party can distinguish whether transmission is complete according to the length of the received encoded character string, and the integrity of transmission is improved.
Drawings
FIG. 1 is a flow chart of an encoding method in an embodiment of the present invention;
FIG. 2 is a flowchart of one specific implementation of step S13 in FIG. 1;
FIG. 3 is a schematic structural diagram of an encoding apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an implementation of the encoding module 33 in fig. 3.
Detailed Description
As mentioned above, each communication system has a specific encoding rule, and there is a high possibility that the receiving party cannot correctly identify the characters in the received code word, which results in communication failure. In the prior art, in order to enable a receiver to correctly identify characters in a code word, a decoding library needs to be prepared and sent in advance according to different coding standards of the sender and the receiver, so that the opposite side can correctly identify and successfully decode through code conversion after loading a plug-in or installing macro application, but if the decoding library is sent at the same time for each transmission, bandwidth is seriously wasted; if the decoding library is transmitted after the communication fails due to the identification error of the receiving party, the transmission time and transmission resource of the first transmission are wasted, and the communication efficiency is reduced.
The inventor of the present invention has found through analysis that the key of the above problem is that a plurality of ambiguous characters exist between different systems, when the characters are used to construct a codeword and transmit the codeword, the result of the recognition of the ambiguous characters by the receiver is often different from that of the sender, and in order to avoid the receiver from recognizing the ambiguous characters incorrectly, the sender should construct the codeword by using the characters which can be recognized unambiguously by both the sender and the receiver to transmit information. For example, when the receiving party is an Http system, after receiving the character "/", the character "/" is used as an identifier of a domain name, and then the character "/" is filtered out during decoding, so that information carried by the character cannot be transmitted to the receiving party. In order to avoid the above errors, the sender should replace the character "/" with other unambiguous characters to construct a codeword, and then transmit the codeword.
The embodiment of the invention provides an encoding method, which comprises the following steps: acquiring universal characters which can be identified by a plurality of communication systems according to the plurality of communication systems for transmitting data to be transmitted; selecting at least one part of the general characters as basic characters, and constructing different code words based on the basic characters to obtain a code library, wherein the different code words correspond to different characters; and encoding the data to be transmitted by utilizing the code library. The embodiment of the invention adopts the characters which can be unambiguously identified by both the sender and the receiver to construct the code word transmission information, so that the receiver can correctly identify the characters in the received code words without ambiguity, the received characters can be stored under the condition that the code words cannot be decoded, and the sender does not need to repeatedly send information, thereby improving the communication efficiency.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Fig. 1 is a flowchart of an encoding method according to an embodiment of the present invention, where the encoding method may include steps S11 to S13:
step S11: according to a plurality of communication systems for transmitting data to be transmitted, obtaining universal characters which can be identified by the communication systems.
Step S12: and selecting at least one part of the general characters as basic characters, and constructing different code words based on the basic characters to obtain a code library, wherein the different code words correspond to different characters.
Step S13: and encoding the data to be transmitted by utilizing the code library.
In the specific implementation of step S11, the common character that can be recognized by each of the plurality of communication systems may be, for example, that the encoding manner of the common character converted into the binary bit stream by the plurality of communication systems is the same, that is, the same common character has the same binary bit stream in the plurality of communication systems, and the common character is not given a special meaning in any of the plurality of communication systems.
Specifically, according to the communication system to which the sender and the receiver for transmitting the data to be transmitted belong, a character intersection is selected from the character sets of the two communication systems, and the condition that the same character has different meanings is eliminated from the character intersection, so that the universal character in the two systems is obtained.
Further, when a third communication system is required to be added as a sending party or a receiving party, universal characters in the three communication systems can be further selected by combining the character set of the third communication system on the basis of the character intersection.
Preferably, the common characters that can be identified by the plurality of communication systems can be selected based on the plurality of commonly used communication systems, so that the code words constructed by the common characters can be used for transmission no matter which communication system the sender and the receiver transmitting the data to be transmitted belong to, and the common characters do not need to be selected again. Specifically, the intersection of all code characters which simultaneously accord with the website coding rule, the two-dimensional code coding rule, the mail coding rule and the short message coding rule can be selected from printable ASCII characters to form a unified code character set which can adapt to manual input, printing, website parameter transmission, two-dimensional code coding, mail transmission and short message transmission.
Among them, American Standard Code for Information Interchange (ASCII) is the most common single-byte coding system in today, and uses a 7-bit binary bit stream (the remaining 1-bit binary is 0) to represent upper and lower case letters in english, arabic numerals 0 to 9, punctuation marks, and special control characters used in American english.
In the process of selecting ASCII characters, English capital and lower case letters and Arabic numerals 0 to 9 can be regarded as universal characters which can be recognized in each communication system without ambiguity, namely, after any character is converted into binary bit stream through the coding mode of a sender and is transmitted to a receiver belonging to another communication system, the receiver can still convert the received binary bit stream into the character but not other characters through the coding mode of the receiver, so that correct recognition is realized.
In a specific implementation of step S12, at least a portion of the common characters are selected as basic characters, and different code words are constructed based on the basic characters to obtain a code library, where the different code words correspond to different characters.
The code words for carrying the information to be transmitted are constructed from basic characters, and different code words correspond to different characters. Specifically, the code word may include one basic character or may include a plurality of basic characters, and the code word is distinguishable from the code word.
In a specific implementation, in order to convert the code words in the code library into binary bit streams and further realize the transmission of the physical layer, the code words should be implemented to cover one-byte or two-byte binary numbers during encoding, so that each binary number can be replaced by a different code word.
It will be appreciated that each codeword cannot include too few base characters, because the fewer base characters each codeword includes, the more codewords are required to cover the same content. Specifically, when each codeword includes one basic character, 256 codewords are required to cover the total number of states of a binary number of one byte, that is, 256 states of an 8-bit binary number, and further, 256 × 256 to 65536 codewords are required to cover the total number of states of a binary number of two bytes, that is, 65536 states of a 16-bit binary number. When each codeword includes two basic characters, 16 codewords are required to cover the total number of states of a binary number of one byte, and 256 codewords are required to cover the total number of states of a binary number of two bytes. When each codeword includes three basic characters, 7 codewords are required to cover the total number of states of a binary number of one byte, i.e., 7 × 343>256, and 41 codewords are required to cover the total number of states of a binary number of two bytes, i.e., 41 × 68921> 65536.
In particular implementations, codewords may be constructed based on the case where each codeword includes two basic characters to cover a one-byte binary number, or where each codeword includes more than three basic characters. As mentioned above, in order to achieve unambiguous identification in each communication system, the universal characters are selected from 62 characters, which are english capital and lower case letters, and arabic numerals 0 to 9. I.e. the selectable range of basic characters is 62 general characters.
It will be appreciated that each codeword cannot include too many basic characters, because the more basic characters each codeword includes, the more transmission resources are occupied by transmitting each character of the data to be transmitted.
Preferably, mutually different code words can be constructed with 41 or more elementary characters, each of which comprises 3 of said elementary characters, which can cover the total number of states of a binary number of two bytes. Corresponding to a binary number covering one byte with 1.5 elementary characters, the transmission resources occupied are less than that in the case where each codeword comprises 2 elementary characters, the binary number covering one byte with 2 elementary characters.
By adopting the embodiment of the invention, the total number of the code words in the code library can cover the total number of the states of the binary number of two bytes by selecting more than or equal to 41 basic characters, thereby realizing that the code words formed by the least basic characters are adopted to replace the binary number of the same number, and further improving the communication efficiency.
More preferably, the 41 preferred basic characters obtained by filtering out the most frequently occurring characters in the characters and texts which are easy to be confused with each other from the universal characters selected from the arabic numerals and the english upper and lower case letters compatible with a plurality of communication systems include: 1. 2, 3, 4, 5, 6, 7, 8, 9, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, Z, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, Z. The use of the preferred elementary characters to construct codewords reduces the error rate of manual entry.
In a specific implementation of step S13, the data to be transmitted is encoded using the code library.
Referring to fig. 2, as step S13 in fig. 1 is further described below, the step of encoding the data to be transmitted by using the code library may include steps S21 to S24.
Step S21: and replacing characters in the data to be transmitted with corresponding code words to generate one or more coded character strings.
Step S22: selecting a universal character as a prefix character and placing the universal character in front of each code character string.
Step S23: the universal character is selected as a version character and is arranged between the prefix character and the code character string.
Step S24: the universal character is selected as a length character and is placed between the version character and the encoding string.
In a specific implementation of step S21, characters in the data to be transmitted are replaced with corresponding code words to generate one or more encoded character strings. Taking as an example that each codeword includes 3 basic characters, if the characters in the data to be transmitted are m, where m is a positive integer. The characters in the data to be transmitted will be replaced by a coded string comprising m code words, i.e. comprising 3m basic characters. The encoding string may be in one or more forms.
In a specific implementation of step S22, at least one general character other than the basic character, for example, T, is selected as a prefix character among the general characters and placed before the encoding string. I.e. T represents the starting position of the code string, if there are a plurality of code strings, each code string may be preceded by a prefix character T.
It should be noted that T may also be set only before a part of the code string, even only before the first code string, to achieve the effect of indicating the start position of the code string.
The embodiment of the invention selects general characters except the basic characters from the general characters as prefix characters, and the general characters are arranged in front of one or more code character strings and can be used for identifying the initial position of the code character strings, so that when transmission errors occur, if at least one code word in the obtained code character strings is an incomplete code word, the wrong code character strings can be skipped, and the receiving is started from the position of the next prefix character. Specifically, each codeword in the encoded string includes 3 basic characters, and if the number of basic characters included in the encoded string is not divisible by 3, it may be determined that the transmission is an error, and at least one codeword is an incomplete codeword.
In a specific implementation of step S23, at least one general character other than the basic character and the prefix character, for example, N, is selected as a version character from the general characters, and the version character is interposed between the prefix character and the encoding string. That is, N represents the version information of the encoded character string, and if there are a plurality of encoded character strings, N may exist between each encoded character string and the corresponding prefix character T.
It should be noted that the version character N may also be set only between a part of the encoded character string and the corresponding prefix character T, or even only between the first encoded character string and the corresponding prefix character T, so as to achieve the effect of indicating the version information of the encoded character string.
Wherein the version information may include an encryption mode or a verification mode. The positions of all characters in the coded character string can be replaced by adopting an encryption mode, so that the safety of data transmission is enhanced. The data transmitted by the coded character string can be corrected by adopting a check mode, so that the accuracy of data transmission is enhanced.
Further, when the version information is in an encryption mode, for example, there are two cases of encryption or no encryption, it may be set that adding N indicates that there is encryption, and not adding N indicates that there is no encryption. Similarly, when the version information is in the check mode, N may be added to indicate that there is check, and N is not added to indicate that there is no check.
Furthermore, when the version information is more and is not full enough represented by only one character, a version number can be set between the version character and the prefix character. The version number may be represented by numbers, letters or other symbols, and the version character N may be regarded as an end character of the version number, and is used to represent that the information between the prefix character and the version character is related to the version number. For example, when the version character indicates the encryption mode, the available encryption algorithms are numbered, and if a symmetric encryption algorithm is set to be 01 and an asymmetric encryption algorithm is set to be 02, 01N may be added between the prefix character and the code character string when the symmetric encryption algorithm is used, and 02N may be added between the prefix character and the code character string when the asymmetric encryption algorithm is used. And numbering the adopted encryption algorithms when the version characters represent the check mode, wherein aN aN can be added between the prefix characters and the code character strings when the hash algorithm is set as a and a parity check algorithm is set as b, and a bN can be added between the prefix characters and the code character strings when the parity check algorithm is adopted.
It should be noted that, the embodiment of the present invention does not limit the selection of the encryption algorithm and the verification algorithm.
In a specific implementation, it may be pre-indicated in a protocol manner whether the version character is preceded by a version number, in each case with the meaning of the version number, to ensure that the sender and receiver understand the same for the version character.
The embodiment of the invention selects the general characters except the basic characters and the prefix characters from the general characters as version characters, and the general characters are arranged between the prefix characters and the coding character strings and used for enabling a receiver to distinguish different encryption algorithm versions or verification algorithm versions, thereby improving the transmission safety and confidentiality.
In a specific implementation of step S24, at least one general character other than the basic character, the prefix character, and the version character, for example, L, is selected as a length character among the general characters, and the length character is interposed between the version character and the encoding string. That is, L represents the length of the encoded string, and if there are a plurality of encoded strings, L may exist between each encoded string and the corresponding version character N.
It should be noted that the length character L may also be set only between a part of the code string and the corresponding version character N, or even only between the first code string and the corresponding version character N, so as to achieve the effect of indicating the length of the code string.
Further, when the length of the encoded string is fixed or not fixed, it may be set that adding L indicates that the length of the encoded string is fixed, for example, each encoded string is 300 codewords; not adding L means that the length of the code string is not fixed.
Furthermore, when the length of the code string varies a lot and cannot be represented by only one character, the length of the code string may be set between the length character and the version character. The version number may be represented by numbers, letters or other symbols, and the length character L may be regarded as a length ending character for indicating that the information between the version character and the length character is related content of the length. For example, when the length of the encoded string is 999, 999L may be added between the length character and the version character.
In another specific implementation of the embodiment of the present invention, only the prefix character and the length character may be set, and the version character is not set, and the length character may be placed between the prefix character and the encoding character string. Further, the length of the code string may also be set between the length character and the prefix character.
In the embodiment of the invention, the general characters except the basic character, the prefix character and the version character are selected from the general characters as length characters and are arranged between the version character and the coding character string, so that a receiver can distinguish whether the transmission is complete or not according to the length of the received coding character string, and the integrity of the transmission is improved.
Fig. 3 is a schematic structural diagram of an encoding apparatus according to an embodiment of the present invention. The encoding apparatus may include: an acquisition module 31, a construction module 32, an encoding module 33, a version placement module 34, a first length placement module 35, and a second length placement module 36.
The obtaining module 31 is adapted to obtain, according to a plurality of communication systems used for transmitting data to be transmitted, common characters that can be recognized by the plurality of communication systems. The construction module 32 is adapted to select at least a part of the general characters as basic characters, and construct different codewords based on the basic characters to obtain a code library, where the different codewords correspond to different characters. The encoding module 33 is adapted to encode the data to be transmitted by using the code library. The version placement module 34 is adapted to select at least one general character other than the basic character and the prefix character among the general characters as a version character, and the version character is placed between the prefix character and the encoding character string. The first length placement module 35 is adapted to select at least one general character other than the basic character, the prefix character, and the version character among the general characters as a length character, and the length character is placed between the version character and the code string. The second length placement module 36 is adapted to select at least one general character other than the basic character and the prefix character among the general characters as a length character and the length character is placed between the prefix character and the encoding character string.
Further, the building module 32 may include: a construction submodule (not shown) adapted to select said basic characters to form codewords different from each other, each codeword comprising 3 of said basic characters; wherein the total number of the basic characters is greater than or equal to 41.
Referring to fig. 4, the encoding module 33 is further described below, and the encoding module 33 may include: a replace sub-module 331 and a prefix place sub-module 332. The replacing sub-module 331 is adapted to replace characters in the data to be transmitted with corresponding code words to generate one or more encoded character strings. The prefix placement sub-module 332 is adapted to select at least one general character other than the basic character from the general characters as a prefix character and place the prefix character in front of each of the code strings.
For more details of the encoding apparatus, please refer to fig. 1 to fig. 2 and refer to the related description of the encoding method, which is not repeated herein.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer-readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (16)

1. A method of encoding, comprising the steps of:
acquiring universal characters which can be identified by a plurality of communication systems according to the plurality of communication systems for transmitting data to be transmitted;
selecting at least one part of the general characters as basic characters, and constructing different code words based on the basic characters to obtain a code library, wherein the different code words correspond to different characters;
encoding the data to be transmitted by utilizing the code library;
wherein encoding the data to be transmitted using the code library comprises:
replacing characters in the data to be transmitted with corresponding code words to generate one or more coded character strings;
selecting at least one general character except the basic character from the general characters as a prefix character, and placing the general character in front of each code character string, and when a transmission error occurs, skipping the wrong code character string and starting to receive from the position of the next prefix character;
wherein the method further comprises:
selecting at least one general character other than the basic character and the prefix character from the general characters as a version character, wherein the version character is arranged between the prefix character and the coding character string;
a version number is set between the version character and the prefix character;
and the version character is an end character of the version number.
2. The encoding method of claim 1, wherein the universal characters are selected from the group consisting of arabic numerals and english capital and small letters.
3. The encoding method according to claim 1, wherein said constructing mutually different codewords based on the elementary characters comprises:
selecting the basic characters to form different code words, wherein each code word comprises 3 basic characters; wherein the total number of the basic characters is greater than or equal to 41.
4. The encoding method according to claim 3, wherein the elementary characters comprise: 1. 2, 3, 4, 5, 6, 7, 8, 9, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, Z, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, and Z.
5. The encoding method of claim 1, further comprising:
selecting at least one general character other than the basic character, the prefix character and the version character among the general characters as a length character, and the length character is interposed between the version character and the encoded character string.
6. The encoding method according to claim 5, wherein a length of the encoding string is set between the length character and the version character.
7. The encoding method of claim 1, further comprising:
selecting at least one general character other than the basic character and the prefix character among the general characters as a length character, and the length character is interposed between the prefix character and the code string.
8. The encoding method according to claim 7, wherein a length of the encoding string is set between the length character and the prefix character.
9. An encoding apparatus, comprising:
the device comprises an acquisition module, a display module and a control module, wherein the acquisition module is suitable for acquiring universal characters which can be identified by a plurality of communication systems according to the plurality of communication systems for transmitting data to be transmitted;
the construction module is suitable for selecting at least one part of the general characters as basic characters, and constructing different code words based on the basic characters to obtain a code library, wherein the different code words correspond to different characters;
the coding module is suitable for coding the data to be transmitted by utilizing the code library;
wherein the encoding module comprises:
the substitution submodule is suitable for substituting characters in the data to be transmitted into corresponding code words so as to generate one or more coding character strings;
a prefix placement sub-module, adapted to select at least one general character other than the basic character from the general characters as a prefix character, and place the prefix character in front of each of the encoded character strings, and further skip the encoded character string having an error when a transmission error occurs, and start receiving from a position of a next prefix character;
wherein the apparatus further comprises:
a version placement module adapted to select at least one general character other than the basic character and the prefix character among the general characters as a version character, and the version character is placed between the prefix character and the encoded character string;
a version number is set between the version character and the prefix character;
and the version character is an end character of the version number.
10. The encoding device of claim 9, wherein the universal characters are selected from the group consisting of arabic numerals and english capital and small letters.
11. The encoding apparatus of claim 9, wherein the construction module comprises:
the construction submodule is suitable for selecting the basic characters to form different code words, and each code word comprises 3 basic characters;
wherein the total number of the basic characters is greater than or equal to 41.
12. The encoding device according to claim 11, wherein the basic character comprises: 1. 2, 3, 4, 5, 6, 7, 8, 9, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, Z, B, D, F, G, H, J, K, M, P, Q, U, V, W, X, Y, and Z.
13. The encoding device according to claim 9, further comprising:
a first length placement module adapted to select at least one general character other than the basic character, the prefix character, and the version character among the general characters as a length character, and the length character is placed between the version character and the encoded character string.
14. The encoding device according to claim 13, wherein a length of the encoding string is provided between the length character and the version character.
15. The encoding device according to claim 9, further comprising:
a second length placement module adapted to select at least one general character other than the basic character and the prefix character among the general characters as a length character and the length character is placed between the prefix character and the encoded character string.
16. The encoding device according to claim 15, wherein a length of the encoding string is provided between the length character and the prefix character.
CN201611073831.7A 2016-11-29 2016-11-29 Encoding method and device Active CN108123721B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611073831.7A CN108123721B (en) 2016-11-29 2016-11-29 Encoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611073831.7A CN108123721B (en) 2016-11-29 2016-11-29 Encoding method and device

Publications (2)

Publication Number Publication Date
CN108123721A CN108123721A (en) 2018-06-05
CN108123721B true CN108123721B (en) 2022-01-11

Family

ID=62226847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611073831.7A Active CN108123721B (en) 2016-11-29 2016-11-29 Encoding method and device

Country Status (1)

Country Link
CN (1) CN108123721B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110290146B (en) * 2019-07-03 2021-10-08 北京达佳互联信息技术有限公司 Method and device for generating shared password, server and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120030375A1 (en) * 2010-07-29 2012-02-02 Sap Ag Codepage-independent binary encoding method
CN103092922A (en) * 2012-12-28 2013-05-08 国家计算机网络与信息安全管理中心 Post-coding automatic decoding method aiming at uniform resource locator (URL) comprising special characters
CN104156373A (en) * 2013-05-15 2014-11-19 宏碁股份有限公司 Coding format detection method and device
CN105450232A (en) * 2014-08-28 2016-03-30 华为技术有限公司 Encoding method, decoding method, encoding device and decoding device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5523144B2 (en) * 2010-02-25 2014-06-18 キヤノン株式会社 Information processing apparatus, control method thereof, program, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120030375A1 (en) * 2010-07-29 2012-02-02 Sap Ag Codepage-independent binary encoding method
CN103092922A (en) * 2012-12-28 2013-05-08 国家计算机网络与信息安全管理中心 Post-coding automatic decoding method aiming at uniform resource locator (URL) comprising special characters
CN104156373A (en) * 2013-05-15 2014-11-19 宏碁股份有限公司 Coding format detection method and device
CN105450232A (en) * 2014-08-28 2016-03-30 华为技术有限公司 Encoding method, decoding method, encoding device and decoding device

Also Published As

Publication number Publication date
CN108123721A (en) 2018-06-05

Similar Documents

Publication Publication Date Title
US8904258B2 (en) Modulation-forward error correction (MFEC) codes and methods of constructing and utilizing the same
US20100327066A1 (en) Network based reliable decoding of bar codes
CN108418683B (en) Carrier-free text steganography method based on Chinese character structural features
CN101840394B (en) Data decoding method
US8100339B2 (en) Preamble data generating method and related apparatus for quick response code
CN103036641B (en) Method for interchanging data, system and unserializing method
US11342945B2 (en) Method and apparatus for processing rate matching of polar codes
RU2009119746A (en) PROGRAMMING BEACON SYMBOLS
EP2482231A1 (en) Method for encoding and decoding data on a matrix code symbol
CN104065463B (en) Method and apparatus for handling response/non-acknowledgement field incidentally
CN114051006A (en) Data transmission method, data transmission device, computer equipment and storage medium
CN108123721B (en) Encoding method and device
JP5913748B2 (en) Secure and lossless data compression
EP2442256A1 (en) Method of encoding and decoding text on a matrix code symbol
CN103365814B (en) A kind of serial data transmission method and system thereof
CN100385887C (en) Method and device for coding, transmitting and decoding digital data
CN1321538C (en) Short message network address communication system based on two-dimensional bar code identification technology
CN108108267B (en) Data recovery method and device
CN1964200B (en) A method for coding and decoding of linear code expansion and data transmission method and device
CN114239779A (en) Data transmission method, transmission system, acquisition equipment and receiving equipment
CN107615839B (en) Method for processing sub-signaling segment, processing device, access point and station
CN107276719B (en) Number decimal number odd-even number identification method for communication system
US10742783B2 (en) Data transmitting apparatus, data receiving apparatus and method thereof having encoding or decoding functionalities
CN103944678B (en) Fountain-code encoding method with feedback and unequal error protection capacity
EP2113845A1 (en) Character conversion method and apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant