Movatterモバイル変換


[0]ホーム

URL:


CN114936539B - Text encoding and decoding method, device, equipment and medium - Google Patents

Text encoding and decoding method, device, equipment and medium
Download PDF

Info

Publication number
CN114936539B
CN114936539BCN202210751727.8ACN202210751727ACN114936539BCN 114936539 BCN114936539 BCN 114936539BCN 202210751727 ACN202210751727 ACN 202210751727ACN 114936539 BCN114936539 BCN 114936539B
Authority
CN
China
Prior art keywords
text
mapping table
target
coding
identifier
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
CN202210751727.8A
Other languages
Chinese (zh)
Other versions
CN114936539A (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.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology 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 Beijing Zitiao Network Technology Co LtdfiledCriticalBeijing Zitiao Network Technology Co Ltd
Priority to CN202210751727.8ApriorityCriticalpatent/CN114936539B/en
Publication of CN114936539ApublicationCriticalpatent/CN114936539A/en
Application grantedgrantedCritical
Publication of CN114936539BpublicationCriticalpatent/CN114936539B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The present disclosure relates to a text encoding and decoding method, apparatus, device, and medium. The text coding method includes the steps of obtaining a text to be coded and a plurality of preset mapping tables, wherein the preset mapping tables are generated based on reference mapping tables, the reference mapping tables are used for recording one-to-one correspondence between characters forming the text and first coding identifications, the preset mapping tables are used for recording one-to-one correspondence between information in the reference mapping tables and second coding identifications, based on first arrangement positions of target characters in the text to be coded and mapping table reference sequences, a first target mapping table corresponding to the target characters is determined from the preset mapping tables, the first target mapping table is queried based on the target characters, target coding identifications corresponding to the target characters are determined, and based on target coding identifications corresponding to the target characters in the text to be coded, the target coding text is generated. According to the embodiment of the disclosure, the text coding accuracy and safety are improved.

Description

Text encoding and decoding method, device, equipment and medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for encoding and decoding text.
Background
Text digitization or text encoding is a basic text encryption method in the field of data security.
In the prior art, text coding is mainly realized by a word segmentation and word list mode. In the encoding stage, firstly, a plurality of words separated by spaces are obtained after a text is segmented, then each word is converted into a corresponding encoding identifier (such as a number or a character) according to a pre-established word list, and words which are not recorded in the word list are uniformly converted into encoding identifiers of unknown words (UNK), so that the encoded text can be obtained. In the decoding stage, the coded identifiers in the coded text are converted into corresponding vocabularies according to the vocabulary, and the obtained vocabulary sequences are spliced together according to grammar rules, so that the decoded text can be obtained.
However, the above method has at least the problem that, on one hand, because word segmentation methods are different, required word lists are different, adapted languages are different, and adapted terminal devices are different, so that the above text encoding method is too dependent on the word segmentation methods. On the other hand, because spaces are inserted between the words after word segmentation, original space information in the text is lost, or words which are not in the word list are uniformly converted into coding marks of unknown words (UNK), and the like, the coding text is distorted.
Disclosure of Invention
In order to solve the technical problems that the text encoding process is too dependent on word segmentation methods and encoded text distortion, the present disclosure provides a text encoding and decoding method, device, equipment and medium.
In a first aspect, the present disclosure provides a text encoding method, the method comprising:
the method comprises the steps of obtaining a text to be coded and a plurality of preset mapping tables, wherein the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording a one-to-one correspondence between characters forming the text and first coding identifiers, and the preset mapping table is used for recording a one-to-one correspondence between information in the reference mapping table and second coding identifiers;
Determining a first target mapping table corresponding to the target character from each preset mapping table based on a first arrangement position of the target character in the text to be encoded and a mapping table reference sequence, and determining a target coding identifier corresponding to the target character based on the target character querying the first target mapping table;
And generating a target coding text based on the target coding identifier corresponding to each target character in the text to be coded.
In a second aspect, the present disclosure also provides a text decoding method, the method including:
The method comprises the steps of obtaining a text to be decoded and a plurality of preset mapping tables, wherein the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording a one-to-one correspondence between characters forming the text and first coding identifiers, and the preset mapping table is used for recording a one-to-one correspondence between information in the reference mapping table and second coding identifiers;
Determining a second target mapping table corresponding to the target coding identifier from each preset mapping table based on a third arrangement position of the target coding identifier in the text to be decoded and a mapping table reference sequence, and inquiring the second target mapping table based on the target coding identifier to determine a decoding character corresponding to the target coding identifier;
and generating target decoding text based on the decoding characters corresponding to the target coding identifiers in the text to be decoded.
In a third aspect, the present disclosure also provides a text encoding apparatus, including:
The system comprises a first information acquisition module, a first coding module and a second information acquisition module, wherein the first information acquisition module is used for acquiring a text to be coded and a plurality of preset mapping tables, the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording a one-to-one correspondence between characters forming the text and first coding identifications, and the preset mapping table is used for recording a one-to-one correspondence between information in the reference mapping table and second coding identifications;
the target coding identification determining module is used for determining a first target mapping table corresponding to the target character from the preset mapping tables based on a first arrangement position of the target character in the text to be coded and a mapping table reference sequence, inquiring the first target mapping table based on the target character and determining a target coding identification corresponding to the target character;
and the target code text generation module is used for generating a target code text based on the target code identifier corresponding to each target character in the text to be coded.
In a fourth aspect, the present disclosure also provides a text decoding device, including:
The system comprises a first information acquisition module, a second information acquisition module and a first information processing module, wherein the first information acquisition module is used for acquiring a text to be decoded and a plurality of preset mapping tables, the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording a one-to-one correspondence between characters forming the text and first coding identifiers, and the preset mapping table is used for recording a one-to-one correspondence between information in the reference mapping table and the second coding identifiers;
The decoding character determining module is used for determining a second target mapping table corresponding to the target coding identifier from all preset mapping tables based on a third arrangement position of the target coding identifier in the text to be decoded and a mapping table reference sequence, inquiring the second target mapping table based on the target coding identifier, and determining decoding characters corresponding to the target coding identifier;
And the target decoding text generation module is used for generating target decoding texts based on the decoding characters corresponding to the target coding identifiers in the texts to be decoded.
In a fifth aspect, the present disclosure provides an electronic device comprising:
A processor;
A memory for storing executable instructions;
The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the text encoding method or the text decoding method described in any embodiment of the present disclosure.
In a sixth aspect, the present disclosure provides a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to implement the text encoding method or the text decoding method described in any of the embodiments of the present disclosure.
According to the text coding and decoding method, device, equipment and medium, a plurality of preset mapping tables used for recording the one-to-one mapping relation between characters and coding identifications forming a text can be obtained according to the reference mapping tables in the related technology, the preset mapping tables used for adapting the characters to be coded (characters to be decoded) in the text to be coded (the text to be decoded) are selected from the preset mapping tables according to the mapping table reference sequence, the corresponding characters to be coded (the characters to be decoded) are mapped to the corresponding target coding identifications (the decoding characters) to obtain the target coding text (the decoding text), text coding and decoding are carried out by taking the characters as units, the word segmentation and the word list adapting to the word segmentation method are omitted, the text coding efficiency and the text coding accuracy are improved, and in addition, the preset mapping table used for each character is determined by the mapping table reference sequence, the text coding difficulty is improved to a certain extent, and the text coding safety is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Fig. 1 is a schematic flow chart of a text encoding method according to an embodiment of the disclosure;
fig. 2 is a schematic flow chart of a text decoding method according to an embodiment of the disclosure;
fig. 3 is a schematic structural diagram of a text encoding device according to an embodiment of the disclosure;
Fig. 4 is a schematic structural diagram of a text decoding device according to an embodiment of the present disclosure;
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment," another embodiment "means" at least one additional embodiment, "and" some embodiments "means" at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Fig. 1 shows a flowchart of a text encoding method according to an embodiment of the present disclosure.
The text coding method provided by the embodiment of the disclosure can be suitable for scenes such as digital conversion, text encryption, text compression and the like of texts. The method may be performed by a text encoding device, which may be implemented in software and/or hardware, which may be integrated in an electronic device having a certain computing capability. The electronic device may include, but is not limited to, mobile terminals such as smartphones, personal digital assistants (Personal DIGITAL ASSISTANT, PDA), tablet computers (Tablet Personal Computer, tablet PCs), notebook computers, PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), wearable devices, and the like, and stationary terminals such as digital televisions, desktop computers, servers, and the like.
As shown in fig. 1, the text encoding method may include the steps of:
And S110, acquiring a text to be encoded and a plurality of preset mapping tables, wherein the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording the one-to-one correspondence between characters forming the text and the first coding identifier, and the preset mapping table is used for recording the one-to-one correspondence between information in the reference mapping table and the second coding identifier.
The text to be encoded is a text to be encoded, which may be a sentence of text, a section of text or an entire article. The preset mapping table is a preset recording table for recording characters forming the text and corresponding coding marks. The characters herein may be words and symbols in any language, such as english letters, chinese characters, punctuation marks, special symbols, and the like.
In an embodiment of the disclosure, the preset mapping table is generated based on the reference mapping table, and is used for recording a one-to-one correspondence between information in the reference mapping table and the second coding identifier. The preset mapping table is obtained by processing information contained in the reference mapping table, and the second code identifier is the code identifier obtained by processing. The reference mapping table is a recording table for character encoding in the related art, such as a us information interchange standard code (AMERICAN STANDARD Code for Information Interchange, ASCII) lookup table, a kanji code character set GBK encoding table, a Unicode character list, a UTF-8 encoding table, etc., which is used to record a one-to-one correspondence between characters constituting text and a first code identifier. The first coded identification is a coded identification in a reference map.
In one example, the reference mapping table is a Unicode character list. Then the first code is identified as the number in which the character corresponds. Thus, various characters in various languages can be ensured to be corresponding to the code marks, and the situation that certain characters cannot determine the code marks is avoided.
Specifically, the electronic device may obtain the text to be encoded corresponding to the instruction according to the instruction related to text processing, such as a text transmission instruction, a text encryption instruction, a text compression instruction, and so on. In addition, the electronic device reads a plurality of preset mapping tables from the local storage space or the external storage medium, or the electronic device pulls a plurality of preset mapping tables from the network end so as to encode the text to be encoded.
In some embodiments, the step S110 of obtaining the preset mapping table includes performing random sorting or random number operation on each first code identifier included in the reference mapping table to obtain each second code identifier, and generating the preset mapping table based on information included in the reference mapping table and each second code identifier.
Wherein the information contained in the reference mapping table comprises each character and/or each first code identifier in the reference mapping table.
Specifically, the processing manner of the electronic device to generate each preset mapping table according to the reference mapping table may be to perform a certain degree of transformation processing on each first coding identifier included in the reference mapping table, so as to obtain a set of new coding identifiers. For example, the electronic device performs a random ordering process on each first code identifier, for example, calls a random. For another example, the electronic device may perform a random number operation on each of the first code identifiers to obtain a corresponding new code identifier, or may obtain each second code identifier. Then, the electronic device may form a preset mapping table from each character and each second code identifier included in the reference mapping table. Or the electronic device may form the preset mapping table from each first code identifier and each second code identifier included in the reference mapping table.
In some embodiments, the number of preset mapping tables is greater than or equal to the cardinality of the count system of the mapping table reference sequence. The mapping table reference sequence in the embodiment of the present disclosure is a number sequence for identifying the order of use of the respective preset mapping tables. The digits in the digit sequence at least cover the mapping table identification of each preset mapping table, and the mapping table identification is expressed by a certain counting system. Therefore, the number of the preset mapping tables is larger than or equal to the base number of the counting system of the mapping table reference sequence, and the situation that the numbers in the mapping table reference sequence cannot correspond to the specific preset mapping table is avoided, so that the accuracy of text coding is further improved. For example, the count system of the mapping table reference sequence is hexadecimal, the base number is 16, and accordingly, the number of preset mapping tables is at least 16.
S120, determining a first target mapping table corresponding to the target character from all preset mapping tables based on a first arrangement position of the target character in the text to be encoded and a mapping table reference sequence, and querying the first target mapping table based on the target character to determine a target encoding identifier corresponding to the target character.
The target characters are characters which are contained in the text to be coded and need to be coded and converted. The first arrangement position is a character arrangement position of the target character in the text to be encoded. For example, the character arrangement position of the target character in the text to be encoded is 9 th word, and then the first arrangement position is 9. The first target mapping table is a preset mapping table screened from all preset mapping tables in the encoding process. The target coding identifier is a coding identifier of a target character determined from a preset mapping table.
Specifically, in order to improve text security, in the embodiment of the present disclosure, a plurality of preset mapping tables are adopted, and these preset mapping tables are not directly used in order according to the mapping table identifiers. Therefore, the electronic device can acquire the mapping table reference sequence after acquiring the text to be encoded and a plurality of preset mapping tables. The mapping table reference sequence may be a fixed number sequence predetermined after each mapping table identifier is determined, or a temporary number sequence obtained by periodically performing certain change on the fixed number sequence according to a certain rule, or a text customized number sequence generated according to related information in a text to be encoded.
In particular implementations, the electronic device may perform the same encoding process for the target character in the text to be encoded. The target character herein may be determined according to a predetermined encoding rule. For example, the target character may be a character having a certain character interval in the text to be encoded, or the target character may be each character in the text to be encoded.
The encoding process may be to first determine a first arrangement position of the target character in the text to be encoded. And then, the mapping table reference sequence is queried according to the first arrangement position, and the corresponding mapping table identification (namely the first mapping table identification) in the mapping table reference sequence is obtained. Then, a first target mapping table is located according to the first mapping table identification. And finally, inquiring the first target mapping table according to the target character to obtain a target coding identifier.
It should be noted that, if the first target mapping table records a one-to-one correspondence between the characters and the second code identifier, the electronic device may directly query the first target mapping table according to the target characters to obtain the target code identifier. If the first target mapping table records the one-to-one correspondence between the first coding identifier and the second coding identifier, the electronic device needs to query the reference mapping table according to the target character to determine the corresponding first coding identifier, and then query the first target mapping table according to the determined first coding identifier to obtain the corresponding target coding identifier.
In some embodiments, determining a first target mapping table corresponding to the target character from the preset mapping tables based on a first arrangement position of the target character in the text to be encoded and a mapping table reference sequence in S120 includes determining a second arrangement position based on the first arrangement position and a sequence length of the mapping table reference sequence, determining a first mapping table identifier at the second arrangement position from the mapping table reference sequence, and determining the preset mapping table corresponding to the first mapping table identifier as the first target mapping table.
The above process of determining the first target mapping table may be specifically implemented by the electronic device determining a first arrangement position offset of the target character in the text to be encoded. Then, the electronic device may perform modulo calculation on the first permutation position and the sequence length of the mapping table reference sequence, and take the obtained result as the second permutation position, so as to cycle use of the mapping table reference sequence in a case where the text length of the text to be encoded is greater than the sequence length of the mapping table reference sequence.
For example, if the mapping table refers to a hexadecimal string sequence "3617b3d66d38049664288366ce2ef9f8b9747883" with a sequence length of 40, and the electronic device determines that the first alignment position is 43, the first alignment position and the sequence length may be subjected to a modulo operation, that is, 43%40, to obtain a remainder 3, and then obtain a second alignment position of 3.
Then, the electronic device searches the mapping table reference sequence for the digital character at the second arrangement position 3 to obtain a first mapping table identifier "1". And then, the electronic equipment screens out preset mapping tables with the mapping table identification of 1 from the preset mapping tables according to the first mapping table identification of 1, and the preset mapping tables are used as first target mapping tables.
S130, generating a target coding text based on target coding identifiers corresponding to target characters in the text to be coded.
Specifically, according to the process of S120, the electronic device may obtain a target code identifier corresponding to each target character included in the text to be encoded. The electronic device may then generate target encoded text from the respective target encoding identifications according to the arrangement of each target character in the text to be encoded. And then, the electronic equipment can carry out a processing flow corresponding to the instruction on the target coded text according to the related instruction of text processing.
According to the text coding method, a plurality of preset mapping tables for recording the one-to-one mapping relation between characters forming a text and coding identifications can be obtained according to the reference mapping tables in the related technology, the preset mapping tables used for adapting the characters to be coded in the text to be coded are selected from the preset mapping tables according to the mapping table reference sequence, the corresponding characters to be coded are mapped to corresponding target coding identifications, the target coding text is obtained, text coding and decoding are carried out by taking the characters as units, the word segmentation and the process of constructing a word table adapted to the word segmentation method are saved, the problem that text coding depends on the word segmentation method and text distortion is avoided, the text coding efficiency and the text coding accuracy are improved, in addition, the preset mapping table used for each character is determined by the mapping table reference sequence, the difficulty of decoding the text coding is increased to a certain extent, and the text coding safety is improved.
In some embodiments, prior to S120, the text encoding method further includes determining a mapping table reference sequence based on the text to be encoded.
Specifically, in this embodiment, the electronic device may generate the mapping table reference sequence according to the related information of the text to be encoded. For example, hash operation is performed on the text to be encoded or attribute information thereof, and the result of the hash operation is used as a mapping table reference sequence. Therefore, the mapping table reference sequence of the text customization can be obtained, the same text is ensured to have the same mapping table reference sequence, and different texts are ensured to have different mapping table reference sequences, so that the coding consistency of the text is ensured, the coding result of the similar text cannot be cracked through differential analysis, further the coding cracking difficulty of the text is further increased, and the text security is further improved.
In other embodiments, prior to S120, the text encoding method further includes determining a mapping table reference sequence based on the text to be encoded and the encoding verification value.
Wherein the encoding check value is a check value used in the encoding stage, which is used at least to verify the validity of the text data. In the embodiment of the disclosure, the encoding check value is also used for generating the mapping table reference sequence so as to further increase the confidentiality of the mapping table reference sequence, thereby further improving the text security. In one example, the code check value may be a default value that is set in advance. In another example, the encoded check value may be a user identification. Therefore, different coded texts of the same text of different users can be ensured, user data are isolated, and confidentiality and safety of the user text data are further improved.
Specifically, in this embodiment, the electronic device may generate the mapping table reference sequence by using the related information of the text to be encoded and the encoding verification value together. For example, the electronic device may perform a process of combining first and then hashing the text to be encoded and the encoding verification value, a process of separately hashing and then combining first, a process of multi-layer hashing, or the like, and use the final result as a mapping table reference sequence.
In one example, the electronic device may hash text to be encoded, or a combination of text to be encoded and an encoding verification value, to generate a first text hash value, and generate a mapping table reference sequence based on the first text hash value and the encoding verification.
The first text hash value is a hash value corresponding to the text to be encoded.
Specifically, the electronic device may perform a hash operation on the text to be encoded first, and generate a result of the first hash operation, that is, a first text hash value. Or the electronic equipment firstly combines the text to be encoded and the encoding check value, such as splicing the encoding check value after the text to be encoded, and carries out hash operation on the combined result to obtain a first text hash value. Then, the electronic device combines the first text hash value and the code check value, and performs a secondary hash operation on the combined result, and the obtained hash value can be used as a mapping table reference sequence.
In another example, the electronic device may hash only a combination of the text to be encoded and the encoding verification value, resulting in a first text hash value, and reference the sequence with the first text hash value as a mapping table.
In yet another example, the electronic device may perform a hash operation on the text to be encoded or attribute information thereof to obtain a first text hash value, perform a hash operation on the encoding check value, then perform various post-processes such as addition and subtraction on the result of the two hash operations, and use the result obtained by the post-processes as a mapping table reference sequence.
In some embodiments, based on the embodiment of generating the mapping table reference sequence from the first text hash value and the encoding verification, S130 includes generating the target encoded text based on the target encoding identifier and the first text hash value corresponding to each target character in the text to be encoded.
Specifically, in the case that the mapping table reference sequence is generated by the first text hash value and the encoding verification, the mapping table reference sequence may not be shared, but the first text hash value is carried in the target encoding text, so as to further increase confidentiality of the mapping table reference sequence, further increase text cracking difficulty, and further improve text security.
For example, the electronic device generates initial code text corresponding to the text to be coded by each target code identifier. And then, the electronic equipment splices the first text hash value with the initial coded text to obtain the target coded text. Thus, after the target encoded text is obtained by the decoding party, the first text hash value can be obtained through the target encoded text, and then the mapping table reference sequence is generated according to the first text hash value in the manner of generating the mapping table reference sequence.
In other embodiments, based on the embodiment of generating the mapping table reference sequence from the first text hash value and the encoding verification, S130 includes generating the target encoded text based on the target encoding identifier, the first verification hash value, and the first text hash value corresponding to each target character in the text to be encoded.
The first check hash value is a hash value of the code check value, namely a hash value obtained by carrying out hash operation on the code check value.
Specifically, according to the above description, the electronic device may further splice the first check hash value with the initial encoded text when generating the target encoded text. Therefore, the decoding party can also obtain the first check hash value on the basis of self-generating the mapping table reference sequence, and perform validity verification on the target coded text according to the decoding check value which is stored in the decoding party and corresponds to the coding check value, so that the target coded text containing the offensiveness information can be prevented from attacking the decoding party, the decoding party can be protected safely, text data which does not belong to the decoding party can be prevented from being obtained by the decoding party, and the text data can be protected safely.
For example, the text to be encoded is "char1 char2 char3 char4", and the target encoded text "code1 code2 code3 code4 owner_id_ hashtext _hash" can be obtained through the processing procedure of the above embodiments. The owner_id_hash is a first check hash value, and the text_hash is a first text hash value.
Fig. 2 shows a flowchart of a text decoding method according to an embodiment of the present disclosure.
The text decoding method provided by the embodiment of the disclosure can be suitable for scenes such as digital conversion, text encryption, text compression and the like of the text. The method may be performed by a text decoding device, which may be implemented in software and/or hardware, which may be integrated in an electronic device having a certain computing capability. The electronic device may include, but is not limited to, mobile terminals such as smartphones, personal digital assistants (Personal DIGITAL ASSISTANT, PDA), tablet computers (Tablet Personal Computer, tablet PCs), notebook computers, PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), wearable devices, and the like, and stationary terminals such as digital televisions, desktop computers, servers, and the like.
As shown in fig. 2, the text decoding method may include the steps of:
and S210, acquiring a text to be decoded and a plurality of preset mapping tables, wherein the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording the one-to-one correspondence between characters forming the text and the first coding identifier, and the preset mapping table is used for recording the one-to-one correspondence between information in the reference mapping table and the second coding identifier.
Where the text to be decoded is the text that needs to be converted into readable characters. In the embodiment of the disclosure, the text to be decoded is the encoded text generated through the text encoding processing of the above embodiments.
Specifically, in the text decoding stage, the electronic device needs to acquire a plurality of preset mapping tables identical to those in the text encoding stage. And the electronic equipment can respond to the related instruction of text processing to obtain the text to be decoded.
S220, determining a second target mapping table corresponding to the target coding identifier from all preset mapping tables based on a third arrangement position of the target coding identifier in the text to be decoded and a mapping table reference sequence, and inquiring the second target mapping table based on the target coding identifier to determine a decoding character corresponding to the target coding identifier.
The target coding identifier is a coding identifier which is contained in a text to be decoded and needs decoding processing. The third permutation location is a permutation location of the target coding identifier in the text to be decoded. The second target mapping table is a preset mapping table screened from all preset mapping tables in the decoding process. The decoded character is a character in the text obtained after the text is decoded.
Specifically, according to the description of the various embodiments of text encoding described above, the electronic device will obtain the same sequence of map references during the decoding phase. In the case where the mapping table reference sequence is generated by the first text hash value and the encoding check, the electronic device may perform text decoding by itself generating the mapping table reference sequence with reference to the above-described process of generating the mapping table reference sequence, while in other cases the electronic device may perform text decoding by the shared mapping table reference sequence.
In particular implementations, the electronic device may perform the same decoding process for the target encoded identifier in the text to be decoded. The target code identifier here can likewise be determined according to a predetermined coding rule, and the determination of the target code identifier corresponds to the determination of the target character. For example, when the target character is a character with a certain character interval in the text to be encoded, the target coding identifier is a coding identifier with the same character interval in the text to be decoded, and when the target character is each character in the text to be encoded, the target coding identifier is each coding identifier in the text to be decoded.
The decoding process may be to first determine a third arrangement position of the target coding identifier in the text to be decoded. And then, the mapping table reference sequence is queried at a third arrangement position to obtain a corresponding mapping table identifier (namely a second mapping table identifier) in the mapping table reference sequence. Then, a second target mapping table is located according to the second mapping table identification. And finally, inquiring the second target mapping table according to the target coding identifier to obtain a corresponding decoding character.
It should be noted that if the one-to-one correspondence between the character and the second code identifier is recorded in the second target mapping table, the electronic device may directly query the second target mapping table according to the target code identifier to obtain the decoded character. If the one-to-one correspondence between the first coding identifier and the second coding identifier is recorded in the second target mapping table, the electronic device needs to query the second target mapping table according to the target coding identifier, determine the first coding identifier corresponding to the target coding identifier, and query the reference mapping table according to the determined first coding identifier to obtain the corresponding decoding character.
In some embodiments, determining the second target mapping table corresponding to the target coding identifier from each preset mapping table based on the third arrangement position of the target coding identifier in the text to be decoded and the mapping table reference sequence in S220 includes determining a fourth arrangement position based on the third arrangement position and the sequence length of the mapping table reference sequence, determining the second mapping table identifier at the fourth arrangement position from the mapping table reference sequence, and determining the preset mapping table corresponding to the second mapping table identifier as the second target mapping table.
The above process of determining the second target mapping table may be specifically implemented by the electronic device determining a third arrangement position offset of the target coding identifier in the text to be decoded. Then, the electronic device may perform modulo calculation on the third permutation position and the sequence length of the mapping table reference sequence, and take the result as the fourth permutation position, so as to cycle use of the mapping table reference sequence in a case where the text length of the text to be decoded is greater than the sequence length of the mapping table reference sequence.
For example, if the mapping table refers to a hexadecimal string sequence "3617b3d66d38049664288366ce2ef9f8b9747883" with a sequence length of 40, and the electronic device determines that the third alignment position is 51, the module operation may be performed on the third alignment position and the sequence length, that is, 51%40, to obtain a remainder 11, and then a fourth alignment position may be obtained as 11.
Then, the electronic device searches the mapping table reference sequence for the digital character at the fourth permutation position 11, resulting in the second mapping table identification "3". And then, the electronic equipment screens out preset mapping tables with the mapping table identification of 3 from the preset mapping tables according to the second mapping table identification of 3, and the preset mapping tables are used as second target mapping tables.
S230, generating target decoding text based on decoding characters corresponding to each target coding identifier in the text to be decoded.
Specifically, according to the process of S220, the electronic device may obtain a decoded character corresponding to each target code identifier included in the text to be decoded. The electronic device may then generate target decoded text from the decoded characters in accordance with the arrangement of each target code identifier in the text to be encoded.
According to the text decoding method, a plurality of preset mapping tables for recording the one-to-one mapping relation between characters forming a text and coding identifications can be obtained according to the reference mapping tables in the related technology, the preset mapping tables used for adapting the characters to be decoded in the text to be decoded are selected from the preset mapping tables according to the mapping table reference sequence, the corresponding characters to be decoded are mapped into corresponding decoding characters to obtain the decoded text, text coding and decoding are carried out by taking the characters as units, the word segmentation and the process of constructing a word table adapted to the word segmentation method are omitted, the problem that text coding depends on the word segmentation method and text distortion is avoided, the text coding efficiency and the text coding accuracy are improved, in addition, the preset mapping table used for each character is determined by the mapping table reference sequence, the difficulty of decoding the text coding is increased to a certain extent, and the text coding safety is improved.
In some embodiments, the text to be decoded further includes a first check hash value and/or a first text hash value.
The first check hash value is a hash value of the code check value. The encoded check value is a check value of the decoding stage, which is consistent with the encoded check value, and may be, for example, a user identification. The first text hash value is a hash value of the text to be encoded or a hash value of a combination of the text to be encoded and the encoding verification value.
Specifically, according to the description of the above embodiments, the text to be decoded may carry the first check hash value and/or the first text hash value.
In some embodiments, in the case that the text to be decoded includes the first check hash value, after S210, the text decoding method further includes performing a hash operation on the decoded check value to generate a second check hash value, determining that the decoding verification is successful in the case that the second check hash value and the first check hash value are determined to be equal, and triggering execution S220.
Specifically, in the case that the text to be decoded includes the first check hash value, the electronic device may perform validity verification on the text to be decoded according to the decoding check value.
The electronic equipment firstly carries out hash operation on the decoding check value by utilizing a hash algorithm for obtaining the first check hash value to obtain a second check hash value. The electronic device then compares the first check hash value with the second check hash value. If the comparison result is that the two are inconsistent, the fact that the encoding check value and the decoding check value are inconsistent is indicated, and then the fact that the text to be decoded does not belong to the text which needs to be decoded by the decoding party is indicated, and the text decoding flow is terminated. If the comparison result is that the two are consistent, the coding check value and the decoding check value are consistent, and then the text to be decoded belongs to legal data of a decoding party, namely the decoding check is successful. At this time, the subsequent procedure may be triggered to be executed, i.e., the execution of S220 may be triggered. Therefore, the method can avoid the attack of the text to be decoded containing the offensiveness information on the decoding party, realize the safety protection of the decoding party, and also avoid the decoding party from acquiring text data which does not belong to the text data and carry out the safety protection on the text data.
In some embodiments, where the first text hash value is included in the text to be decoded, the text decoding method further includes, prior to S220, generating a mapping table reference sequence based on the first text hash value and the decoding check value.
Specifically, if there is no shared mapping table reference sequence and the text to be decoded carries the first text hash value, then during decoding, the electronic device may generate the mapping table reference sequence using the first text hash value and the decoding check value according to the same process of generating the mapping table reference sequence in the above embodiments of text encoding. Thus, confidentiality of the mapping table reference sequence can be further ensured, decoding difficulty is further increased, and text security is further improved.
For example, the electronic device performs a hash operation on a combination of the first text hash value and the decoding check value using the same hash algorithm to generate the mapping table reference sequence.
In some embodiments, where the first text hash value is included in the text to be decoded, after S230, the text decoding method further includes hashing the target decoded text, or a combination of the target decoded text and the decoding verification value, to generate a second text hash value, and determining that the text decoding was successful if the second text hash value and the first text hash value are determined to be equal.
Specifically, referring to the above-mentioned process of generating the first text hash value, the electronic device may perform a hash operation on the target decoded text by using the same hash algorithm to generate the second text hash value, or the electronic device may perform a hash operation on a combination of the target decoded text and the decoding check value by using the same hash algorithm to obtain the second text hash value. The electronic device then compares the first text hash value with the second text hash value. If the comparison result is that the two are inconsistent, the error exists in the decoding process. In the case that the decoding verification is successful, the second target mapping table error determined according to the mapping table reference sequence may be detected and then re-decoded. If the comparison result is that the target decoded text and the text to be encoded are consistent, the target decoded text and the text to be encoded are correctly decoded.
The second text hash value generation process is identical to the first text hash value generation process. I.e. the first text hash value is generated only by the text to be encoded and the second text hash value is generated only by the target decoded text, and the first text hash value is generated by a combination of the text to be encoded and the encoding verification value and the second text hash value is generated by a combination of the target decoded text and the decoding verification value. Therefore, the algorithm consistency of the encoding process and the decoding process can be ensured, and decoding errors caused by inconsistent algorithms can be avoided.
The following are embodiments of a text encoding device provided by embodiments of the present disclosure, which belong to the same inventive concept as the text encoding method of the above embodiments, and reference may be made to the embodiments of the text encoding method for details that are not described in detail in the embodiments of the text encoding device.
Fig. 3 shows a schematic structural diagram of a text encoding apparatus according to an embodiment of the present disclosure. As shown in fig. 3, the text encoding apparatus 300 may include:
A first information obtaining module 310, configured to obtain a text to be encoded and a plurality of preset mapping tables, where the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used to record a one-to-one correspondence between characters forming the text and first coding identifiers, and the preset mapping table is used to record a one-to-one correspondence between information in the reference mapping table and second coding identifiers;
The target coding identifier determining module 320 is configured to determine a first target mapping table corresponding to the target character from the preset mapping tables based on a first arrangement position of the target character in the text to be coded and a mapping table reference sequence, and determine a target coding identifier corresponding to the target character based on the target character querying the first target mapping table;
The target code text generation module 330 is configured to generate a target code text based on the target code identifier corresponding to each target character in the text to be coded.
The text coding device provided by the embodiment of the disclosure can acquire a plurality of preset mapping tables for recording the one-to-one mapping relation between characters forming a text and coding identifications according to the reference mapping tables in the related technology, select the preset mapping table adopted by the adaptation of the characters to be coded in the text to be coded from the plurality of preset mapping tables according to the mapping table reference sequence, map the corresponding characters to be coded into the corresponding target coding identifications to obtain the target coding text, realize text coding and decoding by taking the characters as units, save the word segmentation and the process of constructing the word table adapted to the word segmentation method, avoid the problems of text coding depending on the word segmentation method and text distortion, improve the text coding efficiency and the text coding accuracy, and in addition, the preset mapping table adopted by each character is determined by the mapping table reference sequence, so that the difficulty of decoding the text coding is increased to a certain extent, and the security of the text coding is improved.
In some embodiments, the number of preset mapping tables is greater than or equal to the cardinality of the count system of the mapping table reference sequence.
In some embodiments, the first information acquisition module 310 is specifically configured to:
Carrying out random ordering or random number operation on each first code identifier contained in the reference mapping table to obtain each second code identifier;
And generating a preset mapping table based on information contained in the reference mapping table and each second coding identifier, wherein the information comprises each character and/or each first coding identifier.
In some embodiments, the text encoding device 300 further includes a first reference sequence generation module for:
Determining a first target mapping table corresponding to target characters from preset mapping tables based on first arrangement positions of the target characters in the text to be encoded and mapping table reference sequences, and determining the mapping table reference sequences based on the text to be encoded before querying the first target mapping table based on the target characters and determining target encoding identifications corresponding to the target characters;
Or before determining a target coding identifier corresponding to the target character based on the first arrangement position of the target character in the text to be coded and the mapping table reference sequence, determining a first target mapping table corresponding to the target character from all preset mapping tables, inquiring the first target mapping table based on the target character, and determining the target coding identifier corresponding to the target character based on the text to be coded and the coding check value.
In some embodiments, the first reference sequence generation module is specifically configured to:
performing hash operation on a text to be encoded or a combination of the text to be encoded and the encoding check value to generate a first text hash value;
A mapping table reference sequence is generated based on the first text hash value and the encoding check.
In some embodiments, the encoded check value includes a user identification.
In some embodiments, the target encoded text generation module 330 is specifically configured to:
generating a target coding text based on a target coding identifier corresponding to each target character in the text to be coded and a first text hash value;
Or generating the target coding text based on the target coding identifier, the first check hash value and the first text hash value corresponding to each target character in the text to be coded, wherein the first check hash value is the hash value of the coding check value.
In some embodiments, the target code identification determination module 320 is specifically configured to:
determining a second permutation location based on the first permutation location and a sequence length of the mapping table reference sequence;
and determining a first mapping table identifier at a second arrangement position from the mapping table reference sequence, and determining a preset mapping table corresponding to the first mapping table identifier as a first target mapping table.
The text encoding device provided by the embodiment of the disclosure can execute the text encoding method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
The following is an embodiment of a text decoding device provided by an embodiment of the present disclosure, which belongs to the same inventive concept as the text decoding method of the above embodiments, and reference may be made to the embodiments of the above text decoding method for details that are not described in detail in the embodiments of the text decoding device.
Fig. 4 shows a schematic structural diagram of a text decoding device according to an embodiment of the present disclosure. As shown in fig. 4, the text decoding device 400 may include:
The second information obtaining module 410 is configured to obtain a text to be decoded and a plurality of preset mapping tables, where the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used to record a one-to-one correspondence between characters forming the text and the first coding identifier, and the preset mapping table is used to record a one-to-one correspondence between information in the reference mapping table and the second coding identifier;
The decoding character determining module 420 is configured to determine a second target mapping table corresponding to the target coding identifier from the preset mapping tables based on a third arrangement position of the target coding identifier in the text to be decoded and a mapping table reference sequence, and determine a decoding character corresponding to the target coding identifier based on the target coding identifier querying the second target mapping table;
The target decoding text generation module 430 is configured to generate a target decoding text based on decoding characters corresponding to each target coding identifier in the text to be decoded.
The text decoding device provided by the embodiment of the disclosure can acquire a plurality of preset mapping tables for recording the one-to-one mapping relation between characters forming a text and coding identifications according to the reference mapping tables in the related technology, select the preset mapping table adopted by the adaptation of the characters to be decoded in the text to be decoded from the preset mapping tables according to the mapping table reference sequence, map the corresponding characters to be decoded into corresponding decoding characters to obtain the decoded text, realize text coding and decoding by taking the characters as units, save the word segmentation and the process of constructing the word table adapted to the word segmentation method, avoid the problems of text coding depending on the word segmentation method and text distortion, improve the text coding efficiency and the text coding accuracy, and in addition, the preset mapping table adopted by each character is determined by the mapping table reference sequence, so that the difficulty of decoding the text coding is increased to a certain extent, and the security of the text coding is improved.
In some embodiments, the text to be decoded further comprises a first check hash value and/or a first text hash value, wherein the first check hash value is a hash value of the encoding check value, and the first text hash value is a hash value of the text to be encoded or a hash value of a combination of the text to be encoded and the encoding check value.
In some embodiments, the text decoding device 400 further includes a first verification module for:
Under the condition that the text to be decoded comprises a first check hash value, after the text to be decoded and a plurality of preset mapping tables are obtained, carrying out hash operation on the decoding check value to generate a second check hash value;
And under the condition that the second check hash value is equal to the first check hash value, determining that decoding verification is successful, triggering and executing a step of determining a second target mapping table corresponding to the target coding identifier from all preset mapping tables based on a third arrangement position of the target coding identifier in the text to be decoded and a mapping table reference sequence in the text to be decoded, querying the second target mapping table based on the target coding identifier, and determining a decoding character corresponding to the target coding identifier.
In some embodiments, the text decoding device 400 further includes a second reference sequence generation module for:
Under the condition that the text to be decoded comprises a first text hash value, determining a second target mapping table corresponding to the target coding identifier from all preset mapping tables based on a third arrangement position of the target coding identifier in the text to be decoded and a mapping table reference sequence, and inquiring the second target mapping table based on the target coding identifier, and generating the mapping table reference sequence based on the first text hash value and the decoding check value before determining the decoding character corresponding to the target coding identifier.
In some embodiments, the text decoding device 400 further includes a second verification module for:
Under the condition that the text to be decoded comprises a first text hash value, after generating a target decoding text based on decoding characters corresponding to each target coding identifier in the text to be decoded, carrying out hash operation on the target decoding text or a combination of the target decoding text and a decoding check value to generate a second text hash value;
And determining that the text decoding is successful under the condition that the second text hash value is equal to the first text hash value.
In some embodiments, the decoded character determination module 420 is specifically configured to:
determining a fourth permutation location based on the third permutation location and a sequence length of the mapping table reference sequence;
And determining a second mapping table identifier at a fourth arrangement position from the mapping table reference sequence, and determining a preset mapping table corresponding to the second mapping table identifier as a second target mapping table.
The text decoding device provided by the embodiment of the disclosure can execute the text decoding method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, in the embodiment of each apparatus described above, each module included is only divided according to the functional logic, but not limited to the above division, as long as the corresponding function can be implemented, and the specific names of each functional module are only for convenience of distinguishing each other, and are not used to limit the protection scope of the disclosure.
The disclosed embodiments also provide an electronic device that may include a processor and a memory that may be used to store executable instructions. Wherein the processor may be configured to read the executable instructions from the memory and execute the executable instructions to implement the text encoding method or the text decoding method in any of the embodiments described above.
Fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
As shown in fig. 5, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the information processing apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input/output interface (I/O interface) 505 is also connected to the bus 504.
In general, devices may be connected to I/O interface 505 including input devices 506, including for example, touch screens, touch pads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc., output devices 507, including for example, liquid Crystal Displays (LCDs), speakers, vibrators, etc., storage devices 508, including for example, magnetic tape, hard disk, etc., and communication devices 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data.
It should be noted that the electronic device 500 shown in fig. 5 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present disclosure. That is, while FIG. 5 illustrates an electronic device 500 having various means, it should be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. When executed by the processing device 501, performs the above-described functions defined in the text encoding method or the text decoding method of any embodiment of the present disclosure.
The embodiments of the present disclosure also provide a computer-readable storage medium storing a computer program, which when executed by a processor, causes the processor to implement the text encoding method or the text decoding method in any of the embodiments of the present disclosure.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to electrical wiring, fiber optic cable, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP, and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be included in the electronic device or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the text encoding method or the text decoding method described in any of the embodiments of the present disclosure.
In an embodiment of the present disclosure, computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including but not limited to an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic that may be used include Field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems-on-a-chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (18)

