CN113162628A - Data encoding method, data decoding method, terminal and storage medium - Google Patents

Data encoding method, data decoding method, terminal and storage medium Download PDF

Info

Publication number
CN113162628A
CN113162628A CN202110452283.3A CN202110452283A CN113162628A CN 113162628 A CN113162628 A CN 113162628A CN 202110452283 A CN202110452283 A CN 202110452283A CN 113162628 A CN113162628 A CN 113162628A
Authority
CN
China
Prior art keywords
data
character
characters
uniform resource
resource locator
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.)
Granted
Application number
CN202110452283.3A
Other languages
Chinese (zh)
Other versions
CN113162628B (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.)
Shenzhen Xishima Data Technology Co ltd
Original Assignee
Shenzhen Xishima Data 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 Shenzhen Xishima Data Technology Co ltd filed Critical Shenzhen Xishima Data Technology Co ltd
Priority to CN202110452283.3A priority Critical patent/CN113162628B/en
Publication of CN113162628A publication Critical patent/CN113162628A/en
Application granted granted Critical
Publication of CN113162628B publication Critical patent/CN113162628B/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/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application is applicable to the field of computers and provides a data encoding method, a data decoding method, a terminal and a storage medium. The data coding method comprises the following steps: acquiring data to be encoded; acquiring a security character; the safety character is a character with a unique analysis result when being analyzed; and coding the data to be coded according to the safety characters to obtain coded target data. The method provided by the embodiment of the application can improve the safety of the receiving end of the uniform resource locator when the data transmission is carried out based on the uniform resource locator.

Description

