CN116669003A - Data processing method, device, electronic equipment and storage medium - Google Patents

Data processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116669003A
CN116669003A CN202310672754.0A CN202310672754A CN116669003A CN 116669003 A CN116669003 A CN 116669003A CN 202310672754 A CN202310672754 A CN 202310672754A CN 116669003 A CN116669003 A CN 116669003A
Authority
CN
China
Prior art keywords
data
cplc
value
conversion
target
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.)
Pending
Application number
CN202310672754.0A
Other languages
Chinese (zh)
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 Hefei Technology Co ltd
Original Assignee
Shenzhen Hefei 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 Hefei Technology Co ltd filed Critical Shenzhen Hefei Technology Co ltd
Priority to CN202310672754.0A priority Critical patent/CN116669003A/en
Publication of CN116669003A publication Critical patent/CN116669003A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • H04W12/033Protecting confidentiality, e.g. by encryption of the user plane, e.g. user's traffic
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a data processing method, a device, electronic equipment and a storage medium, wherein the method is applied to a first terminal and comprises the steps of obtaining initial CPLC data to be encoded, adopting a preset first conversion strategy to perform character conversion processing on a data value of a target type in the initial CPLC data to obtain first CPLC data, performing hash operation processing on the first CPLC data to obtain a first hash value, performing character conversion processing on the data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion strategy to obtain second CPLC data, and transmitting information of the second CPLC data and the first conversion strategy to the second terminal. By adopting the embodiment of the invention, the check code can be provided for the CPLC data under the condition that the specific value of the data value in the CPLC data is not modified, so that the second terminal can determine the integrity of the CPLC data used according to the check code when using the CPLC data, avoid using wrong CPLC data and improve the reliability of the CPLC data.

Description