The method comprises the steps of obtaining a text to be coded and a plurality of preset mapping tables, wherein the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording a one-to-one correspondence between characters forming the text and first coding identifications, the preset mapping table is used for recording a one-to-one correspondence between information in the reference mapping table and second coding identifications, the preset mapping tables are generated based on the information contained in the reference mapping table and the second coding identifications, the information comprises the characters and/or the first coding identifications, and the second coding identifications are generated based on random sorting or random number operation on the first coding identifications contained in the reference mapping table;
The method comprises the steps of obtaining a text to be decoded and a plurality of preset mapping tables, wherein the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording a one-to-one correspondence between characters forming the text and first coding identifications, the preset mapping table is used for recording a one-to-one correspondence between information in the reference mapping table and second coding identifications, the preset mapping tables are generated based on the information contained in the reference mapping table and the second coding identifications, the information comprises the characters and/or the first coding identifications, and the second coding identifications are generated based on random sorting or random number operation on the first coding identifications contained in the reference mapping table;
the system comprises a first information acquisition module, a first information processing module and a second information processing module, wherein the first information acquisition module is used for acquiring a text to be coded and a plurality of preset mapping tables, the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording a one-to-one correspondence between characters forming the text and first coding identifications, the preset mapping table is used for recording a one-to-one correspondence between information in the reference mapping table and second coding identifications, the preset mapping table is generated based on the information contained in the reference mapping table and the second coding identifications, the information comprises the characters and/or the first coding identifications, and the second coding identifications are generated based on random sorting or random number operation on the first coding identifications contained in the reference mapping table;
The system comprises a first information acquisition module, a second information acquisition module and a reference mapping table, wherein the first information acquisition module is used for acquiring a text to be decoded and a plurality of preset mapping tables, the preset mapping tables are generated based on a reference mapping table, the reference mapping table is used for recording a one-to-one correspondence between characters forming the text and first coding identifiers, the preset mapping table is used for recording a one-to-one correspondence between information in the reference mapping table and second coding identifiers, the preset mapping table is generated based on the information contained in the reference mapping table and the second coding identifiers, the information comprises the characters and/or the first coding identifiers, and the second coding identifiers are generated based on random sorting or random number operation on the first coding identifiers contained in the reference mapping table;
CN202210751727.8A2022-06-282022-06-28 Text encoding and decoding method, device, equipment and mediumActiveCN114936539B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210751727.8ACN114936539B (en)2022-06-282022-06-28 Text encoding and decoding method, device, equipment and medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210751727.8ACN114936539B (en)2022-06-282022-06-28 Text encoding and decoding method, device, equipment and medium