Data encoding method, data decoding method, terminal and storage medium
Technical Field
The present application relates to the field of computers, and in particular, to a data encoding method, a data decoding method, a terminal, and a storage medium.
Background
A Uniform Resource Locator (URL) is a compact representation of the location and access method of a Resource available from the internet, and is the address of a standard Resource on the internet. In the process of transmitting based on the uniform resource locator, the server may obtain data included in the uniform resource locator. For example, the parameter string in the uniform resource locator may use a form of "key (key) ═ key value", and the server may acquire the parameter string passed in the uniform resource locator based on the form.
In order to ensure the security of the data contained in the uniform resource locator, the data is generally encoded by BASE64, and then the encoded data is used in the uniform resource locator. However, when the server receiving the url acquires the url obtained by the encoding method, it is easy to analyze an error and perform an error operation. Therefore, the use of such a coding scheme may result in reduced security of the receiving end receiving the uniform resource locator.
Disclosure of Invention
The embodiment of the application provides a data encoding method, a data decoding method, a data encoding device, a data decoding device, a terminal and a storage medium, and can improve the safety of a receiving end of a uniform resource locator.
A first aspect of an embodiment of the present application provides a data encoding method, including:
acquiring data to be encoded;
acquiring a security character; the safety character is a character with a unique analysis result when being analyzed;
and coding the data to be coded according to the safety characters to obtain coded target data.
A second aspect of the embodiments of the present application provides a data decoding method, including:
acquiring data to be decoded;
acquiring a decoding mapping relation corresponding to the coding mapping relation; the coding mapping relation is determined according to the safety characters; the safety character is a character with a unique analysis result when being analyzed;
and decoding the data to be decoded according to the decoding mapping relation to obtain decoded second target data.
A data encoding device provided in a third aspect of an embodiment of the present application includes:
a first acquiring unit for acquiring data to be encoded;
a second obtaining unit for obtaining the security character; the safety character is a character with a unique analysis result when being analyzed;
and the coding unit is used for coding the data to be coded according to the safety characters to obtain coded target data.
A fourth aspect of the present invention provides a data decoding apparatus, including:
a third obtaining unit, configured to obtain data to be decoded;
a fourth obtaining unit, configured to obtain a decoding mapping relationship corresponding to the coding mapping relationship; the coding mapping relation is determined according to the safety characters; the safety character is a character with a unique analysis result when being analyzed;
and the decoding unit is used for decoding the data to be decoded according to the decoding mapping relation to obtain decoded second target data.
A fifth aspect of the embodiments of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method when executing the computer program.
A sixth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the above method.
A seventh aspect of embodiments of the present application provides a computer program product, which when run on a terminal, causes the terminal to perform the steps of the method.
According to the embodiment of the application, the security character is obtained, the data to be coded is coded according to the security character, and the coded first target data is obtained, so that in the process of data transmission based on the uniform resource locator, the characters used in the uniform resource locator all belong to the security character, the situation that a receiving end receiving the uniform resource locator generates misanalysis in the process of analyzing the uniform resource locator is avoided, the situation that the receiving end executes non-security operation after misanalyzing the uniform resource locator can be prevented, meanwhile, the situation that a hacker attacks the non-security character can be avoided, and therefore the security of the receiving end of the uniform resource locator can be effectively improved when the data transmission is performed based on the uniform resource locator.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of a data encoding method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a first specific implementation of step S103 according to the embodiment of the present application;
fig. 3 is a schematic diagram of a specific implementation flow of step S201 provided in the embodiment of the present application;
fig. 4 is a schematic flowchart of a second specific implementation of step S103 according to the embodiment of the present application;
fig. 5 is a schematic flowchart of a specific implementation of step S402 provided in the embodiment of the present application;
fig. 6 is a schematic flow chart illustrating an implementation of a data decoding method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data encoding apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a data decoding apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
A Uniform Resource Locator (URL) is a compact representation of the location and access method of a Resource available from the internet, and is the address of a standard Resource on the internet. In the process of transmitting based on the uniform resource locator, the server may obtain data included in the uniform resource locator. For example, the parameter string in the uniform resource locator may use a form of "key (key) ═ key value", and the server may acquire the parameter string passed in the uniform resource locator based on the form.
In order to ensure the security of the data contained in the uniform resource locator, the data is generally encoded by BASE64, and then the encoded data is used in the uniform resource locator. However, when the server receiving the url acquires the url obtained by the encoding method, it is easy to analyze an error and perform an error operation. Therefore, the use of such a coding scheme may result in reduced security of the receiving end receiving the uniform resource locator.
In order to explain the technical means of the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic diagram illustrating an implementation flow of a data encoding method provided in an embodiment of the present application, where the method may be applied to a terminal and is applicable to a situation where security of a receiving end that receives a uniform resource locator needs to be improved.
The terminal can be a mobile phone, a computer, a server and other terminals.
Specifically, the data encoding method may include the following steps S101 to S103.
Step S101, acquiring data to be encoded.
In the embodiment of the application, the terminal may interact with other terminals based on the uniform resource locator, for example, data may be transmitted to the server based on the uniform resource locator. The data to be coded is data that the terminal needs to transmit based on the uniform resource locator.
If the data to be coded is not coded, the uniform resource locator is generally displayed through a browser, so that a user can easily acquire the uncoded data to be coded through the browser in the transmission process, and the problem of data leakage is caused. In order to ensure the security of the data to be encoded, the terminal needs to encode the data to be encoded first and transmit the data by using the encoded data.
Step S102, obtaining the security character.
The security character is a character having a unique analysis result when being analyzed. That is, when the security character is parsed by the receiving end of the received url, the character in the url has only one parsing result.
In the embodiment of the present application, when data transmission is performed based on a uniform resource locator, after receiving the uniform resource locator, a receiving end may parse the uniform resource locator to obtain data to be decoded, which includes each part, and then decode each part of the data to be decoded to restore the data, so as to obtain actual data content transmitted by the terminal.
However, when the receiving side parses the character in the uniform resource locator, there is a possibility that the parsing may be performed erroneously.
In the conventional encoding method, the encoded data includes some reserved characters, such as "+", "/", "? "and the like. However, these reserved characters are not only used to represent their own corresponding symbols, but also have some functional meaning. For example, "/" is used not only to denote "/", but also to separate hosts and paths in a uniform resource locator; "? "is used not only for the representation"? ", and also to separate the path in the uniform resource locator from the query parameters. For "/", "? When the receiving end analyzes such characters, the receiving end may have a misinterpretation condition, and based on the analysis result of the misinterpretation, the receiving end may perform an operation that does not meet the user's intention. Moreover, when a hacker attacks a receiving end of the uniform resource locator, the hacker often attacks the receiving end by using the characters to cause the situation that the receiving end performs the misinterpretation.
Therefore, in the embodiment of the present application, the security characters can be obtained, and since the characters are only used for representing the characters corresponding to the characters, when the encoded data is encoded by using the security characters, the receiving end has a unique analysis result when analyzing the characters in the uniform resource locator, and a situation of mis-analysis cannot occur.
The acquisition mode of the security characters can be selected according to actual conditions.
In some embodiments of the present application, the terminal may obtain a security character set by a worker according to an actual situation of the receiving end.
In other embodiments of the present application, the terminal may also obtain, according to the RFC3986 protocol, a character that is specified in the RFC3986 protocol and is not escaped during data transmission based on a uniform resource locator; then, characters with a plurality of analysis results when being analyzed are removed from the characters which are not subjected to the escape, namely, characters with multiple meanings are removed, and the rest characters in the characters which are not subjected to the escape are used as safety characters.
And S103, coding the data to be coded according to the safety characters to obtain coded first target data.
In the embodiment of the application, each character in the data to be encoded may be sequentially encoded, and each character is represented by a security character, so as to obtain encoded first target data. I.e. the characters in the first target data all belong to the security characters. Then, the first target data can be used as part or all of the uniform resource locator to perform data transmission based on the uniform resource locator.
According to the embodiment of the application, the security character is obtained, the data to be coded is coded according to the security character, and the coded first target data is obtained, so that in the process of data transmission based on the uniform resource locator, the characters used in the uniform resource locator all belong to the security character, the situation that a receiving end receiving the uniform resource locator generates misanalysis in the process of analyzing the uniform resource locator is avoided, the situation that the receiving end executes non-security operation after misanalyzing the uniform resource locator can be prevented, meanwhile, the situation that a hacker attacks the non-security character can be avoided, and therefore the security of the receiving end of the uniform resource locator can be effectively improved when the data transmission is performed based on the uniform resource locator.
Moreover, the security characters can be characters which do not need to be subjected to escape in the data transmission process based on the uniform resource locator, so that the characters in the first target data can be prevented from being subjected to escape into hexadecimal data during transmission, and the readability of the first target data is improved.
In order to further improve readability, in some embodiments of the present application, the step S103 may further include the following steps S201 to S202.
In step S201, confusable characters in the security characters are obtained.
Wherein, the confusable character may refer to a character having similar shapes in the security character, such as "0" and "O", "I" and "1", etc. Or may refer to characters that are error prone when a user uses a uniform resource locator.
In some embodiments of the present application, the obtaining manner of the confusable character may be selected according to actual situations. For example, the setting may be made by the user according to the actual situation. Or the terminal analyzes each character, detects whether a character group with the similarity larger than a preset similarity threshold exists in the security characters, and takes the characters in the character group with the similarity larger than the preset similarity threshold as the confusable characters. The setting can also be made according to the situation when the user actually uses the uniform resource locator.
Specifically, in some embodiments of the present application, as shown in fig. 3, the obtaining of the confusable character may include: the following steps S301 to S303.
Step S301, obtaining uniform resource locator sample data.
The uniform resource locator sample data refers to a pre-encoded uniform resource locator.
Step S302, input data corresponding to the uniform resource locator sample data input in the uniform resource locator input box is obtained.
The url input box may be an input box in a browser.
In some embodiments of the present application, a user may perform an input operation in the url input box according to url sample data to input the url. The terminal can acquire input data corresponding to the uniform resource locator sample data in the uniform resource locator input box based on the browser and analyze the input data.
Step S303, comparing each sample character in the uniform resource locator sample data with the corresponding input character in the input data, and taking the sample character in the uniform resource locator sample data different from the corresponding input character in the input data as the confusable character.
Specifically, each sample of the input data in the url input box may be sequentially compared with the corresponding input character in the url sample data to determine a sample character in the url sample data that is different from the corresponding input character in the input data, and the sample character that is different from the corresponding input character in the input data is used as the confusable character.
In some embodiments of the present application, the terminal may further calculate error data of each character based on a plurality of sets of input data and corresponding url sample data, and determine an confusable character based on the error data. For example, the number of times of errors of each character occurring in the sets of input data may be calculated, and characters having the number of times of errors larger than a preset number threshold may be regarded as confusable characters. Or, the error rate of the error of each character in the multiple sets of input data can be calculated, and the character with the error rate larger than the preset error rate threshold value is taken as the confusable character.
Step S202, according to the confusable character and the safe character, encoding data to be encoded to obtain first target data.
In some embodiments of the present application, each character in the first target data is a target character that belongs to a safe character and does not belong to a confusable character. Specifically, the confusable characters can be removed from the security characters, and the security characters from which the confusable characters are removed are used for encoding the data to be encoded, that is, the target characters are used for encoding the data to be encoded to obtain the first target data.
Specifically, in some embodiments of the present application, as shown in fig. 4, the step S202 may include the following steps S401 to S402.
Step S401, determining a coding mapping relation according to the safety characters and the confusable characters.
The code mapping relation is used for mapping each preset character into different target characters respectively. The target characters belong to safe characters, and all the target characters do not belong to confusable characters.
The form of the obtained coding mapping relation may be selected according to actual situations, and may be presented in a table manner, for example.
Step S402, coding the data to be coded according to the coding mapping relation to obtain first target data.
In some embodiments of the present application, according to the encoding mapping relationship, the data to be encoded may be encoded to use the target character to represent each character in the data to be encoded, so as to obtain the encoded first target data.
The specific encoding mode can be selected according to the form of the preset characters.
In some embodiments of the present application, the predetermined character may be a numeric character with a predetermined carry system. The total number of the digital characters is the same as the corresponding carry number of the preset carry system. For example, if the predetermined carry system is sixty-seven system, the numeric characters of the predetermined carry system are "0" to "66".
As shown in fig. 5, the above step S402 may include the following steps S501 to S502.
Step S501, the data to be coded is converted into intermediate data coded by digital characters.
Specifically, in some embodiments of the present application, data to be encoded may be first converted into data in a preset carry system, and the data in the preset carry system may be used as intermediate data. Since the total number of the numeric characters is the same as the number corresponding to the preset carry system, each character in the intermediate data may be represented by one of the numeric characters.
It should be noted that the total number of numeric characters can be determined according to the total number of security characters and the total number of confusing characters. Specifically, the total number of numeric characters may be less than or equal to the total number of security characters after the confusable characters are removed.
Step S502, according to the coding mapping relation, mapping each character in the intermediate data into a target character in sequence to obtain first target data.
In some embodiments of the present application, since each character in the intermediate data may be represented by a character in the numeric characters, the terminal may sequentially map each character in the intermediate data to a target character according to the coding mapping relationship.
Taking the total number of the digital characters as 67 as an example for explanation, that is, the preset carry system is sixty-seven system, the terminal may convert the data to be encoded into the first intermediate data in binary form first. And then converting the first intermediate data in the binary form into second intermediate data in a large integer format so as to splice all binary characters in the first intermediate data. Then, the second intermediate data is converted into sixty-seven system third intermediate data by a rolling phase division method. Finally, based on the coding mapping relationship, each character in the third intermediate data can be mapped into a target character in sequence to obtain first target data.
The above only describes the implementation manner of specific coding, and in practical applications, different conversion manners may be provided based on different preset carry systems, which is not described in detail herein.
It should be noted that, because the conventional BASE64 encoding method needs to convert data into sixty-four system numbers and encode the converted data into corresponding characters, the character string obtained by encoding has a large character quantity. In order to reduce the character quantity of the encoded character string, the carry number corresponding to the preset carry system may be greater than 64, that is, the total number of the numeric characters is greater than 64, and the character quantity of the encoded character string may be smaller than the character quantity of the character string encoded by the BASE64 encoding method.
According to the implementation mode of the application, the to-be-coded data are coded according to the confusable characters and the safe characters to obtain the first target data, so that in the data transmission process based on the uniform resource locators, the characters used in the uniform resource locators all belong to the safe characters and do not belong to the confusable characters, the readability of the first target data is improved while the safety of a receiving end is guaranteed, and after the uniform resource locators are obtained according to the first target data, the situation of input errors is not prone to occurring when a user inputs the uniform resource locators.
In some embodiments of the present application, different confusable characters may be selected for different users according to actual situations.
Specifically, each url input box may be bound with user information, which may be information used for uniquely identifying a user, such as a user identifier and user face information. Based on the uniform resource locator input box bound with different user information, confusable characters respectively associated with each user information can be respectively determined. Before encoding the data to be encoded, user information of a receiving end receiving the uniform resource locator can be obtained, and the data to be encoded is encoded based on the security character and the confusable character associated with the user information to obtain first target data. In this case, each user may have its own suitable encoding scheme.
Due to the fact that the visual perception abilities of different users and the using habits of the users are different, different characters which are easy to confuse can be removed from the different users in the method, the data obtained after coding can meet the personalized needs of the users, and the readability of the first target data is further improved.
Correspondingly, fig. 6 shows a schematic flow chart of an implementation of a data decoding method provided in the embodiment of the present application, where the method corresponds to the data encoding method shown in fig. 1, and can be applied to a terminal and can be applied to a situation where security of a receiving end that receives a uniform resource locator needs to be improved.
The terminal can be a mobile phone, a computer, a server, or the like, and can be a receiving end for receiving the uniform resource locator.
Specifically, the data decoding method may include the following steps S601 to S603.
Step S601, acquiring data to be decoded.
Step S602, a decoding mapping relationship corresponding to the coding mapping relationship is obtained.
Wherein, the coding mapping relation is a mapping relation determined according to the security characters. The security character is a character having a unique analysis result when analyzed.
Step S603, decoding the data to be decoded according to the decoding mapping relationship to obtain decoded second target data.
In an embodiment of the present application, a sending end of a uniform resource locator may encode data to be encoded based on the methods in fig. 1 to fig. 5 to obtain first target data, and then transmit the first target data based on the uniform resource locator. After the terminal receiving the uniform resource locator acquires the first target data (i.e., the data to be decoded), the terminal may decode the data to be decoded based on a decoding mapping relationship corresponding to the encoding mapping relationship used by the sending end to obtain decoded second target data, where the decoded second target data is the same as the data to be encoded, so that the terminal may acquire actual data content of the data transmitted in the uniform resource locator.
In some embodiments of the present application, the encoding mapping relationship is a mapping relationship determined according to a security character and an confusing character.
Moreover, a specific implementation manner of data decoding is a decoding manner corresponding to the encoding manner described in fig. 1 to fig. 5, which is not described in detail herein.
Taking the total number of the numeric characters in the coding mapping relationship as 67 for example, the terminal may obtain sixty-seven system fourth intermediate data according to a preset decoding mapping relationship, convert the sixty-seven system fourth intermediate data into binary fifth intermediate data, and convert the binary fifth intermediate data into second target data.
It should be noted that, for simplicity of description, the foregoing method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders.
Fig. 7 is a schematic structural diagram of a data encoding device 700 according to an embodiment of the present application, where the data encoding device 700 is disposed on a terminal.
Wherein, the data encoding apparatus 700 may include: the device comprises a first acquisition unit, a second acquisition unit and an encoding unit.
A first obtaining unit 701, configured to obtain data to be encoded;
a second obtaining unit 702, configured to obtain a security character; the safety character is a character with a unique analysis result when being analyzed;
the encoding unit 703 is configured to encode the data to be encoded according to the security character, so as to obtain encoded first target data.
In some embodiments of the present application, the encoding unit 703 may be further configured to: acquiring confusable characters in the safety characters; and encoding the data to be encoded according to the confusable characters and the safety characters to obtain the first target data, wherein each character in the first target data belongs to the safety character and does not belong to the target characters of the confusable characters.
In some embodiments of the present application, the encoding unit 703 may be further configured to: determining a coding mapping relation according to the safety character and the confusable character; the code mapping relation is used for mapping each preset character into different target characters respectively; and coding the data to be coded according to the coding mapping relation to obtain the first target data.
In some embodiments of the present application, the predetermined character is a numeric character with a predetermined carry system; the encoding unit 703 may be further configured to: converting the data to be encoded into intermediate data encoded by the digital characters; and mapping each character in the intermediate data into a target character in sequence according to the coding mapping relation to obtain first target data.
In some embodiments of the present application, the carry number corresponding to the preset carry system may be greater than 64.
In some embodiments of the present application, the encoding unit 703 may be further configured to: acquiring uniform resource locator sample data; acquiring input data corresponding to the uniform resource locator sample data input in a uniform resource locator input box; comparing each sample character in the uniform resource locator sample data with the corresponding input character in the input data, and taking the sample character in the uniform resource locator sample data different from the corresponding input character in the input data as an easily-confused character.
In some embodiments of the present application, the second obtaining unit 702 may be further configured to: according to the RFC3986 protocol, obtaining characters which are specified in the RFC3986 protocol and are not transferred in the data transmission process based on the uniform resource locator; and eliminating characters with a plurality of analysis results when the characters are analyzed from the characters which are not escaped, and taking the rest characters in the characters which are not escaped as safety characters.
It should be noted that, for convenience and simplicity of description, the specific working process of the data encoding apparatus 700 may refer to the corresponding process of the method described in fig. 1 to fig. 5, and is not described herein again.
Fig. 8 is a schematic structural diagram of a data decoding apparatus 800 according to an embodiment of the present application, where the data decoding apparatus 800 is configured on a terminal.
Wherein the data decoding apparatus 800 may include: a third acquisition unit, a fourth acquisition unit and a decoding unit.
A third obtaining unit 801, configured to obtain data to be decoded;
a fourth obtaining unit 802, configured to obtain a decoding mapping relationship corresponding to the coding mapping relationship; the coding mapping relation is determined according to the safety characters; the safety character is a character with a unique analysis result when being analyzed;
a decoding unit 803, configured to decode the data to be decoded according to the decoding mapping relationship, so as to obtain decoded second target data.
It should be noted that, for convenience and simplicity of description, the specific working process of the data decoding apparatus 800 may refer to a corresponding process of the method described in fig. 6, and is not described herein again.
Fig. 9 is a schematic diagram of a terminal according to an embodiment of the present application. The terminal 9 may include: a processor 90, a memory 91 and a computer program 92, such as a data encoding program or a data decoding program, stored in said memory 91 and executable on said processor 90. The processor 90, when executing the computer program 92, implements the steps in the various data encoding method embodiments described above, such as the steps S101 to S103 shown in fig. 1. Alternatively, the processor 90 implements the steps in the above-mentioned data decoding method embodiments when executing the computer program 92, for example, steps S601 to S603 shown in fig. 6.
Alternatively, the processor 90, when executing the computer program 92, implements the functions of the modules/units in the above-mentioned device embodiments, such as the first obtaining unit, the second obtaining unit and the encoding unit shown in fig. 7, and further such as the third obtaining unit, the fourth obtaining unit and the decoding unit shown in fig. 8.
The computer program may be divided into one or more modules/units, which are stored in the memory 91 and executed by the processor 90 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the terminal.
For example, the computer program may be divided into: the device comprises a first acquisition unit, a second acquisition unit and an encoding unit. The specific functions of each unit are as follows: a first acquiring unit for acquiring data to be encoded; a second obtaining unit for obtaining the security character; the safety character is a character with a unique analysis result when being analyzed; and the coding unit is used for coding the data to be coded according to the safety characters to obtain coded first target data.
For another example, the computer program may be divided into: a third acquisition unit, a fourth acquisition unit and a decoding unit. The specific functions of each unit are as follows: a third obtaining unit, configured to obtain data to be decoded; a fourth obtaining unit, configured to obtain a decoding mapping relationship corresponding to the coding mapping relationship; the coding mapping relation is determined according to the safety characters; the safety character is a character with a unique analysis result when being analyzed; and the decoding unit is used for decoding the data to be decoded according to the decoding mapping relation to obtain decoded second target data.
The terminal may include, but is not limited to, a processor 90, a memory 91. Those skilled in the art will appreciate that fig. 9 is only an example of a terminal and is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or different components, e.g., the terminal may also include input-output devices, network access devices, buses, etc.
The Processor 90 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 91 may be an internal storage unit of the terminal, such as a hard disk or a memory of the terminal. The memory 91 may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the memory 91 may also include both an internal storage unit and an external storage device of the terminal. The memory 91 is used for storing the computer program and other programs and data required by the terminal. The memory 91 may also be used to temporarily store data that has been output or is to be output.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method of encoding data, comprising:
acquiring data to be encoded;
acquiring a security character; the safety character is a character with a unique analysis result when being analyzed;
and coding the data to be coded according to the safety characters to obtain coded target data.
2. The data encoding method of claim 1, wherein the encoding the data to be encoded according to the security character to obtain encoded first target data comprises:
acquiring confusable characters in the safety characters;
and encoding the data to be encoded according to the confusable characters and the safety characters to obtain the first target data, wherein each character in the first target data belongs to the safety character and does not belong to the target characters of the confusable characters.
3. The data encoding method of claim 2, wherein the encoding the data to be encoded according to the confusable character and the secure character to obtain the first target data comprises:
determining a coding mapping relation according to the safety character and the confusable character; the code mapping relation is used for mapping each preset character into different target characters respectively;
and coding the data to be coded according to the coding mapping relation to obtain the first target data.
4. The data encoding method of claim 3, wherein the predetermined character is a numeric character of a predetermined carry system;
the encoding the data to be encoded according to the encoding mapping relationship to obtain the first target data includes:
converting the data to be encoded into intermediate data encoded by the digital characters;
and mapping each character in the intermediate data into a target character in sequence according to the coding mapping relation to obtain first target data.
5. The data encoding method of claim 4, wherein the predetermined carry scheme corresponds to a carry number greater than 64.
6. A method for encoding data according to any one of claims 2 to 5, wherein the obtaining of the confusable character comprises:
acquiring uniform resource locator sample data;
acquiring input data corresponding to the uniform resource locator sample data input in a uniform resource locator input box;
comparing each sample character in the uniform resource locator sample data with the corresponding input character in the input data, and taking the sample character in the uniform resource locator sample data different from the corresponding input character in the input data as an easily-confused character.
7. The data encoding method of any one of claims 1 to 5, wherein the obtaining of the security character comprises:
according to the RFC3986 protocol, obtaining characters which are specified in the RFC3986 protocol and are not transferred in the data transmission process based on the uniform resource locator;
and eliminating characters with a plurality of analysis results when the characters are analyzed from the characters which are not escaped, and taking the rest characters in the characters which are not escaped as safety characters.
8. A method of decoding data, comprising:
acquiring data to be decoded;
acquiring a decoding mapping relation corresponding to the coding mapping relation; the coding mapping relation is determined according to the safety characters; the safety character is a character with a unique analysis result when being analyzed;
and decoding the data to be decoded according to the decoding mapping relation to obtain decoded second target data.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 7 are implemented when the processor executes the computer program or the steps of the method according to claim 8 are implemented when the processor executes the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7, or which, when being executed by the processor, carries out the steps of the method according to claim 8.
CN202110452283.3A 2021-04-26 2021-04-26 Data encoding method, data decoding method, terminal and storage medium Active CN113162628B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110452283.3A CN113162628B (en) 2021-04-26 2021-04-26 Data encoding method, data decoding method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110452283.3A CN113162628B (en) 2021-04-26 2021-04-26 Data encoding method, data decoding method, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN113162628A true CN113162628A (en) 2021-07-23
CN113162628B CN113162628B (en) 2022-03-18

