CN114626338A - Character encoding method, character decoding method, character encoding system, character decoding system, character encoding device, character decoding device, and storage medium - Google Patents

Character encoding method, character decoding method, character encoding system, character decoding system, character encoding device, character decoding device, and storage medium Download PDF

Info

Publication number
CN114626338A
CN114626338A CN202210193676.1A CN202210193676A CN114626338A CN 114626338 A CN114626338 A CN 114626338A CN 202210193676 A CN202210193676 A CN 202210193676A CN 114626338 A CN114626338 A CN 114626338A
Authority
CN
China
Prior art keywords
numerical value
data
character
encoding
value
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
CN202210193676.1A
Other languages
Chinese (zh)
Other versions
CN114626338B (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.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian 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 Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202210193676.1A priority Critical patent/CN114626338B/en
Publication of CN114626338A publication Critical patent/CN114626338A/en
Application granted granted Critical
Publication of CN114626338B publication Critical patent/CN114626338B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • Document Processing Apparatus (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The application relates to a character encoding and decoding method, system, device and storage medium of data; wherein, the coding method comprises the following steps: acquiring data to be encoded uploaded by a sending end; calling an intelligent contract of the block chain system, and converting the data into a first numerical value of a first system; encoding the first numerical value by utilizing a threshold value agreed with a receiving end in advance to obtain a second numerical value of a first system corresponding to the data; and determining a character coding result corresponding to the second numerical value according to a preset character coding table. The method and the device are used for solving the technical problem that an algorithm using symmetric or asymmetric encryption is complex in the prior art.

Description

Character encoding method, character decoding method, character encoding system, character decoding system, character encoding device, character decoding device, and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a method, a system, a device, and a storage medium for encoding and decoding characters of data.
Background
At present, most solutions for sensitive data encryption scenes are carried out through symmetric or asymmetric encryption, and in an end-to-end business process, a man in the middle can be ensured to be visible and unreadable.
However, for the sending end, an encryption algorithm needs to be configured in advance, when sensitive data is sent, the encryption algorithm is called, the sensitive data to be sent is encrypted by using the encryption algorithm, the algorithm is complex, the calculation amount is large, and the scheme is heavy.
Disclosure of Invention
The application provides a method, a system, equipment and a storage medium for encoding and decoding characters of data, which are used for solving the technical problem that an algorithm using symmetric or asymmetric encryption is more complicated in the prior art.
In a first aspect, an embodiment of the present application provides a method for encoding characters of data, which is applicable to a block chain system, and the method includes:
acquiring data to be encoded uploaded by a sending end;
calling an intelligent contract of the block chain system, and converting the data into a first numerical value of a first system; encoding the first numerical value by utilizing a threshold value agreed with a receiving end in advance to obtain a second numerical value of a first system corresponding to the data; and determining a character coding result corresponding to the second numerical value according to a preset character coding table.
Optionally, the encoding the first value by using a threshold agreed in advance with a receiving end to obtain a second value of the first system corresponding to the data includes:
and calling the intelligent contract to convert the threshold value into a first system to obtain a threshold value of the first system, and calculating the sum of the first numerical value and the threshold value of the first system to obtain a second numerical value of the first system corresponding to the data.
Optionally, the determining, according to a preset character encoding table, a character encoding result corresponding to the second numerical value includes:
calling the intelligent contract to convert the second numerical value into a third numerical value of a second system;
and reading a character coding result corresponding to the third numerical value from the character coding table.
Optionally, the last session record of the sending end and the receiving end is stored in the block chain system; before encoding the first value by using a threshold agreed in advance with a receiving end, the method further includes:
calling the intelligent contract to obtain a session identification number corresponding to the last session record of the sending end and the receiving end;
and determining a threshold value agreed in advance with the receiving terminal according to the session identification number.
Optionally, the determining a threshold value agreed in advance with the receiving end according to the session identification number includes:
and reading at least one bit of target data from the session identification number, and taking the at least one bit of target data as a threshold value agreed with the receiving terminal in advance.
In a second aspect, an embodiment of the present application provides a method for decoding characters of data, which is applied to a receiving end, and the method includes:
determining a second numerical value of the first system corresponding to the character coding result according to a preset character coding table;
decoding the second numerical value by using a threshold value agreed with a sending end in advance to obtain a first numerical value of a first system;
determining a decoding result based on the first value.
Optionally, the decoding the second numerical value by using a threshold agreed in advance with the sending end to obtain a first numerical value of a first system includes:
converting the threshold value into a first system to obtain a threshold value of the first system;
and calculating the difference value of the second value and the threshold value of the first system to obtain the first value of the first system.
In a third aspect, an embodiment of the present application provides a system for encoding and decoding characters of data, including: a block chain system and a receiving end;
the block chain system is used for acquiring data to be coded uploaded by a sending end; calling an intelligent contract of the blockchain system to convert the data into a first numerical value of a first system; encoding the first numerical value by using a threshold value agreed with a target receiving terminal in advance to obtain a second numerical value of a first system corresponding to the data; determining a character coding result corresponding to the second numerical value according to a preset character coding table; sending the character coding result to the receiving end;
the receiving end is used for determining a second numerical value of the first system corresponding to the character coding result according to a preset character coding table; decoding the second numerical value by using a threshold value agreed with a sending end in advance to obtain a first numerical value of a first system; determining a decoding result based on the first value.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor is configured to execute the program stored in the memory to implement the method for encoding characters of data according to the first aspect or the method for decoding characters of data according to the second aspect.
In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements a character encoding method for data according to the first aspect or a character decoding method for data according to the second aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method provided by the embodiment of the application, the first numerical value of the data to be coded is coded by utilizing the threshold value agreed by the sending end and the receiving end in advance to obtain the second numerical value, then the character coding result corresponding to the second numerical value is determined according to the character coding table, the data is coded by utilizing the thought of character coding, the steps are simple, and in the coding process, the calculated amount is small. Moreover, the processes are all completed in an intelligent contract of the block chain system, and the whole life cycle of the operation is recorded through the intelligent contract, so that the follow-up verification is facilitated.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a method for encoding data characters according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a method for decoding data characters according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data character encoding and decoding system according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an apparatus for encoding data characters according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an apparatus for decoding data characters according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to solve the technical problem that an algorithm using symmetric or asymmetric encryption is complex in the prior art, an embodiment of the present application provides a data character encoding method, as shown in fig. 1, the data character encoding method provided in the embodiment of the present application is applicable to a block chain system, and the data character encoding method specifically includes the following steps:
step 101, acquiring data to be encoded uploaded by a sending end;
among other things, the data may be sensitive data, such as: privacy data such as a user's mobile phone number, an identity card number, a home address and the like; other data are also possible, such as: the session content sent by the sending end to the receiving end, and the like.
Step 102, calling an intelligent contract of the block chain system to convert the data into a first numerical value of a first system;
in order for data to be stored in a computer and transmitted over a communication network, it is necessary to encode characters in a character set as one of the objects in a specified set, for example: bit patterns, natural number sequences, 8-bit groups or electrical pulses, etc. Common examples include: the latin alphabet is coded to morse code and ASCII. Where ASCII numbers letters, numbers and other symbols and represents this integer with a 7-bit binary number. An additional bit, 8 bits, is usually used to facilitate storage in 1 byte.
In a specific implementation, the first binary system may be a binary system, and the data to be encoded is converted into a binary first numerical value.
103, encoding the first numerical value by using a threshold value agreed with a receiving end in advance to obtain a second numerical value of a first system corresponding to the data;
the threshold value agreed in advance with the receiving end needs to be globally unique so as to prevent other clients receiving the character encoding result from interpreting.
In a specific embodiment, the last session record of the sender and the receiver is stored in the blockchain system; before encoding the first value by using a threshold agreed in advance with a receiving end, the method further includes:
calling the intelligent contract to obtain a session identification number corresponding to the last session record of the sending end and the receiving end;
and determining a threshold value agreed with the receiving terminal in advance according to the session identification number.
The session identification number of each session has global uniqueness, so that the global uniqueness of the threshold can be ensured by determining the threshold agreed by the sending end and the receiving end through the session identification number, and other clients can be prevented from reading out the information after receiving the information. Meanwhile, as time goes on, the last session between the sending end and the receiving end is constantly changed and not fixed, the situation that the same threshold is used for a long time and simulated by a conscious person is avoided, and the safety of encoding and decoding by using the threshold is further guaranteed.
In specific implementation, at least one bit of target data is read from the session identification number, and the at least one bit of target data is used as a threshold value agreed with the receiving end in advance.
The session identification number is usually composed of a string of numbers and letters, and when determining the threshold value, one of the segments may be truncated from the session identification number as the threshold value. For example: the last 6 bits of target data of the session identification number may be read as a pre-agreed threshold. Of course, other numbers of bits of target data are possible.
When a first numerical value is coded by using a threshold value agreed with a receiving end in advance, the intelligent contract can be called to convert the threshold value into a first system to obtain a threshold value of the first system, and the sum of the first numerical value and the threshold value of the first system is calculated to obtain a second numerical value of the first system corresponding to the data.
For convenience of understanding, here, for example, the first binary is taken as an example, and binary codes corresponding to "sensitive data" are respectively: 110010101001111, 110000100011111, 110010101110000, 110001101101110, with a threshold of 5, converting 5 to binary 101; then a threshold is added on a binary coded basis resulting in a second value of 10010101010100, 110000100100100, 110010101110101, 110001101110011.
In addition, in addition to calculating the sum of the first numerical value and the first system threshold value and coding the sum to obtain the first system second numerical value, the difference value, the product or the quotient of the first numerical value and the first system threshold value can be calculated to obtain the first system second numerical value. Of course, other encoding methods may be used. The sending end and the receiving end are only required to be well defined in advance.
In the embodiment of the application, the whole process of encoding data by using the threshold value only involves the conversion of the system and the simple addition, subtraction, multiplication or division calculation, and is quite simple. However, if the receiving end does not have an accurate threshold, an accurate decoding result cannot be obtained, and the specific content to be delivered cannot be known.
And 104, determining a character coding result corresponding to the second numerical value according to a preset character coding table.
Among them, a Character Encoding table (CEF), also called storage format (storage format), is a sequence of non-negative integer values (i.e., abstract code bits) of an encoded Character set into integer values of finite bit length (called symbol code units). This is a mapping to itself for fixed length coding (null mapping), but for variable length coding the mapping is complex, mapping some code bits to one symbol and some other code bits to a sequence of symbols. For example, using a 16-bit long memory cell to hold digital information, the system can only directly represent values from 0 to 65535 per cell, but can represent larger integers if multiple 16-bit cells are used. This is the role of the CEF, which can map Unicode (Unicode) from each code bit of a code space range of 0 to 140 thousand to a single or multiple code values in the range of 0 to 65,5356. The simplest character encoding table is simply to select a unit large enough to ensure that all values in the encoding character set can be directly encoded (one code bit corresponds to one code value). This is reasonable for encoding character sets that can be represented using octets, such as most traditional non-CJK (chinese-japanese-korean-over-ideogram) character set encodings, and is reasonable enough for encoding character sets that can be represented using sixteen bits, such as the earlier versions of Unicode. However, as the size of the encoded character set increases (e.g., the current Unicode character set requires at least 21 bits to fully represent), this direct representation becomes increasingly inefficient and it is difficult to adapt existing computer systems to larger code values. Thus, many systems that use the latest version of Unicode either correspond Unicode bits to UTF-8 of a variable length sequence of 8-bit bytes or code bits to UTF-16 of a variable length sequence of 16-bit bits.
During specific implementation, calling the intelligent contract, and converting the second numerical value into a third numerical value of a second system; and reading a character coding result corresponding to the third numerical value from the character coding table. Wherein the second binary may be a decimal.
For the convenience of understanding, the second decimal value is used as an example here to continue the illustration, in the example of step 103, the second numerical value is 10010101010100, 110000100100100, 110010101110101, 110001101110011, and according to the description of step 104, the second numerical value is converted into a decimal value, and the third numerical value is 25940, 24868, 25973, 25459. If the character encoding table is UTF-8, and the contents corresponding to each number are determined by table lookup, the final character encoding result is the contents corresponding to "UTF-825940 |24868|25973| 25459".
The resulting string, i.e. the data, as a result of the encoding of the data, is unreadable for clients for which some threshold is not visible. But for the client with visible threshold, specific content can be obtained by manual or system reverse processing, and the method is small in calculation amount and very convenient. In addition, data needs to be converted into binary in the data transmission process, and the method and the device are simple in steps, small in calculated amount and very flexible.
In the embodiment of the application, a first numerical value of data to be coded is coded by using a threshold value predetermined by a sending end and a receiving end to obtain a second numerical value, then a character coding result corresponding to the second numerical value is determined according to a character coding table, the data is coded by using the idea of character coding, the steps are simple, and the calculated amount is small in the coding process. In addition, the processes are all completed in an intelligent contract of the block chain system, and the whole life cycle of the operation is recorded through the intelligent contract, so that the follow-up verification is facilitated.
In addition, as shown in fig. 2, an embodiment of the present application further provides a method for decoding characters of data, which is applied to a receiving end, and the method includes:
step 201, determining a second numerical value of a first system corresponding to a character coding result according to a preset character coding table;
during specific implementation, determining a third numerical value of a second system corresponding to a character coding result according to a character coding table, and converting the third numerical value of the second system into a second numerical value of the first system;
step 202, decoding the second numerical value by using a threshold value agreed with a sending end in advance to obtain a first numerical value of a first system;
specifically, if the coding method agreed by the two parties in advance is to calculate the sum of the first numerical value and the threshold value of the first system to obtain the second numerical value of the first system corresponding to the data, the threshold value is converted into the first system during decoding to obtain the threshold value of the first system; and calculating the difference value between the second numerical value and the threshold value of the first system, thus obtaining the first numerical value of the first system.
Wherein the first binary system can be a binary system, and the second binary system can be a decimal system.
Step 203, determining a decoding result based on the first value.
Step 203 is actually the reverse step of step 102, and the characters in the character set, i.e. the decoding result, are determined by using the first numerical value of the binary system through backward extrapolation.
In the embodiment of the present application, the decoding process is actually the inverse process of the encoding process, and the amount of calculation is consistent with the encoding process. Therefore, the decoding process is also less computationally intensive.
In addition, as shown in fig. 3, an embodiment of the present application further provides a system for encoding and decoding characters of data, including: a block chain system 301 and a receiving end 302;
the block chain system 301 is configured to acquire data to be encoded uploaded by a sending end; calling an intelligent contract of the blockchain system to convert the data into a first numerical value of a first system; encoding the first numerical value by using a threshold value agreed with the target receiving terminal 302 in advance to obtain a second numerical value of a first system corresponding to the data; determining a character coding result corresponding to the second numerical value according to a preset character coding table; sending the character encoding result to the receiving end 302;
the receiving end 302 is configured to determine a second numerical value of the first system corresponding to the character encoding result according to a preset character encoding table; decoding the second numerical value by using a threshold value agreed with a sending end in advance to obtain a first numerical value of a first system; determining a decoding result based on the first value.
In specific implementation, the block chain system 301 may broadcast the character encoding result, and only the receiving end with the same threshold may correctly decode and correctly read the data; even if the other receiving end receives the character encoding result, the data cannot be correctly decoded because the other receiving end does not have the correct threshold value.
Based on the same concept, the present application provides a data character encoding apparatus, which is suitable for a block chain system, and the specific implementation of the apparatus can refer to the description of the method embodiment, and the repeated parts are not repeated, as shown in fig. 4, the apparatus mainly includes:
an obtaining module 401, configured to obtain data to be encoded, which is uploaded by a sending end;
a conversion module 402, configured to invoke an intelligent contract of the blockchain system, and convert the data into a first numerical value of a first system;
an encoding module 403, configured to encode the first numerical value by using a threshold agreed in advance with a receiving end, to obtain a second numerical value of a first system corresponding to the data;
a first determining module 404, configured to determine, according to a preset character encoding table, a character encoding result corresponding to the second numerical value.
In a specific embodiment, the encoding module 403 is configured to invoke the smart contract to convert the threshold value into a first system, obtain a threshold value of the first system, and calculate a sum of the first numerical value and the threshold value of the first system, to obtain a second numerical value of the first system corresponding to the data.
In a specific embodiment, the first determining module 404 is configured to invoke the smart contract to convert the second value into a second binary third value; and reading a character coding result corresponding to the third numerical value from the character coding table.
In a specific embodiment, the apparatus for encoding data characters provided in the embodiment of the present application further includes: the agreement module is used for calling the intelligent contract to acquire a session identification number corresponding to the last session record of the sending end and the receiving end; and determining a threshold value agreed with the receiving terminal in advance according to the session identification number.
In a specific embodiment, the agreement module is configured to read at least one bit of target data from the session identification number, and use the at least one bit of target data as a threshold agreed in advance with the receiving end.
Based on the same concept, the present application provides a data character decoding apparatus, which is suitable for a receiving end, and the specific implementation of the apparatus may refer to the description of the method embodiment, and the repeated parts are not described again, as shown in fig. 5, the apparatus mainly includes:
a second determining module 501, configured to determine, according to a preset character encoding table, a second numerical value of the first system corresponding to the character encoding result;
a decoding module 502, configured to decode the second numerical value by using a threshold agreed in advance with a sending end, to obtain a first numerical value of a first system;
a third determining module 503, configured to determine a decoding result based on the first value.
In a specific embodiment, the decoding module 502 is configured to convert the threshold into a first system, so as to obtain a threshold of the first system; and calculating the difference value between the second numerical value and the threshold value of the first system to obtain the first numerical value of the first system.
Based on the same concept, an embodiment of the present application further provides an electronic device, as shown in fig. 6, the electronic device mainly includes: a processor 601, a memory 602, and a communication bus 603, wherein the processor 601 and the memory 602 communicate with each other via the communication bus 603. The memory 602 stores a program executable by the processor 601, and the processor 601 executes the program stored in the memory 602 to implement the following steps:
acquiring data to be encoded uploaded by a sending end;
calling an intelligent contract of the block chain system, and converting the data into a first numerical value of a first system; encoding the first numerical value by utilizing a threshold value agreed in advance with a receiving end to obtain a second numerical value of a first system corresponding to the data; and determining a character coding result corresponding to the second numerical value according to a preset character coding table.
The communication bus 603 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 603 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
The Memory 602 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one storage device located remotely from the processor 601.
The Processor 601 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like, and may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
In still another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute a method of character encoding of data or a method of character decoding of data described in the above-described embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes, etc.), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for character encoding of data, the method being adapted for use in a blockchain system, the method comprising:
acquiring data to be encoded uploaded by a sending end;
calling an intelligent contract of the block chain system, and converting the data into a first numerical value of a first system; encoding the first numerical value by utilizing a threshold value agreed with a receiving end in advance to obtain a second numerical value of a first system corresponding to the data; and determining a character coding result corresponding to the second numerical value according to a preset character coding table.
2. The method as claimed in claim 1, wherein the encoding the first value by using a threshold predetermined by a receiving end to obtain a second value of the first system corresponding to the data comprises:
and calling the intelligent contract to convert the threshold value into a first system to obtain a threshold value of the first system, and calculating the sum of the first numerical value and the threshold value of the first system to obtain a second numerical value of the first system corresponding to the data.
3. The method for character encoding of data according to claim 1, wherein the determining the character encoding result corresponding to the second numerical value according to a preset character encoding table comprises:
calling the intelligent contract to convert the second numerical value into a third numerical value of a second system;
and reading a character coding result corresponding to the third numerical value from the character coding table.
4. The method according to any one of claims 1 to 3, wherein the last session record of the transmitting end and the receiving end is stored in the blockchain system; before encoding the first value by using a threshold agreed in advance with a receiving end, the method further includes:
calling the intelligent contract to obtain a session identification number corresponding to the last session record of the sending end and the receiving end;
and determining a threshold value agreed with the receiving terminal in advance according to the session identification number.
5. The method for encoding characters of data according to claim 4, wherein the determining the threshold value agreed in advance with the receiving end according to the session identification number comprises:
and reading at least one bit of target data from the session identification number, and taking the at least one bit of target data as a threshold value agreed with the receiving terminal in advance.
6. A method for decoding characters of data, the method being adapted for a receiving end, the method comprising:
determining a second numerical value of the first system corresponding to the character coding result according to a preset character coding table;
decoding the second numerical value by using a threshold value agreed with a sending end in advance to obtain a first numerical value of a first system;
determining a decoding result based on the first value.
7. The method for decoding data characters according to claim 6, wherein the decoding the second value by using a threshold agreed in advance with a transmitting end to obtain a first value of a first system includes:
converting the threshold value into a first system to obtain a threshold value of the first system;
and calculating the difference value between the second numerical value and the threshold value of the first system to obtain the first numerical value of the first system.
8. A system for character encoding and decoding of data, comprising: a block chain system and a receiving end;
the block chain system is used for acquiring data to be coded uploaded by a sending end; calling an intelligent contract of the blockchain system to convert the data into a first numerical value of a first system; encoding the first numerical value by using a threshold value agreed in advance with a target receiving end to obtain a second numerical value of a first system corresponding to the data; determining a character coding result corresponding to the second numerical value according to a preset character coding table; sending the character coding result to the receiving end;
the receiving end is used for determining a second numerical value of the first system corresponding to the character coding result according to a preset character coding table; decoding the second numerical value by using a threshold value agreed with a sending end in advance to obtain a first numerical value of a first system; determining a decoding result based on the first value.
9. An electronic device, comprising: the system comprises a processor, a memory and a communication bus, wherein the processor and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor is configured to execute the program stored in the memory to implement the method for encoding characters of data according to any one of claims 1 to 5 or the method for decoding characters of data according to claim 6 or 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements a method for character encoding of data according to any one of claims 1 to 5 or a method for character decoding of data according to claim 6 or 7.
CN202210193676.1A 2022-03-01 2022-03-01 Method, system, equipment and storage medium for encoding and decoding characters of data Active CN114626338B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210193676.1A CN114626338B (en) 2022-03-01 2022-03-01 Method, system, equipment and storage medium for encoding and decoding characters of data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210193676.1A CN114626338B (en) 2022-03-01 2022-03-01 Method, system, equipment and storage medium for encoding and decoding characters of data

Publications (2)

Publication Number Publication Date
CN114626338A true CN114626338A (en) 2022-06-14
CN114626338B CN114626338B (en) 2024-10-29

Family

ID=81899696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210193676.1A Active CN114626338B (en) 2022-03-01 2022-03-01 Method, system, equipment and storage medium for encoding and decoding characters of data

Country Status (1)

Country Link
CN (1) CN114626338B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024061138A1 (en) * 2022-09-20 2024-03-28 华为技术有限公司 Data coding and data decoding method and apparatus, and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107181600A (en) * 2017-07-27 2017-09-19 锐捷网络股份有限公司 A kind of password login authentication method, system and user equipment and certificate server
CN110932822A (en) * 2019-12-02 2020-03-27 泰康保险集团股份有限公司 Data encoding method, data decoding method, device, equipment and storage medium
CN112307369A (en) * 2019-07-31 2021-02-02 腾讯科技(深圳)有限公司 Short link processing method, device, terminal and storage medium
CN112711935A (en) * 2020-12-11 2021-04-27 中国科学院深圳先进技术研究院 Encoding method, decoding method, apparatus and computer readable storage medium
CN113535997A (en) * 2021-06-21 2021-10-22 广州房者荣耀网络科技有限公司 Processing method, system, device and storage medium for storing image-text data into block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107181600A (en) * 2017-07-27 2017-09-19 锐捷网络股份有限公司 A kind of password login authentication method, system and user equipment and certificate server
CN112307369A (en) * 2019-07-31 2021-02-02 腾讯科技(深圳)有限公司 Short link processing method, device, terminal and storage medium
CN110932822A (en) * 2019-12-02 2020-03-27 泰康保险集团股份有限公司 Data encoding method, data decoding method, device, equipment and storage medium
CN112711935A (en) * 2020-12-11 2021-04-27 中国科学院深圳先进技术研究院 Encoding method, decoding method, apparatus and computer readable storage medium
CN113535997A (en) * 2021-06-21 2021-10-22 广州房者荣耀网络科技有限公司 Processing method, system, device and storage medium for storing image-text data into block chain

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024061138A1 (en) * 2022-09-20 2024-03-28 华为技术有限公司 Data coding and data decoding method and apparatus, and device

Also Published As

Publication number Publication date
CN114626338B (en) 2024-10-29

Similar Documents

Publication Publication Date Title
CA3090716A1 (en) Two-dimensional code generation and identification
CN107395209B (en) Data compression method, data decompression method and equipment thereof
CN110445860B (en) Message sending method, device, terminal equipment and storage medium
US9998145B2 (en) Data processing method and device
CN107919943B (en) Method and device for coding and decoding binary data
CN105450232A (en) Encoding method, decoding method, encoding device and decoding device
Munuera Steganography and error-correcting codes
CN101843102A (en) Data sequence compression
CN110717151B (en) Digital fingerprint processing and signature processing method
CN112995199B (en) Data encoding and decoding method, device, transmission system, terminal equipment and storage medium
CN114626338B (en) Method, system, equipment and storage medium for encoding and decoding characters of data
CN114051006A (en) Data transmission method, data transmission device, computer equipment and storage medium
CN110545106A (en) Method and device for coding time series data
CN114492316B (en) Data exchange coding and decoding method and system
CN110381056B (en) Netty-based private protocol coding and decoding method and apparatus
CN116156072B (en) Steganographic image generation method, steganographic information extraction method and related devices
CN113162628B (en) Data encoding method, data decoding method, terminal and storage medium
CN108962289B (en) Method and device for appending hidden identification data based on optical disc synchronous frame
CN113688601B (en) Watermark generation method and device based on form, electronic equipment and computer medium
CN111178010B (en) Method and system for displaying digital signature, data editing method and terminal
CN108108267B (en) Data recovery method and device
CN114070470A (en) Encoding and decoding method and device
CN114726480A (en) Data encoding method and related device, electronic equipment and storage medium
CN115510811A (en) Character string encoding and decoding methods, encoding device and decoding device
CN113283215B (en) Data confusion method and device based on UTF-32 coding

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