Publications (2)

Publication NumberPublication Date
CN114936539A CN114936539A (en)2022-08-23
CN114936539Btrue CN114936539B (en)2025-04-25

Family

ID=82868842

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210751727.8AActiveCN114936539B (en)2022-06-282022-06-28 Text encoding and decoding method, device, equipment and medium

Country Status (1)

CountryLink
CN (1)CN114936539B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN117033659B (en)*2023-08-092025-04-22哈尔滨工业大学 A method for obtaining orbit change maneuver parameters based on orbit change knowledge base and memory file mapping
CN118134056B (en)*2024-05-062024-07-26深圳联丰建设集团有限公司Intelligent path planning method, device, equipment and storage medium for building construction

Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2021196468A1 (en)*2020-03-312021-10-07深圳壹账通智能科技有限公司Tag creation method and apparatus, electronic device and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
TW201339861A (en)*2012-03-302013-10-01IbmMethod, computer system and program product for performing a code conversion in a smaller target encoding space

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2021196468A1 (en)*2020-03-312021-10-07深圳壹账通智能科技有限公司Tag creation method and apparatus, electronic device and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Amr Adel Helmy ; Yasser M.K. Omar ; Rania Hodhod.An Innovative Word Encoding Method For Text Classification Using Convolutional Neural Network.2018 14th International Computer Engineering Conference (ICENCO).2019,1-6.*