Family

ID=76870711

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110452283.3A Active CN113162628B (en) 2021-04-26 2021-04-26 Data encoding method, data decoding method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN113162628B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114063943A (en) * 2021-11-18 2022-02-18 芯翼信息科技(上海)有限公司 Data transmission system, method, device, medium, and apparatus

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60201735A (en) * 1984-03-26 1985-10-12 Canon Inc Data processing system
CN1368796A (en) * 2001-02-02 2002-09-11 日本胜利株式会社 Synchronizing signal generating method, recording device and recording medium, transmission device and transmission medium
US20030009595A1 (en) * 2001-07-09 2003-01-09 Roger Collins System and method for compressing data using field-based code word generation
EP1406392A1 (en) * 2002-10-04 2004-04-07 Broadcom Corporation Variable modulation with LDPC (low density parity check) coding
CN101000602A (en) * 2006-01-09 2007-07-18 台湾积体电路制造股份有限公司 Character conversion methods and systems
CN101911566A (en) * 2007-11-08 2010-12-08 三星电子株式会社 Apparatus and method for transmitting and receiving data in a communication system using low density parity check code
US20110109485A1 (en) * 2009-11-06 2011-05-12 Fujitsu Limited Computer product, information processing apparatus, and information search apparatus
CN102648582A (en) * 2009-07-28 2012-08-22 洛桑联邦理工学院 Encoding and decoding of information
CN103125090A (en) * 2010-08-27 2013-05-29 法国电信 Method and device for transmission and reception in a multi-input multi-output channel, distributing a code word between multiple mapping matrices, and corresponding computer program
CN104813588A (en) * 2012-10-09 2015-07-29 阿尔卡特朗讯 Secure and lossless data compression
US20160211863A1 (en) * 2015-01-19 2016-07-21 Fujitsu Limited Converting device and converting method
CN107561564A (en) * 2017-09-08 2018-01-09 广州祺智通信科技股份有限公司 A kind of compression implementation method of big-dipper satellite information transfer
CN110932822A (en) * 2019-12-02 2020-03-27 泰康保险集团股份有限公司 Data encoding method, data decoding method, device, equipment and storage medium
CN111078689A (en) * 2019-11-20 2020-04-28 深圳希施玛数据科技有限公司 Data processing method and system of discontinuous pre-sorting traversal tree algorithm
CN111178008A (en) * 2019-12-19 2020-05-19 清华大学 Digital character-oriented data encoding method, digital character-oriented data analyzing method and digital character-oriented data encoding system

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60201735A (en) * 1984-03-26 1985-10-12 Canon Inc Data processing system
CN1368796A (en) * 2001-02-02 2002-09-11 日本胜利株式会社 Synchronizing signal generating method, recording device and recording medium, transmission device and transmission medium
US20030009595A1 (en) * 2001-07-09 2003-01-09 Roger Collins System and method for compressing data using field-based code word generation
EP1406392A1 (en) * 2002-10-04 2004-04-07 Broadcom Corporation Variable modulation with LDPC (low density parity check) coding
CN101000602A (en) * 2006-01-09 2007-07-18 台湾积体电路制造股份有限公司 Character conversion methods and systems
CN101911566A (en) * 2007-11-08 2010-12-08 三星电子株式会社 Apparatus and method for transmitting and receiving data in a communication system using low density parity check code
CN102648582A (en) * 2009-07-28 2012-08-22 洛桑联邦理工学院 Encoding and decoding of information
US20110109485A1 (en) * 2009-11-06 2011-05-12 Fujitsu Limited Computer product, information processing apparatus, and information search apparatus
CN103125090A (en) * 2010-08-27 2013-05-29 法国电信 Method and device for transmission and reception in a multi-input multi-output channel, distributing a code word between multiple mapping matrices, and corresponding computer program
CN104813588A (en) * 2012-10-09 2015-07-29 阿尔卡特朗讯 Secure and lossless data compression
US20160211863A1 (en) * 2015-01-19 2016-07-21 Fujitsu Limited Converting device and converting method
CN107561564A (en) * 2017-09-08 2018-01-09 广州祺智通信科技股份有限公司 A kind of compression implementation method of big-dipper satellite information transfer
CN111078689A (en) * 2019-11-20 2020-04-28 深圳希施玛数据科技有限公司 Data processing method and system of discontinuous pre-sorting traversal tree algorithm
CN110932822A (en) * 2019-12-02 2020-03-27 泰康保险集团股份有限公司 Data encoding method, data decoding method, device, equipment and storage medium
CN111178008A (en) * 2019-12-19 2020-05-19 清华大学 Digital character-oriented data encoding method, digital character-oriented data analyzing method and digital character-oriented data encoding system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
SUSMITAMAHATO 等: "Personal characters to bits mapping using Dot Pattern Character Encoding Scheme (DPCES)", 《JOURNAL OF KING SAUD UNIVERSITY - COMPUTER AND INFORMATION SCIENCES》 *
王晨亮 等: "资源环境数学模型语义的解析与映射", 《计算机工程与应用》 *
童天添: "基于C#的字符编码映射系统", 《陕西科技大学学报(自然科学版)》 *
花草清香: "单词到散列表的唯一映射算法", 《HTTP://BLOG.CDSN.NET/MISSKISSC/ARTICLE/DETAILS/17505167》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114063943A (en) * 2021-11-18 2022-02-18 芯翼信息科技(上海)有限公司 Data transmission system, method, device, medium, and apparatus

Also Published As

Publication number Publication date
CN113162628B (en) 2022-03-18

Similar Documents

Publication Publication Date Title
CN110445860B (en) Message sending method, device, terminal equipment and storage medium
CA3090716A1 (en) Two-dimensional code generation and identification
CN111262876B (en) Data processing method, device and equipment based on block chain and storage medium
CN110224999A (en) Information interacting method, device and storage medium
KR101568947B1 (en) Method and system for downloading font file
CN112333186A (en) Data communication method, device, equipment and storage medium
CN110995391A (en) Data transmission method in isolated network, server and terminal
CN112817602A (en) JSON format data sending and receiving method, device and medium
CN113162628B (en) Data encoding method, data decoding method, terminal and storage medium
CN111865952B (en) Data processing method, data processing device, storage medium and electronic equipment
CN114051006A (en) Data transmission method, data transmission device, computer equipment and storage medium
CN113691546A (en) Integrity verification method, system, equipment and medium for text file
CN112311720A (en) Data transmission method and device
CN109446052B (en) Verification method and device for application program
CN111064976B (en) Method for sending live broadcast information and server
CN114726480A (en) Data encoding method and related device, electronic equipment and storage medium
CN114036364A (en) Method, apparatus, device, medium and product for identifying a crawler
CN112261065A (en) Method and device for compression transmission and calculation decompression of satellite communication
CN113283215B (en) Data confusion method and device based on UTF-32 coding
CN111967001A (en) Decoding and coding safety isolation method based on double containers
CN110995843A (en) Data transmission method and device, electronic equipment and readable storage medium
CN112100453A (en) Method, system, equipment and computer storage medium for character string distribution statistics
CN114679324B (en) Data exchange method, tool, system, equipment and medium
CN115473646A (en) Authority information transmission method and device, electronic equipment and storage medium
CN117040882A (en) Black box processing method and system in data transmission process

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