Data processing method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer software security technologies, and in particular, to a data processing method, a data processing device, an electronic device, and a storage medium.
Background
In the near field wireless communication technology (Near Field Communication, NFC), card production lifecycle identification information (Card Production Life Cycle, CPLC) is one important identification data of an eSE chip, and is generally used as a dispersion factor that participates in chip key calculation.
In the related art, the encoding of the CPLC data generally transmits and stores the CPLC data in a hexadecimal encoding manner, specifically, the CPLC data is divided into a plurality of small blocks, each small block contains 2-4 hexadecimal characters, a long string of 84 bytes is formed by the small blocks according to the sequence, and is used as CPLC encoded data, and then the CPLC encoded data is transmitted and stored.
However, in the process of encoding the CPLC data in the related art, there is a case that the hexadecimal encoding of the CPLC data is easy to generate an error or miss a character due to the longer CPLC data, which ultimately results in that a user uses the wrong CPLC data, thereby affecting the normal work of the user.
Disclosure of Invention
The embodiment of the invention aims to provide a data processing method, a device, electronic equipment and a storage medium, so as to solve the technical problem that a user uses wrong CPLC data because the CPLC data is easy to have error transmission or missing characters in the encoding process.
In a first aspect, an embodiment of the present invention provides a data processing method, applied to a first terminal, where the method includes:
acquiring initial CPLC data to be encoded, wherein the initial CPLC data comprises at least one letter type data value;
performing character conversion processing on a target type data value in the initial CPLC data by adopting a preset first conversion strategy to obtain first CPLC data, wherein the target type data value is a letter type data value;
carrying out hash operation processing on the first CPLC data to obtain a first hash value;
performing character conversion processing on the data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion strategy to obtain second CPLC data, wherein the first conversion strategy and the second conversion strategy are opposite conversion strategies;
and sending the second CPLC data and the information of the first conversion strategy to a second terminal.
In a second aspect, an embodiment of the present invention provides a data processing method, applied to a second terminal, where the method includes:
receiving second CPLC data and information of a first conversion strategy sent by a first terminal;
According to the first conversion strategy, performing character conversion processing on a data value of a target type in the second CPLC data to obtain third CPLC data, wherein the target type is a letter type;
performing hash operation processing on the third CPLC data to obtain a second hash value;
and determining the integrity of the second CPLC data according to the second hash value.
In order to solve the same technical problem, an embodiment of the present invention provides a data processing apparatus, applied to a first terminal, including:
the device comprises an acquisition module, a coding module and a coding module, wherein the acquisition module is used for acquiring initial CPLC data to be coded, and the initial CPLC data comprises at least one letter type data value;
the first conversion module is used for carrying out character conversion processing on a data value of a target type in the initial CPLC data by adopting a preset first conversion strategy to obtain first CPLC data, wherein the target type is a letter type;
the first operation module is used for carrying out hash operation processing on the first CPLC data to obtain a first hash value;
the second conversion module is used for performing character conversion processing on the data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion strategy to obtain second CPLC data, wherein the first conversion strategy and the second conversion strategy are opposite conversion strategies;
And the sending module is used for sending the second CPLC data and the information of the first conversion strategy to a second end.
In some embodiments, the first conversion policy includes a policy to convert data values of alphabetic types to capital letters;
the first conversion module is specifically configured to convert a data value of a target type in the initial CPLC data into a capital letter by adopting a preset first conversion policy, so as to obtain first CPLC data;
the second conversion module comprises a first determination unit, a second determination unit and a first processing unit;
the first determining unit is configured to determine a first target position of the data value of the target type in the first CPLC data;
the second determining unit is configured to determine a first data value at the first target position in the first hash value;
and the first processing unit is used for converting the data value of the target type corresponding to the first target position in the first CPLC data into a lower case letter by adopting a preset second conversion strategy if the first data value meets the preset condition, so as to obtain second CPLC data.
In some embodiments, the first conversion policy includes a policy to convert data values of a letter type to lower case letters;
The first conversion module is specifically configured to convert a data value of a target type in the initial CPLC data into a lower case letter by adopting a preset first conversion policy, so as to obtain first CPLC data;
the second conversion module comprises a first determination unit, a second determination unit and a second processing unit;
the first determining unit is configured to determine a first target position of the data value of the target type in the first CPLC data;
the second determining unit is configured to determine a first data value at the first target position in the first hash value;
and the second processing unit is used for converting the data value of the target type corresponding to the first target position in the first CPLC data into capital letters by adopting a preset second conversion strategy if the first data value meets the preset condition, so as to obtain second CPLC data.
In some embodiments, the target type of data value is a letter type of data value included in a target data value, the target data value is a continuous data value of a preset data length in the initial CPLC data, and the preset data length is not greater than the data length of the initial CPLC data.
In order to solve the same technical problem, an embodiment of the present invention provides a data processing apparatus, applied to a second terminal, including:
the receiving module is used for receiving the second CPLC data and the information of the first conversion strategy sent by the first terminal;
the third conversion module is used for carrying out character conversion processing on a data value of a target type in the second CPLC data according to the first conversion strategy to obtain third CPLC data, wherein the target type is a letter type;
the second operation module is used for carrying out hash operation processing on the third CPLC data to obtain a second hash value;
and the determining module is used for determining the integrity of the second CPLC data according to the second hash value.
In some embodiments, the third conversion module includes an acquisition unit, a character conversion unit;
the acquiring unit is configured to acquire a target data length of the second CPLC data subjected to character conversion processing in the first terminal;
and the character conversion unit is used for carrying out character conversion processing on the data value of the target type in the data values contained in the target data length in the second CPLC data according to the first conversion strategy to obtain third CPLC data.
In some embodiments, the first conversion policy includes a policy to convert data values of alphabetic types to capital letters;
the third conversion module is specifically configured to convert, according to the first conversion policy, a letter in a data value of a target type included in the target data length of the second CPLC data into an uppercase letter, so as to obtain third CPLC data.
In some embodiments, the first conversion policy includes a policy to convert data values of a letter type to lower case letters;
the third conversion module is specifically configured to convert, according to the first conversion policy, a letter in a data value of a target type included in the target data length of the second CPLC data into a lower case letter, to obtain third CPLC data.
In some embodiments, the determining module includes a third determining unit, a fourth determining unit, and a third processing unit;
the third determining unit is configured to determine a second target position of the data value of the target type in the second CPLC data;
the fourth determining unit is configured to determine a second data value at the second target location in the second hash value;
and the third processing unit is configured to determine that the second CPLC data is complete data if the second data value meets a preset condition and the size format of the letters in the data value of the target type is not the target format, where the target format is the size format of the letters in the data value of the target type after the character conversion processing of the first conversion policy.
In a fifth aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of any one of the data processing methods described above when executing the computer program.
In a sixth aspect, embodiments of the present invention provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the data processing methods described above.
The embodiment of the invention provides a data processing method, a device, electronic equipment and a storage medium, wherein the method performs character conversion processing on CPLC data through CPLC data, hash values corresponding to the CPLC data and a preset conversion strategy, can realize encoding processing on the CPLC data, provides a check code capable of performing integrity check for the CPLC data, improves the reliability of the CPLC data, and can obtain the hash values according to hash operation when a subsequent second terminal uses the CPLC data, and performs check on the integrity of the CPLC data according to the hash values and the adopted conversion strategy, thereby realizing the purpose of performing data check on the CPLC data and preventing the occurrence of error transmission or missing of characters when the CPLC data is used or transmitted.
Drawings
Fig. 1 is an application scenario diagram of CPLC data usage provided by an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a data processing method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a character conversion process according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another process of character conversion according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of another data processing method according to an embodiment of the present invention;
FIG. 6 is a schematic flow chart of a data verification process according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a second conversion module according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of another structure of a data processing apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a third conversion module according to an embodiment of the present invention;
FIG. 11 is a schematic diagram of a determining module according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of another electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
In the related art, the encoding of the CPLC data generally transmits and stores the CPLC data in a hexadecimal encoding manner, specifically, the CPLC data is divided into a plurality of small blocks, each small block contains 2-4 hexadecimal characters, a long string of 84 bytes is formed by the small blocks according to the sequence, and is used as CPLC encoded data, and then the CPLC encoded data is transmitted and stored.
However, in the encoding of CPLC data in the related art, there are the following drawbacks:
1. because CPLC data is longer, the condition that characters are lost or lost easily occurs in the hexadecimal encoding process, so that data errors or incomplete data are caused;
2. the encoding mode of CPLC data does not adopt error correction code and other technologies to carry out data verification and correction, and the integrity of the CPLC data used cannot be effectively ensured;
3. the encoding mode of CPLC data does not consider the data encryption and security problems, and is easy to be influenced by malicious tampering and attack of the data.
Therefore, a new CPLC coding technology is needed to solve the above problems.
In order to solve the technical problems in the related art, an embodiment of the present invention provides a data processing method, please refer to fig. 1, fig. 1 is an application scenario diagram of CPLC data use provided in the embodiment of the present invention, wherein fig. 1 shows a first terminal 10, and the first terminal 10 is mainly used for obtaining CPLC data and performing encoding processing on the CPLC data, so as to provide a check code capable of performing integrity check for the CPLC data, and improve the reliability of the CPLC data. In fig. 1, 20 represents a second terminal, and the second terminal 20 is mainly used for using or transmitting CPLC data, and before using or transmitting, it needs to determine whether the CPLC data used is correct or complete, so that incorrect CPLC data is avoided, and normal operation of a user is affected.
Specifically, referring to fig. 1, the CPLC data provided in the embodiment of the present invention is first subjected to encoding processing by the first terminal 10, and after the encoded CPLC data with a check code is obtained, the CPLC data is sent to the second terminal 20. After the second terminal 20 receives the encoded CPLC data with the check code, it performs data check on the CPLC data with the check code to determine the integrity of the received CPLC data, and after confirming that the received CPLC data is complete, the received CPLC data can be used or transmitted, thereby achieving the purpose of performing data check on the CPLC data before use or transmission, and preventing the occurrence of errors or missing characters when using or transmitting the CPLC data.
The data processing method provided in this embodiment may be applied to the first terminal 10 to implement the encoding process of the CPLC data. Specifically, referring to fig. 2, fig. 2 is a schematic flow chart of a data processing method according to an embodiment of the present invention, where the method includes steps 201 to 205;
step 201, obtain initial CPLC data to be encoded.
The initial CPLC data provided in this embodiment includes at least one data value of a letter type.
In this embodiment, the CPLC data is data that is required in the NFC technology, and the CPLC data may be obtained from an integrated circuit Card (Smart Card) Card or may be obtained from IC Card information input by a user by the NFC technology, so the method and process for obtaining the CPLC data are not limited in this embodiment. The CPLC data provided in this embodiment is mainly used for identifying and verifying the validity of the IC card, and the CPLC data includes manufacturer information of the IC card, serialization information of the IC card, production date information of the IC card, and the like.
The initial CPLC data provided in this embodiment is CPLC data that needs to be encoded. Specifically, the CPLC data is typically a long string of 84 bytes, and the initial CPLC data provided in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
step 202, performing character conversion processing on a data value of a target type in the initial CPLC data by adopting a preset first conversion strategy to obtain first CPLC data.
In this embodiment, the target type is a letter type, for example, the data value of the target type provided in this embodiment may be a data value corresponding to "F", "B", "D" and "F" in the initial CPLC data provided in the foregoing embodiment. The first conversion strategy provided in this embodiment is a pre-established strategy, and the first conversion strategy is mainly used for performing character conversion processing on the data value of the letter type in the CPLC data. Specifically, the first conversion policy provided in this embodiment may perform the character conversion processing on the data value corresponding to "F", "B", "D" and "F" in the initial CPLC data provided in the foregoing embodiment.
After the initial CPLC data is obtained, the initial CPLC data needs to be preprocessed, so that subsequent encoding operations can be performed on the preprocessed initial CPLC data. Specifically, the preprocessing is the character conversion processing corresponding to the first conversion policy provided in this embodiment, where the character conversion processing provided in this embodiment mainly converts the case format of the letter type data value, and by converting the case format of the letter type data value only, the preprocessing of the initial CPLC data can be completed without modifying the data value in the initial CPLC data, and under the condition that the integrity of the initial CPLC data is ensured, so that the encoding operation of the preprocessed initial CPLC data can be performed subsequently.
In one embodiment, the first conversion policy includes a policy of converting a data value of a letter type into a capital letter, and the step of performing character conversion processing on a data value of a target type in the initial CPLC data by using a preset first conversion policy to obtain first CPLC data may be: and converting the data value of the target type in the initial CPLC data into capital letters by adopting a preset first conversion strategy to obtain first CPLC data.
Illustratively, the initial CPLC data provided by the present embodiment may be:
479007644701f3560600917409140030136748100000005100000449483bdf5380010000000000354647
the first CPLC data obtained after the character conversion process is performed on the initial CPLC data by the first conversion policy is:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
in this embodiment, the character conversion process is performed on the data values "F", "B", "D" and "F" of the four letter types in the initial CPLC data, so as to obtain "F", "B", "D" and "F".
In another embodiment, the first conversion policy includes a policy of converting a data value of a letter type into a lower case letter, and the step of performing character conversion processing on a data value of a target type in the initial CPLC data by using a preset first conversion policy to obtain first CPLC data may be: and converting the data value of the target type in the initial CPLC data into a lower case letter by adopting a preset first conversion strategy to obtain a first CPLC number.
Illustratively, the initial CPLC data provided by the present embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
the first CPLC data obtained after the character conversion process is performed on the initial CPLC data by the first conversion policy is:
479007644701f3560600917409140030136748100000005100000449483bdf5380010000000000354647
in this embodiment, the character conversion process is performed on the data values "F", "B", "D" and "F" of the four letter types in the initial CPLC data, so as to obtain "F", "B", "D" and "F".
In step 203, a hash operation is performed on the first CPLC data to obtain a first hash value.
In this embodiment, the hash operation provided in this embodiment may be an operation performed by using the SHA secure hash algorithm. Specifically, the SHA secure hash algorithm provided in this embodiment may be SHA1, SHA256, SHA384, or other algorithms. By carrying out hash operation processing on the first CPLC data, a first hash value corresponding to the first CPLC data can be generated, so that character conversion processing is conveniently carried out on the first CPLC data based on the first hash value, the purpose of providing check codes for the first CPLC data is achieved, and the safety and reliability of the first CPLC data are improved.
Illustratively, the first CPLC data provided in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
then hash operation is performed on the first CPLC data, and the obtained first hash value is:
14d2fd9806bfdcdd291a859dfff7ea0cdfcd77adfa1ea86b723e223d8b96c8cd243f848c2db4468f2ba34ddf03470a26
and 204, performing character conversion processing on the data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion strategy to obtain second CPLC data.
In this embodiment, the first conversion policy and the second conversion policy are opposite conversion policies, for example, when the first conversion policy is a policy of converting a data value of a letter type into a capital letter, the second conversion policy is a policy of converting a data value of a letter type into a lowercase letter; conversely, when the first conversion policy is a policy of converting a letter type data value into a lower case letter, then the second conversion policy is a policy of converting a letter type data value into an upper case letter.
As an alternative embodiment, this embodiment determines whether to perform character conversion processing on the data value of the target type in the first CPLC data by using the second conversion policy according to the data value in the same position in the first hash value as the data value of the letter type in the first CPLC data.
In this embodiment, according to the first CPLC data, the first hash value and the preset second conversion policy, character conversion processing is performed on the CPLC data to obtain second CPLC data, and a data value of a letter type in the second CPLC data can be used as a check code, so that the second CPLC data has a function of performing data check, and when the second CPLC data is used by the second terminal, the second CPLC data can be checked to determine the integrity of the second CPLC data, and the data value in the second CPLC data is prevented from being changed due to malicious tampering or attack in the transmission process of the second CPLC data, thereby effectively improving the reliability and security of the CPLC data.
In one embodiment, the first conversion policy may be a policy for converting a data value of a letter type into an uppercase letter, and the second conversion policy used in the process of performing the character conversion processing on a data value of a target type in the first CPLC data is a policy for converting a data value of a letter type into a lowercase letter, specifically, please refer to fig. 3, fig. 3 is a schematic flow chart of the character conversion processing provided in the embodiment of the present invention, and as shown in fig. 3, steps 2041 to 2043 are included;
In step 2041, a first target location of the data value of the target type in the first CPLC data is determined.
Illustratively, the first CPLC data provided in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
the first target position of the target type of data value (letter type of data value) in the first CPLC data may be determined, specifically, the first target position of the target type of data value "F" in the first CPLC data is the position of the 13 th data value, the first target position of the target type of data value "B" in the first CPLC data is the position of the 60 th data value, the first target position of the target type of data value "D" in the first CPLC data is the position of the 61 st data value, and the first target position of the target type of data value "F" in the first CPLC data is the position of the 62 th data value.
At step 2042, a first data value at a first target location in the first hash value is determined.
Illustratively, the first hash value corresponding to the first CPLC data provided in this embodiment is:
14d2fd9806bfdcdd291a859dfff7ea0cdfcd77adfa1ea86b723e223d8b96c8cd243f848c2db4468f2ba34ddf03470a26
the first data value at the first target position in the first hash value may be determined, specifically, the first data value is d when the first target position is the 13 th data value, the first data value is 6 when the first target position is the 60 th data value, the first data value is c when the first target position is the 61 th data value, and the first data value is 8 when the first target position is the 62 th data value.
Step 2043, if the first data value meets the preset condition, converting the data value corresponding to the target type at the first target position in the first CPLC data into a lower case letter by using a preset second conversion strategy, so as to obtain second CPLC data.
In this embodiment, the preset condition provided in this embodiment is determined based on a magnitude relation between the first data value and the preset threshold, and in particular, in one case, the preset condition provided in this embodiment may be that the first data value is not greater than the preset threshold; in another case, the preset condition provided by the present embodiment may be that the first data value is greater than the preset threshold. Since the CPLC data provided in this embodiment is data composed of hexadecimal data, the preset threshold provided in this embodiment may be 6 or 7, and the preset threshold is not limited in this embodiment, and any data value in hexadecimal may be used, that is, any data value in 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and a, b, c, d, e, f may be used.
As an optional embodiment, the preset threshold adopted in this embodiment may be 8, and the preset condition adopted in this embodiment may be that the first data value is not greater than the preset threshold 8, and illustratively, the first CPLC data adopted in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
The first hash value corresponding to the first CPLC data is:
14d2fd9806bfdcdd291a859dfff7ea0cdfcd77adfa1ea86b723e223d8b96c8cd243f848c2db4468f2ba34ddf03470a26
it may be determined that the first data values are d, 6, c, 8, respectively, and thus it may be determined that the first data value d does not satisfy the preset condition, the first data value 6 satisfies the preset condition, the first data value c does not satisfy the preset condition, and the first data value 8 satisfies the preset condition. At this time, the second conversion strategy is adopted to convert the data value of the target type corresponding to the same position in the first CPLC data, which satisfies the preset condition, into a lowercase letter, specifically, convert the data value "B" of the target type corresponding to the same position in the first CPLC data, which corresponds to the first data value 6, into a lowercase letter "B", and convert the data value "F" of the target type corresponding to the same position in the first CPLC data, which corresponds to the first data value 8, into a lowercase letter "F". Thus, the second CPLC data can be obtained:
479007644701F3560600917409140030136748100000005100000449483bDf5380010000000000354647
in another embodiment, the first conversion policy may be a policy of converting a data value of a letter type into a lower case letter, and the second conversion policy adopted in the process of performing the character conversion processing on the data value of a target type in the first CPLC data is a policy of converting the data value of the letter type into a lower case letter, specifically, please refer to fig. 4, fig. 4 is another flow chart of the character conversion processing provided by the embodiment of the present invention, as shown in fig. 4, including steps 2044 to 2046;
In step 2044, a first target location of the data value of the target type in the first CPLC data is determined.
Illustratively, the first CPLC data provided in this embodiment may be:
479007644701f3560600917409140030136748100000005100000449483bdf5380010000000000354647
the first target position of the target type of data value (letter type of data value) in the first CPLC data may be determined, specifically, the first target position of the target type of data value "f" in the first CPLC data is the position of the 13 th data value, the first target position of the target type of data value "b" in the first CPLC data is the position of the 60 th data value, the first target position of the target type of data value "d" in the first CPLC data is the position of the 61 st data value, and the first target position of the target type of data value "f" in the first CPLC data is the position of the 62 th data value.
At step 2045, a first data value at a first target location in the first hash value is determined.
Illustratively, the first hash value corresponding to the first CPLC data provided in the foregoing embodiment is:
14d2fd9806bfdcdd291a859dfff7ea0cdfcd77adfa1ea86b723e223d8b96c8cd243f848c2db4468f2ba34ddf03470a26
the first data value at the first target position in the first hash value may be determined, specifically, the first data value is d when the first target position is the 13 th data value, the first data value is 6 when the first target position is the 60 th data value, the first data value is c when the first target position is the 61 th data value, and the first data value is 8 when the first target position is the 62 th data value.
Step 2046, if the first data value meets the preset condition, converting the data value corresponding to the target type at the first target position in the first CPLC data into capital letters by using a preset second conversion strategy, so as to obtain second CPLC data.
As an optional embodiment, the preset threshold adopted in this embodiment may be 8, and the preset condition adopted in this embodiment may be that the first data value is not greater than the preset threshold 8, and illustratively, the first CPLC data adopted in this embodiment is:
479007644701f3560600917409140030136748100000005100000449483bdf5380010000000000354647
the first hash value corresponding to the first CPLC data is as follows:
14d2fd9806bfdcdd291a859dfff7ea0cdfcd77adfa1ea86b723e223d8b96c8cd243f848c2db4468f2ba34ddf03470a26
it may be determined that the first data values are d, 6, c, 8, respectively, and thus it may be determined that the first data value d does not satisfy the preset condition, the first data value 6 satisfies the preset condition, the first data value c does not satisfy the preset condition, and the first data value 8 satisfies the preset condition. At this time, the second conversion strategy is adopted to convert the data value of the target type corresponding to the same position in the first CPLC data, which satisfies the preset condition, into a lowercase letter, specifically, convert the data value "B" of the target type corresponding to the same position in the first CPLC data, which corresponds to the first data value 6, into a uppercase letter "B", and convert the data value "F" of the target type corresponding to the same position in the first CPLC data, which corresponds to the first data value 8, into a uppercase letter "F". Thus, the second CPLC data can be obtained:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
And step 205, transmitting the second CPLC data and the information of the first conversion strategy to the second terminal.
After the second CPLC data is obtained, the second CPLC data and the information of the first conversion strategy are sent to the second terminal, so that the second terminal can perform data verification on the second CPLC data according to the first conversion strategy when using the second CPLC data, the integrity of the second CPLC data received by the second terminal is determined, and the situation that the use of wrong CPLC data is avoided to influence the normal work of a user is avoided.
As an optional embodiment, the data value of the target type provided in this embodiment is a data value of a letter type included in the target data value, the target data value is a continuous data value of a preset data length in the initial CPLC data, and the preset data length is not greater than the data length of the initial CPLC data.
In one case, the preset data length provided in this embodiment may be equal to the data length of the initial CPLC data, so the data values of the target types provided in this embodiment are the data values of all the target types included in the initial CPLC data. Illustratively, the initial CPLC data provided by the present embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
The data value of the target type provided in this embodiment includes "F", "B", "D" and "F".
In another case, the preset data length provided in this embodiment may be 1/3 of the data length of the initial CPLC data, and the continuous data value corresponding to 1/3 may be a continuous data value at any position in the initial CPLC data, for example, the continuous data value corresponding to 1/3 may be a continuous data value calculated from the first data value of the initial CPLC data, and the continuous data value corresponding to 1/3 may also be a continuous data value calculated from the second data value of the initial CPLC data, as long as the position corresponding to 1/3 is in the initial CPLC data, which is not limited herein.
Illustratively, the initial CPLC data provided by the present embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
the preset data length provided in this embodiment, that is, the continuous data value corresponding to 1/3, may be a continuous data value calculated from the first data value of the initial CPLC data, that is, only the data value of the target type is determined from the first 28 data values (479007644701F 35606009174091) of the initial CPLC data, and then the data value of the target type provided in this embodiment is only "F".
In other cases, the preset data length provided in this embodiment may be 1/2 of the data length of the initial CPLC data, and the continuous data value corresponding to 1/2 may be a continuous data value at any position in the initial CPLC data, for example, the continuous data value corresponding to 1/2 may be a continuous data value calculated from the first data value of the initial CPLC data, and the continuous data value corresponding to 1/2 may also be a continuous data value calculated from the forty-second data value of the initial CPLC data, as long as the position corresponding to 1/2 is in the initial CPLC data, which is not limited herein.
Illustratively, the initial CPLC data provided by the present embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
the preset data length provided in this embodiment, that is, the continuous data value corresponding to 1/2 may be a continuous data value calculated from the forty-second data value of the initial CPLC data, that is, only the data value of the target type is determined from the last 42 data values (000005100000449483 BDF 5380010000000000354647) of the initial CPLC data, and the data value of the target type provided in this embodiment includes "B", "D" and "F".
It should be noted that, the preset data length provided in this embodiment is not limited to 1/3 or 1/2 of the data length of the initial CPLC data, but may be other values, which are not exemplified herein.
In this way, the embodiment of the invention can only encode the continuous data value with the preset data length in the initial CPLC data, thereby realizing the character conversion processing of only the target type data value in the continuous data value with the preset data length in the initial CPLC data, and further improving the safety and reliability of the encoded second CPLC data. In particular, for the detailed process of performing the encoding operation on the continuous data value with the preset data length in the initial CPLC data, refer to the above embodiment of performing the encoding operation on the initial CPLC data, which is not described herein again.
When the first terminal 10 performs the encoding operation processing on only the continuous data value with the preset data length in the initial CPLC data to obtain the second CPLC data, and sends the second CPLC data to the second terminal 20, the second terminal 10 also performs the data verification processing on only the continuous data value with the preset data length in the received second CPLC data, thereby achieving the purpose of performing the data verification on the received CPLC data, and avoiding using erroneous CPLC data to affect the normal operation of the user.
To this end, the first terminal 10 completes the encoding process of the initial CPLC data.
The above embodiments mainly describe a technical solution of applying the data processing method provided in this embodiment to the first terminal 10, that is, a process of encoding initial CPLC data. The following describes in detail the data verification process performed on the second CPLC data by the second terminal 20, which is the technical solution that the data processing method provided in this embodiment is applied to the second terminal 20, that is, before the second terminal 20 uses or transmits the received second CPLC data.
Referring to fig. 5, fig. 5 is another flow chart of the data processing method according to the embodiment of the present invention, as shown in fig. 5, the data processing method according to the embodiment of the present invention includes steps 501 to 504;
and step 501, receiving second CPLC data and information of a first conversion strategy sent by the first terminal.
In this embodiment, when the information of the second CPLC data and the first conversion policy sent by the first terminal is received, the purpose of performing data verification on the received second CPLC data can be achieved through the second CPLC data and the first conversion policy, so that the use of erroneous second CPLC data is avoided, and the normal work of the user is affected. For specific data verification, please refer to the following steps 502 to 504.
And step 502, performing character conversion processing on the data value of the target type in the second CPLC data according to the first conversion strategy to obtain third CPLC data.
In this embodiment, the target type is a letter type. The first conversion policy provided in this embodiment is a first conversion policy used by the first terminal 10, and the first conversion policy is mainly used for performing character conversion processing on the data value of the letter type in the CPLC data.
In this embodiment, the first conversion policy used by the first terminal 10 is adopted to perform character conversion processing on the target type of data value in the second CPLC data received by the second terminal 20, so that the second CPLC data is converted into first CPLC data obtained by preprocessing the initial CPLC data by the first terminal 10, and the third CPLC data obtained by performing character conversion processing on the initial CPLC data by using the second CPLC data in the following manner, that is, the hash value of the first CPLC data obtained by preprocessing the initial CPLC data by the first terminal 10 is convenient, and the data verification is performed on the second CPLC data, thereby achieving the purpose of performing data verification on the received second CPLC data.
As an alternative embodiment, since the first terminal 10 provided in this embodiment may perform the encoding operation processing on only the continuous data value of the preset data length in the initial CPLC data, so as to perform the character conversion processing on only the data value of the target type in the continuous data value of the preset data length in the initial CPLC data, the second terminal 20 provided in this embodiment needs to determine the target data length processed by the first terminal 10 during the character conversion processing before performing the data verification on the second CPLC data. Specifically, the step of performing character conversion processing on the data value of the target type in the second CPLC data according to the first conversion policy to obtain the third CPLC data may be: and acquiring the target data length of the second CPLC data subjected to character conversion processing in the first terminal, and performing character conversion processing on the data value of the target type in the data values contained in the target data length in the second CPLC data according to the first conversion strategy to obtain third CPLC data.
It should be noted that, the target data length provided in this embodiment is the preset data length for performing the encoding operation in the first terminal 10, and therefore, the target data length is also the same as the preset data length, so the target data length provided in this embodiment may be the same data length as the data length of the second CPLC data, or may be any number of data lengths such as 1/3 or 1/2 of the data length of the second CPLC data, so long as the target data length is the same as the preset data length, and the position where the continuous data value in the target data length in the second CPLC data is located is the same as the position where the continuous data value in the preset data length for performing the character conversion process in the first terminal 10 is located in the initial CPLC data, which is not particularly limited herein.
In one embodiment, the first conversion policy includes a policy of converting a data value of a letter type into an uppercase letter, and the step of performing, according to the first conversion policy, character conversion processing on the data value of the target type in the data value included in the target data length in the second CPLC data, to obtain third CPLC data may be: and converting letters in the data value of the target type contained in the target data length in the second CPLC data into capital letters according to the first conversion strategy to obtain third CPLC data.
Illustratively, the target data length provided in this embodiment may be the same data length as the data length of the second CPLC data, and the second CPLC data provided in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483bDf5380010000000000354647
the third CPLC data obtained after the character conversion process is performed on the second CPLC data by the first conversion policy is:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
in this embodiment, the data values "F", "B", "D" and "F" of the four letter types in the second CPLC data are subjected to the character conversion process to obtain "F", "B", "D" and "F".
In another embodiment, the first conversion policy includes a policy of converting a data value of a letter type into a lower case letter, and the step of performing, according to the first conversion policy, character conversion processing on the data value of the target type in the data values included in the target data length in the second CPLC data, to obtain third CPLC data may be: and converting letters in the data value of the target type contained in the target data length in the second CPLC data into lower case letters according to the first conversion strategy to obtain third CPLC data.
Illustratively, the target data length provided in this embodiment may be the same data length as the data length of the second CPLC data, and the second CPLC data provided in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
The third CPLC data obtained after the character conversion process is performed on the second CPLC data by the first conversion policy is:
479007644701f3560600917409140030136748100000005100000449483bdf5380010000000000354647
in this embodiment, the data values "F", "B", "D" and "F" of the four letter types in the second CPLC data are subjected to the character conversion process to obtain "F", "B", "D" and "F".
In step 503, hash operation is performed on the third CPLC data to obtain a second hash value.
In this embodiment, the SHA secure hash algorithm adopted in the hash operation processing procedure provided in this embodiment may be a SHA384 algorithm.
Illustratively, the third CPLC data provided in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
then hash operation processing is performed on the third CPLC data by using SHA384 algorithm, and the processing procedure for obtaining the second hash value may be:
SHA384(479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647)
=>
14d2fd9806bfdcdd291a859dfff7ea0cdfcd77adfa1ea86b723e223d8b96c8cd243f848c2db4468f2ba34ddf03470a26
step 504, determining the integrity of the second CPLC data according to the second hash value.
In this embodiment, the integrity of the second CPLC data is determined based on the uniqueness of the hash value obtained by the hash operation processing. Specifically, if the second CPLC data obtained by the second terminal 20 is correct and complete, the third CPLC data obtained by performing the character conversion process corresponding to the first conversion policy on the second CPLC should be identical to the first CPLC data obtained by preprocessing the initial CPLC by the first terminal 10, and since the second terminal 20 cannot know whether the third CPLC data is identical to the first CPLC data obtained by the first terminal 10, the embodiment determines the integrity of the second CPLC data received by the second terminal 20 by using the characteristic that the hash value corresponding to the identical data is identical, and using the hash value of the first CPLC data and the processing rule of performing the character conversion process on the target type data value in the first CPLC data by using the hash value of the first CPLC data and the second conversion policy (the policy opposite to the first conversion policy).
As an alternative embodiment, this embodiment determines whether the data value of the corresponding target type in the second CPLC data has undergone the character conversion process of the second conversion policy in the first terminal 10 according to the data value in the same position in the second hash value as the data value of the target type of the letter type in the second CPLC data, thereby determining the correctness of the data value of the target type in the second CPLC. That is, in this embodiment, the correctness of the target type of data value in the second CPLC is determined by determining the relation between the case format of the target value in the second CPLC data and whether the data value at the corresponding position in the second hash value satisfies the preset condition. In this way, the data value of the target type in the second CPLC data provided in this embodiment is equivalent to the check code capable of performing data check processing, so that the second CPLC data can be subjected to data check, thereby effectively improving the reliability and safety of the CPLC data, and avoiding that the second terminal 20 uses the second CPLC data that is wrong or incomplete, and affecting the normal operation of the second terminal 20.
In some embodiments, please refer to fig. 6, fig. 6 is a flow chart of a data verification process provided in the embodiment of the present invention, as shown in fig. 6, including steps 5041 to 5043;
In step 5041, a second target location of the data value of the target type in the second CPLC data is determined.
Illustratively, the second CPLC data provided in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483bDf5380010000000000354647
the second target position of the target type of data value (letter type of data value) in the second CPLC data may be determined, specifically, the second target position of the target type of data value "F" in the second CPLC data is the position of the 13 th data value, the second target position of the target type of data value "b" in the second CPLC data is the position of the 60 th data value, the second target position of the target type of data value "D" in the second CPLC data is the position of the 61 st data value, and the second target position of the target type of data value "F" in the second CPLC data is the position of the 62 th data value.
Step 5042, determining a second data value at a second target location in the second hash value.
The second hash value corresponding to the third CPLC data provided in the foregoing embodiment is exemplified as:
14d2fd9806bfdcdd291a859dfff7ea0cdfcd77adfa1ea86b723e223d8b96c8cd243f848c2db4468f2ba34ddf03470a26
the second data value at the second target position in the second hash value may be determined, specifically, the second data value is d when the second target position is the position of the 13 th data value, the second data value is 6 when the second target position is the position of the 60 th data value, the second data value is c when the second target position is the position of the 61 th data value, and the second data value is 8 when the second target position is the position of the 62 th data value.
In step 5043, if the second data value meets the preset condition and the size format of the letter in the data value of the target type is not the target format, the second CPLC data is determined to be complete data.
In this embodiment, the target format is a size format of letters in the data value of the target type after the character conversion processing of the first conversion policy. The preset conditions provided in this embodiment are the same as the preset conditions set in the first terminal 10, that is, the preset conditions provided in this embodiment are determined based on the magnitude relation between the second data value and the preset threshold, and specifically, in one case, the preset conditions provided in this embodiment may be that the second data value is not greater than the preset threshold; in another case, the preset condition provided by the present embodiment may be that the second data value is greater than the preset threshold. Since the CPLC data provided in this embodiment is data composed of hexadecimal data, the preset threshold provided in this embodiment may be 6 or 7, and the preset threshold is not limited in this embodiment, and any data value in hexadecimal may be used, that is, any data value in 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and a, b, c, d, e, f may be used.
In one embodiment, the first conversion policy adopted in the embodiment may be a policy of converting a data value of a letter type into a capital letter, and the target format provided in the embodiment is a capital format, that is, it is required to determine that the second CPLC data is complete data when it is detected that the second data value meets a preset condition and the size format of the letter in the data value of the target type is not the capital format.
Specifically, the preset threshold value adopted in this embodiment may be 8, and the preset condition adopted in this embodiment may be that the second data value is not greater than the preset threshold value 8, and illustratively, the second CPLC data adopted in this embodiment may be:
479007644701F3560600917409140030136748100000005100000449483bDf5380010000000000354647
the third CPLC data is:
479007644701F3560600917409140030136748100000005100000449483BDF5380010000000000354647
the second hash value corresponding to the third CPLC data is:
14d2fd9806bfdcdd291a859dfff7ea0cdfcd77adfa1ea86b723e223d8b96c8cd243f848c2db4468f2ba34ddf03470a26
it may be determined that the second data values are d, 6, c, 8, respectively, and thus it may be determined that the second data value d does not satisfy the preset condition, the second data value 6 satisfies the preset condition, the second data value c does not satisfy the preset condition, and the second data value 8 satisfies the preset condition.
In this embodiment, if the second data value is detected to satisfy the preset condition and the size format of the letters in the data value of the target type is not the target format, the second CPLC data is determined to be complete data, that is, if the second data value is detected to be not greater than the preset threshold 8 and the size format of the letters in the data value of the target type is detected to be not the upper case format, the second CPLC data can be determined to be complete data. Therefore, the data verification method provided in this embodiment specifically includes: if the second data value d does not meet the preset condition, the second data value d corresponds to the data value "F" of the target type in the second CPLC data and should be in the uppercase format; if the second data value 6 meets the preset condition, the data value "b" of the second CPLC data corresponding to the target type should not be in the uppercase format but should be in the lowercase format; if the second data value c does not meet the preset condition, the second data value c corresponds to the data value "D" of the target type in the second CPLC data and should be in capitalization format; if the second data value 8 satisfies the preset condition, the second data value 8 corresponds to the data value "f" of the target type in the second CPLC data, which should not be in uppercase format but should be in lowercase format.
Based on the specific data verification process provided in the foregoing embodiment, it can be known that the size format of the data value of the target type in the second CPLC data provided in the present embodiment passes the data verification, so it can be determined that the second CPLC data provided in the present embodiment is integrity.
In another embodiment, the first conversion policy may also be a policy of converting a data value of a letter type into a lower case letter, and the target format provided in this embodiment is a lower case format, that is, it is required to determine that the second CPLC data is complete data when it is detected that the second data value meets a preset condition and the size format of the letter in the data value of the target type is not the lower case format. The specific data verification process refers to the method provided in the above embodiment, and is not described herein.
So far, the second terminal 20 completes the data verification process for the second CPLC data.
The method according to the above embodiment will be further described from the point of view of a data processing apparatus, which may be implemented as a separate entity or may be implemented as an integrated electronic device, such as a terminal, which may include a mobile phone, a tablet computer, etc.
In some embodiments, a data processing apparatus is provided in this embodiment, where the data processing apparatus is applied to a first terminal, and in particular, please refer to fig. 7, fig. 7 is a schematic structural diagram of the data processing apparatus provided in the embodiment of the present invention, and as shown in fig. 7, a data processing apparatus 700 provided in the embodiment of the present invention includes: an acquisition module 701, a first conversion module 702, a first operation module 703, a second conversion module 704, and a transmission module 705;
the acquiring module 701 is configured to acquire initial CPLC data to be encoded.
Wherein the initial CPLC data includes at least one letter-type data value.
The first conversion module 702 is configured to perform a character conversion process on a data value of a target type in the initial CPLC data by using a preset first conversion policy, so as to obtain first CPLC data.
Wherein the target type is a letter type.
In one embodiment, the first conversion policy includes a policy of converting a data value of a letter type into an uppercase letter, and the first conversion module 702 is specifically configured to convert a data value of a target type in the initial CPLC data into the uppercase letter by adopting a preset first conversion policy, so as to obtain first CPLC data.
In another embodiment, the first conversion policy includes a policy of converting a data value of a letter type into a lower case letter, and the first conversion module 702 is specifically configured to convert a data value of a target type in the initial CPLC data into a lower case letter by adopting a preset first conversion policy, so as to obtain first CPLC data.
In some embodiments, the data value of the target type is a data value of a letter type included in the target data value, the target data value is a continuous data value of a preset data length in the initial CPLC data, and the preset data length is not greater than the data length of the initial CPLC data.
The first operation module 703 is configured to perform a hash operation on the first CPLC data to obtain a first hash value.
And the second conversion module 704 is configured to perform character conversion processing on a data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion policy, so as to obtain second CPLC data.
The first conversion strategy and the second conversion strategy are mutually opposite conversion strategies.
And the sending module 705 is configured to send the second CPLC data and the information of the first conversion policy to the second end.
In some embodiments, please refer to fig. 8, fig. 8 is a schematic structural diagram of a second conversion module according to an embodiment of the present invention, as shown in fig. 8, the second conversion module 704 includes a first determining unit 7041, a second determining unit 7042, and a first processing unit 7043;
The first determining unit 7041 is configured to determine a first target position of the data value of the target type in the first CPLC data. The second determining unit 7042 is configured to determine a first data value at a first target position in the first hash value. The first processing unit 7043 is configured to, if the first data value meets a preset condition, convert, by using a preset second conversion policy, a data value corresponding to a target type at a first target position in the first CPLC data into a lower case letter, thereby obtaining second CPLC data.
As an alternative embodiment, please continue to refer to fig. 8, the second conversion module 704 provided in this embodiment includes a first determining unit 7041, a second determining unit 7042, and a second processing unit 7044;
the first determining unit 7041 is configured to determine a first target position of the data value of the target type in the first CPLC data. The second determining unit 7042 is configured to determine a first data value at a first target position in the first hash value. The second processing unit 7044 is configured to, if the first data value meets a preset condition, convert, using a preset second conversion policy, a data value corresponding to a target type at a first target position in the first CPLC data into an uppercase letter, thereby obtaining second CPLC data.
In other embodiments, the present embodiment provides a data processing apparatus, which is applied to a second terminal, and in particular, please refer to fig. 9, fig. 9 is another schematic structural diagram of the data processing apparatus provided in the embodiment of the present invention, and as shown in fig. 9, the data processing apparatus 900 provided in the embodiment of the present invention includes: a receiving module 901, a third converting module 902, a second operation module 903, and a determining module 904;
the receiving module 901 is configured to receive second CPLC data and information of a first conversion policy sent by a first terminal.
And the third conversion module 902 is configured to perform character conversion processing on the data value of the target type in the second CPLC data according to the first conversion policy, so as to obtain third CPLC data.
Wherein the object type is a letter type.
In some embodiments, please refer to fig. 10, fig. 10 is a schematic structural diagram of a third conversion module according to an embodiment of the present invention, as shown in fig. 10, a third conversion module 902 includes an obtaining unit 9021 and a character conversion unit 9022;
the acquiring unit 9021 is configured to acquire a target data length of the second CPLC data subjected to the character conversion processing in the first terminal. And the character conversion unit 9022 is configured to perform character conversion processing on the data value of the target type in the data values included in the target data length in the second CPLC data according to the first conversion policy, so as to obtain third CPLC data.
In one embodiment, the first conversion policy includes a policy of converting a data value of a letter type into an uppercase letter, and the third conversion module 902 is specifically configured to convert, according to the first conversion policy, a letter in a data value of a target type included in a target data length in the second CPLC data into an uppercase letter, to obtain third CPLC data.
In another embodiment, the first conversion policy includes a policy of converting a data value of a letter type into a lower case letter, and the third conversion module 902 is specifically configured to convert, according to the first conversion policy, a letter in a data value of a target type included in a target data length in the second CPLC data into a lower case letter, to obtain third CPLC data.
The second operation module 903 is configured to perform hash operation on the third CPLC data to obtain a second hash value.
A determining module 904, configured to determine the integrity of the second CPLC data according to the second hash value.
In some embodiments, please refer to fig. 11, fig. 11 is a schematic structural diagram of a determining module provided in an embodiment of the present invention, and as shown in fig. 11, the determining module 904 includes a third determining unit 9041, a fourth determining unit 9042, and a third processing unit 9043;
The third determining unit 9041 is configured to determine a second target position of the data value of the target type in the second CPLC data. A fourth determining unit 9042 is configured to determine a second data value at a second target position in the second hash value. And the third processing unit 9043 is configured to determine that the second CPLC data is complete data if the second data value meets a preset condition and the size format of the letters in the data value of the target type is not the target format, where the target format is the size format of the letters in the data value of the target type after the character conversion processing of the first conversion policy.
In the implementation, each module and/or unit may be implemented as an independent entity, or may be combined arbitrarily and implemented as the same entity or a plurality of entities, where the implementation of each module and/or unit may refer to the foregoing method embodiment, and the specific beneficial effects that may be achieved may refer to the beneficial effects in the foregoing method embodiment, which are not described herein again.
In addition, referring to fig. 12, fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device may be a mobile terminal, such as a smart phone, a tablet computer, or the like. As shown in fig. 12, the electronic device 1200 includes a processor 1201, a memory 1202. Wherein the processor 1201 is electrically connected to the memory 1202.
The processor 1201 is a control center of the electronic device 1200, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device 1200 and processes data by running or loading application programs stored in the memory 1202, and calling data stored in the memory 1202, thereby performing overall monitoring of the electronic device 1200.
In this embodiment, the processor 1201 in the electronic device 1200 loads instructions corresponding to the processes of one or more application programs into the memory 1202 according to the following steps, and the processor 1201 executes the application program stored in the memory 1202, so as to implement any step of the data processing method provided in the foregoing embodiment.
The electronic device 1200 may implement the steps in any embodiment of the data processing method provided by the embodiment of the present invention, so that the beneficial effects that any one of the data processing methods provided by the embodiment of the present invention can implement are described in detail in the previous embodiments, and are not described herein.
Referring to fig. 13, fig. 13 is another schematic structural diagram of an electronic device according to an embodiment of the present invention, and fig. 13 is a specific structural block diagram of the electronic device according to the embodiment of the present invention, where the electronic device may be used to implement the data processing method provided in the foregoing embodiment. The electronic device 1300 may be a mobile terminal such as a smart phone or a notebook computer.
The RF circuit 1310 is configured to receive and transmit electromagnetic waves, and to perform mutual conversion between the electromagnetic waves and the electrical signals, so as to communicate with a communication network or other devices. RF circuitry 1310 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and the like. The RF circuitry 1310 may communicate with various networks such as the internet, intranets, wireless networks, or with other devices via wireless networks. The wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. The wireless network may use various communication standards, protocols, and technologies including, but not limited to, global system for mobile communications (Global System for Mobile Communication, GSM), enhanced mobile communications technology (Enhanced Data GSM Environment, EDGE), wideband code division multiple access technology (Wideband Code Division Multiple Access, WCDMA), code division multiple access technology (Code Division Access, CDMA), time division multiple access technology (Time Division Multiple Access, TDMA), wireless fidelity technology (Wireless Fidelity, wi-Fi) (e.g., institute of electrical and electronics engineers standards IEEE 802.11a,IEEE 802.11b,IEEE802.11g and/or IEEE802.11 n), internet telephony (Voice over Internet Protocol, voIP), worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, wi-Max), other protocols for mail, instant messaging, and short messaging, as well as any other suitable communication protocols, even including those not currently developed.
The memory 1320 may be used to store software programs and modules, such as program instructions/modules corresponding to the data processing methods in the embodiments described above, and the processor 1380 may execute various functional applications and data processing by executing the software programs and modules stored in the memory 1320.
Memory 1320 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 1320 may further include memory located remotely from processor 1380, which may be connected to electronic device 1300 over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 1330 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, input unit 1330 may include a touch-sensitive surface 1331 and other input devices 1332. Touch-sensitive surface 1331, also referred to as a touch display screen or touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on touch-sensitive surface 1331 or thereabout by any suitable object or accessory such as a finger, stylus, etc.) and actuate the corresponding connection device according to a predetermined program. Alternatively, touch-sensitive surface 1331 may include both a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 1380, and can receive commands from the processor 1380 and execute them. In addition, the touch-sensitive surface 1331 may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. In addition to touch-sensitive surface 1331, input unit 1330 may also include other input devices 1332. In particular, other input devices 1332 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 1340 may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of the electronic device 1300, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 1340 may include a display panel 1341, and alternatively, the display panel 1341 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 1331 may overlay the display panel 1341, and upon detection of a touch operation thereon or thereabout by the touch-sensitive surface 1331, the touch-sensitive surface is communicated to the processor 1380 to determine the type of touch event, and the processor 1380 then provides a corresponding visual output on the display panel 1341 in accordance with the type of touch event. Although in the figures the touch-sensitive surface 1331 and the display panel 1341 are implemented as two separate components for input and output functions, in some embodiments the touch-sensitive surface 1331 may be integrated with the display panel 1341 to implement the input and output functions.
The electronic device 1300 may also include at least one sensor 1350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 1341 according to the brightness of ambient light, and a proximity sensor that may generate an interrupt when the flip cover is closed or closed. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device 1300 are not described in detail herein.
Audio circuitry 1360, speaker 1361, microphone 1362 may provide an audio interface between a user and the electronic device 1300. The audio circuit 1360 may transmit the received electrical signal after audio data conversion to the speaker 1361, where the electrical signal is converted to a sound signal by the speaker 1361 and output; on the other hand, the microphone 1362 converts the collected sound signals into electrical signals, which are received by the audio circuit 1360 and converted into audio data, which are processed by the audio data output processor 1380 and transmitted to, for example, another terminal via the RF circuit 1310, or which are output to the memory 1320 for further processing. Audio circuitry 1360 may also include earbud jacks to provide communications of peripheral headphones with electronic device 1300.
The electronic device 1300 may facilitate user reception of requests, transmission of information, etc. via a transmission module 1370 (e.g., wi-Fi module), which provides wireless broadband internet access to the user. Although the transmission module 1370 is shown in the drawings, it is understood that it does not belong to the essential constitution of the electronic device 1300, and can be omitted entirely as required within the scope not changing the essence of the invention.
Processor 1380 is a control center of electronic device 1300, utilizing various interfaces and lines to connect the various parts of the overall handset, to perform various functions of electronic device 1300 and process data by running or executing software programs and/or modules stored in memory 1320, and invoking data stored in memory 1320, thereby performing overall monitoring of the electronic device. Optionally, processor 1380 may include one or more processing cores; in some embodiments, processor 1380 may integrate an application processor primarily handling operating systems, user interfaces, applications, etc., with a modem processor primarily handling wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1380.
The electronic device 1300 also includes a power supply 1390 (e.g., a battery) that provides power to the various components, and in some embodiments, may be logically coupled to the processor 1380 via a power management system to enable management of charge, discharge, and power consumption by the power management system. The power supply 1390 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the electronic device 1300 further includes a camera (e.g., front camera, rear camera), a bluetooth module, etc., which will not be described in detail herein. In particular, in this embodiment, the display unit of the electronic device is a touch screen display, and the mobile terminal further includes a memory, and one or more programs, where the one or more programs are stored in the memory, and configured to be executed by the one or more processors to implement any step of the data processing method provided in the foregoing embodiment.
In the implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or several entities, and the implementation of each module may be referred to the foregoing method embodiment, which is not described herein again.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a storage medium having stored therein a plurality of instructions which, when executed by a processor, enable to implement any one of the steps of the data processing method provided in the above embodiment.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The steps in any embodiment of the data processing method provided by the embodiment of the present application can be executed by the instructions stored in the storage medium, so that the beneficial effects that can be achieved by any data processing method provided by the embodiment of the present application can be achieved, and detailed descriptions of the foregoing embodiments are omitted herein.
The foregoing has described in detail a data processing method, apparatus, electronic device and storage medium according to embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only for aiding in understanding the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application. Moreover, it will be apparent to those skilled in the art that various modifications and variations can be made without departing from the principles of the present application, and such modifications and variations are also considered to be within the scope of the application.

Claims (13)

1. A data processing method, applied to a first terminal, the method comprising:
acquiring initial CPLC data to be encoded, wherein the initial CPLC data comprises at least one letter type data value;
performing character conversion processing on a data value of a target type in the initial CPLC data by adopting a preset first conversion strategy to obtain first CPLC data, wherein the target type is a letter type;
carrying out hash operation processing on the first CPLC data to obtain a first hash value;
performing character conversion processing on the data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion strategy to obtain second CPLC data, wherein the first conversion strategy and the second conversion strategy are opposite conversion strategies;
and sending the second CPLC data and the information of the first conversion strategy to a second terminal.
2. The method of claim 1, wherein the first conversion strategy comprises a strategy to convert data values of alphabetic types to capital letters;
the character conversion processing is performed on the data value of the target type in the initial CPLC data by adopting a preset first conversion strategy, so as to obtain first CPLC data, which comprises the following steps:
Converting a data value of a target type in the initial CPLC data into an uppercase letter by adopting a preset first conversion strategy to obtain first CPLC data;
the performing character conversion processing on the data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion policy to obtain second CPLC data, including:
determining a first target position of the data value of the target type in the first CPLC data;
determining a first data value at the first target location in the first hash value;
and if the first data value meets the preset condition, adopting a preset second conversion strategy to convert the data value of the target type corresponding to the first target position in the first CPLC data into a lower case letter to obtain second CPLC data.
3. The method of claim 1, wherein the first conversion strategy comprises a strategy to convert data values of a letter type into lower case letters;
the character conversion processing is performed on the data value of the target type in the initial CPLC data by adopting a preset first conversion strategy, so as to obtain first CPLC data, which comprises the following steps:
Converting a data value of a target type in the initial CPLC data into a lower case letter by adopting a preset first conversion strategy to obtain first CPLC data;
the performing character conversion processing on the data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion policy to obtain second CPLC data, including:
determining a first target position of the data value of the target type in the first CPLC data;
determining a first data value at the first target location in the first hash value;
and if the first data value meets the preset condition, adopting a preset second conversion strategy to convert the data value of the target type corresponding to the first target position in the first CPLC data into capital letters to obtain second CPLC data.
4. A method according to claim 2 or 3, wherein the data value of the target type is a data value of a letter type contained in a target data value, the target data value being a continuous data value of a preset data length in the initial CPLC data, the preset data length being not greater than the data length of the initial CPLC data.
5. A data processing method, applied to a second terminal, the method comprising:
receiving second CPLC data and information of a first conversion strategy sent by a first terminal;
according to the first conversion strategy, performing character conversion processing on a data value of a target type in the second CPLC data to obtain third CPLC data, wherein the target type is a letter type;
performing hash operation processing on the third CPLC data to obtain a second hash value;
and determining the integrity of the second CPLC data according to the second hash value.
6. The method of claim 5, wherein performing character conversion processing on the target type of data value in the second CPLC data according to the first conversion policy to obtain third CPLC data, includes:
acquiring a target data length of the second CPLC data subjected to character conversion processing in the first terminal;
and according to the first conversion strategy, performing character conversion processing on the data value of the target type in the data values contained in the target data length in the second CPLC data to obtain third CPLC data.
7. The method of claim 6, wherein the first conversion strategy comprises a strategy to convert data values of a letter type into capital letters;
And performing character conversion processing on a data value of a target type in data values contained in a target data length in the second CPLC data according to the first conversion strategy to obtain third CPLC data, wherein the character conversion processing comprises the following steps:
and converting the data value of the target type contained in the target data length in the second CPLC data into capital letters according to the first conversion strategy to obtain third CPLC data.
8. The method of claim 6, wherein the first conversion strategy comprises a strategy to convert data values of a letter type into lower case letters;
and performing character conversion processing on a data value of a target type in data values contained in a target data length in the second CPLC data according to the first conversion strategy to obtain third CPLC data, wherein the character conversion processing comprises the following steps:
and converting the data value of the target type contained in the target data length in the second CPLC data into a lower case letter according to the first conversion strategy to obtain third CPLC data.
9. The method of claim 7 or 8, wherein said determining the integrity of the second CPLC data based on the second hash value comprises:
determining a second target position of the data value of the target type in the second CPLC data;
Determining a second data value at the second target location in the second hash value;
if the second data value meets the preset condition and the size format of the letters in the data value of the target type is not the target format, determining that the second CPLC data is complete data, wherein the target format is the size format of the letters in the data value of the target type after the character conversion processing of the first conversion strategy.
10. A data processing apparatus, applied to a first terminal, comprising:
the device comprises an acquisition module, a coding module and a coding module, wherein the acquisition module is used for acquiring initial CPLC data to be coded, and the initial CPLC data comprises at least one letter type data value;
the first conversion module is used for carrying out character conversion processing on a data value of a target type in the initial CPLC data by adopting a preset first conversion strategy to obtain first CPLC data, wherein the target type is a letter type;
the first operation module is used for carrying out hash operation processing on the first CPLC data to obtain a first hash value;
the second conversion module is used for performing character conversion processing on the data value of the target type in the first CPLC data according to the first CPLC data, the first hash value and a preset second conversion strategy to obtain second CPLC data, wherein the first conversion strategy and the second conversion strategy are opposite conversion strategies;
And the sending module is used for sending the second CPLC data and the information of the first conversion strategy to a second end.
11. A data processing apparatus, characterized in that it is applied to a second terminal, said data processing apparatus comprising:
the receiving module is used for receiving the second CPLC data and the information of the first conversion strategy sent by the first terminal;
the third conversion module is used for carrying out character conversion processing on a data value of a target type in the second CPLC data according to the first conversion strategy to obtain third CPLC data, wherein the target type is a letter type;
the second operation module is used for carrying out hash operation processing on the third CPLC data to obtain a second hash value;
and the determining module is used for determining the integrity of the second CPLC data according to the second hash value.
12. An electronic device comprising a processor, a memory and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1 to 9 when the computer program is executed.
13. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the steps in the method according to any one of claims 1 to 9.
CN202310672754.0A 2023-06-07 2023-06-07 Data processing method, device, electronic equipment and storage medium Pending CN116669003A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310672754.0A CN116669003A (en) 2023-06-07 2023-06-07 Data processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310672754.0A CN116669003A (en) 2023-06-07 2023-06-07 Data processing method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116669003A true CN116669003A (en) 2023-08-29

Family

ID=87711527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310672754.0A Pending CN116669003A (en) 2023-06-07 2023-06-07 Data processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116669003A (en)

Similar Documents

Publication Publication Date Title
CN109992453B (en) System recovery method and related product
KR20180091055A (en) Key storage method, key management method and device
WO2018161540A1 (en) Fingerprint registration method and related product
CN104901805A (en) Identity authentication method and device and system
CN109714476B (en) Data processing method and device, mobile terminal and storage medium
CN110730017A (en) Radio frequency device, control method thereof and terminal equipment
US11138041B2 (en) Method for automatically releasing resource occupied by process in background of terminal, storage medium and terminal
CN110096320B (en) Authentication window display method and device
CN108156537B (en) Remote operation method of mobile terminal and mobile terminal
CN110287655B (en) Verification code input method and device and mobile terminal
CN109413256B (en) Contact person information processing method and device, storage medium and electronic equipment
CN108932486B (en) Fingerprint matching method and device and electronic device
CN110851014B (en) Touch recognition method and device, storage medium and terminal equipment
CN111064847B (en) False touch prevention method and device, storage medium and electronic equipment
CN109600514B (en) Unlocking control method and device, mobile terminal and storage medium
CN116669003A (en) Data processing method, device, electronic equipment and storage medium
CN112235783B (en) Multi-SIM card management control method and device, storage medium and mobile terminal
CN110849407B (en) Sensor testing method and device, storage medium and electronic equipment
CN109831770B (en) Pairing method and device of mobile terminal, storage medium and mobile terminal
CN112379905A (en) Kernel upgrading method and device, terminal and storage medium
CN112380520A (en) Screen unlocking method and device, storage medium and mobile terminal
CN112381545A (en) Identity authentication method, device, equipment and storage medium
CN115883839B (en) Image verification method, device, equipment and computer readable storage medium
CN112633770A (en) Asset state judgment method and device, storage medium and electronic equipment
CN107204882B (en) Method and equipment for filtering data packet and mobile terminal

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