Also Published As

Publication numberPublication date
CN114936539A (en)2022-08-23

Similar Documents

PublicationPublication DateTitle
CN109656923B (en)Data processing method and device, electronic equipment and storage medium
CN114936539B (en) Text encoding and decoding method, device, equipment and medium
CN108733317B (en)Data storage method and device
CN111314388B (en) Method and apparatus for detecting SQL injection
CN115344841A (en) Metaverse access method and blockchain network device based on blockchain network
CN112995199B (en)Data encoding and decoding method, device, transmission system, terminal equipment and storage medium
CN112487253A (en)User invitation code generation method, verification method, device, equipment and storage medium
CN110704833A (en)Data permission configuration method, device, electronic device and storage medium
CN113221173A (en)Ciphertext processing method, device, equipment and storage medium
CN115048623A (en) Method, computing device and storage medium for encrypting code
CN113393288A (en)Order processing information generation method, device, equipment and computer readable medium
CN114625716B (en) Database sub-library and sub-table expansion method, device and computer-readable storage medium
CN115834025A (en)Data encryption method, equipment and storage medium for automobile diagnosis platform
CN113379019B (en)Verification code generation method and device, storage medium and electronic equipment
CN113032808A (en)Data processing method and device, readable medium and electronic equipment
CN113760993A (en)Service data query method and device and electronic equipment
CN108734149B (en)Text data scanning method and device
CN114978646B (en)Access right determining method, device, equipment and storage medium
CN117669534A (en)File comparison method, device, equipment and storage medium
US20250157237A1 (en)Method, apparatus, readable storage medium and electronic device for image processing
CN115129899B (en)Document tag information generation method, apparatus, device, medium, and program product
CN110780898A (en)Page data upgrading method and device and electronic equipment
CN114611120A (en)Data encryption method, device, equipment and medium
CN112000667B (en)Method, apparatus, server and medium for retrieving tree data
CN115374320B (en)Text matching method and device, electronic equipment and computer medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp