Data storage method, device, terminal and storage medium

By querying the encrypted information in the database and combining it with the target data to store it in the text data block of the picture file, the problem of insufficient data security in the prior art is solved, and high security of encrypted storage and reading is achieved.

CN113204548BActive Publication Date: 2024-11-22BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110425605.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-20
Publication Date
2024-11-22
Estimated Expiration
2041-04-20

AI Technical Summary

Technical Problem

In the prior art, encrypted data is stored in shared object binary files, which is poor in security and is difficult to effectively protect the privacy of data.

Method used

通过从数据库查询目标数据的加密信息与目标数据进行组合,将加密数据存储至图片文件中的文本数据块,利用加密信息进行加密存储和读取,确保在不知道加密信息的情况下无法读取 data.

Benefits of technology

Significantly improves data security, ensuring high-level protection during storage and reading, and preventing unauthorized access.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113204548B_ABST
    Figure CN113204548B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data storage method, device, terminal and storage medium, and belongs to the field of computer technology. The method comprises: querying the encryption information corresponding to the field to which the target data belongs from a database, wherein the database is used to store the encryption information corresponding to at least one field; combining the encryption information with the target data to obtain the encrypted data corresponding to the target data; and storing the encrypted data in a text data block in an image file. The method uses the encryption information and the target data to encrypt, so that the target data needs to be read using the encryption information later, thereby improving the security of the data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data storage method, device, terminal and storage medium. Background Art

[0002] With the development of computer technology, the requirements for data security are becoming higher and higher. In order to improve data security, it is usually necessary to encrypt the data so that the encrypted data can be stored.

[0003] In the related art, the encrypted data is obtained by encrypting the original data. Generally, the encrypted data is stored by directly storing the data, such as storing the encrypted data in a so (SharedObject) binary file. The security of storing encrypted data in this way is poor. Therefore, how to improve the security of data is an important research direction. Summary of the invention

[0004] The present invention provides a data storage method, device, terminal and storage medium, which improve the security of data.

[0005] According to one aspect of an embodiment of the present disclosure, a data storage method is provided, the data storage method comprising:

[0006] Querying encryption information corresponding to a field to which target data belongs from a database, wherein the database is used to store encryption information corresponding to at least one field;

[0007] Combining the encrypted information with the target data to obtain encrypted data corresponding to the target data;

[0008] The encrypted data is stored in a text data block in the image file.

[0009] The method provided by the embodiment of the present disclosure obtains encryption information corresponding to the target data through a database, uses the encryption information to encrypt the target data, and stores the obtained encrypted data in a picture file, thereby realizing encrypted storage of the target data based on the picture file, and encrypting the target data by combining the encryption information with the target data, so that the encryption information needs to be used to read the target data later. If the encryption information corresponding to the target data is unknown, the data cannot be read from the picture file, thereby improving the security of the data.

[0010] In some embodiments, combining the encrypted information with the target data to obtain encrypted data corresponding to the target data includes:

[0011] The encrypted information, the target data and a symbol are combined to obtain the encrypted data.

[0012] In the disclosed embodiment, encryption is performed by combining encryption information, target data and symbols, so that when the data is subsequently read, not only the encryption information but also the symbols used in the combination need to be known, further improving the security of the data.

[0013] In some embodiments, before storing the encrypted data in a text data block in a picture file, the data storage method further includes:

[0014] Acquire at least one type of data stored in the image file, where each type of data is used to indicate the type of the data block corresponding to each type of data;

[0015] Determine target type data from the at least one type data, wherein the target type data is used to indicate that the data block corresponding to the target type data belongs to a text type;

[0016] The data block corresponding to the target type data is determined as the text data block.

[0017] In some embodiments, since the encrypted data needs to be stored in a text data block in the picture file, the text data block is determined based on the type data in the picture file to achieve positioning of the text data block.

[0018] In some embodiments, determining the data block corresponding to the target type data as the text data block includes:

[0019] Acquire the number of bytes adjacent to the target type data from the picture file, where the number of bytes is used to indicate the number of bytes included in the text data block;

[0020] In the picture file, the bytes of the number of bytes starting from the target type data are determined as the text data block.

[0021] In the disclosed embodiment, a data block is composed of multiple bytes. According to the number of adjacent bytes of the target type data, it is possible to more accurately determine which bytes are included in the text data block, thereby making the position of the located text data block more precise.

[0022] In some embodiments, determining target type data from the at least one type of data comprises:

[0023] Acquire protocol information of the image file, where the protocol information includes a correspondence between type data and the type to which the data block belongs;

[0024] According to the corresponding relationship, the target type data corresponding to the text type is determined from the at least one type data.

[0025] In the disclosed embodiment, the type of the data block corresponding to the type data is determined based on the protocol information of the image file, thereby ensuring the uniformity of the correspondence between the type data and the type to which the data block belongs, and avoiding different correspondences for different image files.

[0026] In some embodiments, storing the encrypted data into a text data block in a picture file includes:

[0027] In response to the text data block not existing in the picture file or the text data block existing in the picture file already storing data, creating a new text data block in the picture file;

[0028] The encrypted data is stored in the new text data block.

[0029] In an embodiment of the present disclosure, a picture file can include multiple text data blocks. When there is no text data block that can store target data in the picture file, a new text data block can be created to store the data, thereby storing data in multiple text data blocks in one picture file to reduce the number of picture files.

[0030] In some embodiments, combining the encrypted information with the target data to obtain encrypted data corresponding to the target data includes:

[0031] In response to the target data being data of a character string type, the encryption information is combined with the target data to obtain the encrypted data.

[0032] In the disclosed embodiment, the text data block only stores string type data and does not store other types of data, thereby implementing the storage of string type data.

[0033] In some embodiments, after storing the encrypted data in a text data block in a picture file, the data storage method includes:

[0034] In response to receiving a data read instruction carrying the field, querying the encryption information corresponding to the field from the database;

[0035] Searching the image file for a text data block in the stored encrypted data that has the same encryption information as the encryption information;

[0036] The target data is read from the queried text data block.

[0037] In the disclosed embodiment, encryption information is queried from a data block and target data is read from a picture file using the queried encryption information to achieve data reading. Without knowing the encryption information, data cannot be read from the picture file, thereby improving data security.

[0038] In some embodiments, the step of searching the image file for a text data block in the stored encrypted data that has the same encrypted information as the encrypted information includes:

[0039] Querying the target type data corresponding to the text type from the image file, and determining at least one data block where the queried target type data is located as a text data block;

[0040] A text data block having encryption information in the stored encrypted data that is identical to the encryption information is determined from at least one of the queried text data blocks.

[0041] In the disclosed embodiment, at least one text data block in the image file is first determined, and then the text data block where the encrypted data corresponding to the encrypted information is located is determined from the determined at least one text data block. Thus, only at least one text data block needs to be queried, and there is no need to traverse all the data blocks in the image file, thereby improving the efficiency of data extraction.

[0042] According to another aspect of the embodiments of the present disclosure, there is provided a data storage device, the data storage device comprising:

[0043] An encryption information query unit is configured to query encryption information corresponding to a field to which target data belongs from a database, wherein the database is used to store encryption information corresponding to at least one field;

[0044] an encrypted data acquisition unit, configured to combine the encrypted information with the target data to obtain encrypted data corresponding to the target data;

[0045] The data storage unit is configured to execute the storage of the encrypted data into the text data block in the picture file.

[0046] In some embodiments, the encrypted data acquisition unit is configured to combine the encryption information, the target data and a symbol to obtain the encrypted data.

[0047] In some embodiments, the data storage device further comprises:

[0048] A data block determination unit is configured to execute acquisition of at least one type of data stored in the image file, each type of data being used to indicate a type to which a data block corresponding to each type of data belongs;

[0049] The data block determination unit is further configured to determine target type data from the at least one type data, wherein the target type data is used to indicate that the data block corresponding to the target type data belongs to a text type;

[0050] The data block determination unit is further configured to determine the data block corresponding to the target type data as the text data block.

[0051] In some embodiments, the data block determination unit is further configured to execute:

[0052] Acquire the number of bytes adjacent to the target type data from the picture file, where the number of bytes is used to indicate the number of bytes included in the text data block;

[0053] In the picture file, the bytes of the number of bytes starting from the target type data are determined as the text data block.

[0054] In some embodiments, the data block determination unit is further configured to execute:

[0055] Acquire protocol information of the image file, where the protocol information includes a correspondence between type data and the type to which the data block belongs;

[0056] According to the corresponding relationship, the target type data corresponding to the text type is determined from the at least one type data.

[0057] In some embodiments, the data storage unit includes:

[0058] a database creation subunit, configured to execute, in response to the absence of a text data block in the picture file or the presence of data in the text data block in the picture file already storing data, creating a new text data block in the picture file;

[0059] The data storage subunit is configured to store the encrypted data into the new text data block.

[0060] In some embodiments, the encrypted data acquisition unit is configured to execute, in response to the target data being string type data, combining the encryption information with the target data to obtain the encrypted data.

[0061] In some embodiments, the data storage device comprises:

[0062] a data reading unit, configured to execute, in response to receiving a data reading instruction carrying the field, querying the encryption information corresponding to the field from the database;

[0063] The data reading unit is further configured to execute searching the image file for a text data block in the stored encrypted data having the same encryption information as the encryption information;

[0064] The data reading unit is further configured to read the target data from the queried text data block.

[0065] In some embodiments, the data reading unit is further configured to execute:

[0066] Querying the target type data corresponding to the text type from the image file, and determining at least one data block where the queried target type data is located as a text data block;

[0067] A text data block having encryption information in the stored encrypted data that is identical to the encryption information is determined from at least one of the queried text data blocks.

[0068] According to another aspect of an embodiment of the present disclosure, a terminal is provided, the terminal comprising:

[0069] one or more processors;

[0070] a memory for storing the one or more processor-executable instructions;

[0071] The one or more processors are configured to execute the data storage method described in the above aspects.

[0072] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the data storage method described in the above aspects.

[0073] According to another aspect of an embodiment of the present disclosure, a computer program product is provided. The computer program product includes a computer program. The computer program is executed by a processor to implement the data storage method described in the above aspect.

[0074] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0076] Figure 1 The invention is a flow chart showing a data storage method according to an exemplary embodiment.

[0077] Figure 2The figure is a flow chart showing another data storage method according to an exemplary embodiment.

[0078] Figure 3 The figure is a flow chart showing another data storage method according to an exemplary embodiment.

[0079] Figure 4 The figure is a flow chart of a data reading method according to an exemplary embodiment.

[0080] Figure 5 is a flow chart showing another data reading method according to an exemplary embodiment.

[0081] Figure 6 is a block diagram of a data storage device according to an exemplary embodiment.

[0082] Figure 7 is a block diagram of another data storage device according to an exemplary embodiment.

[0083] Figure 8 It is a structural block diagram of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION

[0084] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0085] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned figure descriptions are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0086] It should be noted that the user information involved in this disclosure (including but not limited to user device information, user personal information, etc.) is all information authorized by the user or fully authorized by all parties.

[0087] The data storage method provided by the embodiments of the present disclosure can be applied to the data storage scenario of any application installed in the terminal.

[0088] For example, a user logs in to a target application based on a user account. When logging in to the target application, the user needs to enter a username and password. The terminal stores the username and password so that the user can directly obtain the stored username and password the next time he logs in without having to enter it again. The security of the username and password needs to be guaranteed. At this time, the data storage method provided by the embodiment of the present disclosure can be used. According to the field "login information" corresponding to the username and password, the encrypted information corresponding to the "login information" is queried in the database, and the encrypted information is combined with the username and password to obtain the encrypted information, and the encrypted information is stored in the text data block in the image file to realize data storage. When the username and password need to be read later, the corresponding encrypted information is queried from the database according to the "login information", and the username and password are read from the image file according to the encrypted information to realize data reading.

[0089] Figure 1 is a flowchart of a data storage method according to an exemplary embodiment. Figure 1 The execution subject of the method is a terminal, and includes the following steps:

[0090] 101. Query the encryption information corresponding to the field to which the target data belongs from the database.

[0091] Among them, the target data is any data in the terminal, the target data has a corresponding field, and the field is used to indicate the content of the target data. The database is used to store encryption information corresponding to at least one field, and the encryption information is used to encrypt the target data. Different target data corresponds to different encryption information.

[0092] 102. Combine the encrypted information with the target data to obtain encrypted data corresponding to the target data.

[0093] The encrypted information and the target data are combined, that is, the target data is encrypted using the encrypted information to obtain the encrypted data corresponding to the target data. The encrypted data includes the encrypted information and the target data, and the encrypted information and the target data can be combined in a variety of ways, but no matter which combination method is used, the encrypted information and the target data correspond to each other.

[0094] 103. Store the encrypted data into a text data block in the image file.

[0095] The picture file at least includes a text data block, which is used to store encrypted data. The picture file can be a lossless compressed bitmap format, such as a PNG (Portable Network Graphic Format) file or other types of picture files.

[0096] The method provided by the embodiment of the present disclosure obtains encryption information corresponding to the target data through a database, uses the encryption information to encrypt the target data, and stores the obtained encrypted data in a picture file, thereby realizing encrypted storage of the target data based on the picture file, and encrypting the target data by combining the encryption information with the target data, so that the encryption information is needed to read the target data later. If the encryption information corresponding to the target data is unknown, the data cannot be read from the picture file, thereby improving the security of the data.

[0097] In some embodiments, combining the encrypted information with the target data to obtain encrypted data corresponding to the target data includes:

[0098] The encrypted information, target data and symbols are combined to obtain encrypted data.

[0099] In some embodiments, before storing the encrypted data in the text data block in the image file, the data storage method further includes:

[0100] Acquire at least one type of data stored in the image file, where each type of data is used to indicate the type to which a data block corresponding to each type of data belongs;

[0101] Determine target type data from at least one type data, where the target type data is used to indicate that a data block corresponding to the target type data belongs to a text type;

[0102] The data block corresponding to the target type data is determined as a text data block.

[0103] In some embodiments, determining the data block corresponding to the target type data as a text data block includes:

[0104] From the image file, obtain the number of bytes adjacent to the target type data, where the number of bytes is used to indicate the number of bytes contained in the text data block;

[0105] In the image file, the bytes with the target type data as the starting position are determined as the text data block.

[0106] In some embodiments, determining the data block corresponding to the target type data as a text data block includes:

[0107] Obtaining protocol information of the image file, the protocol information including the correspondence between type data and the type to which the data block belongs;

[0108] According to the corresponding relationship, target type data corresponding to the text type is determined from at least one type data.

[0109] In some embodiments, storing encrypted data in a text data block in a picture file includes:

[0110] In response to the text data block not existing in the picture file or the text data block existing in the picture file already storing data, creating a new text data block in the picture file;

[0111] Store the encrypted data into a new text data block.

[0112] In some embodiments, combining the encrypted information with the target data to obtain encrypted data corresponding to the target data includes:

[0113] In response to the target data being data of a character string type, the encryption information is combined with the target data to obtain encrypted data.

[0114] In some embodiments, after storing the encrypted data in the text data block in the image file, the data storage method includes:

[0115] In response to receiving a data read instruction carrying a field, querying encryption information corresponding to the field from a database;

[0116] Searching the encrypted data stored in the image file for a text data block that has the same encryption information as the encrypted information;

[0117] Read the target data from the queried text data block.

[0118] In some embodiments, searching the image file for a text data block whose encrypted information in the stored encrypted data is the same as the encrypted information includes:

[0119] Querying the target type data corresponding to the text type from the image file, and determining at least one data block where the queried target type data is located as a text data block;

[0120] A text data block having the same encryption information as the encryption information in the stored encrypted data is determined from at least one of the queried text data blocks.

[0121] Figure 2 is a flowchart of another data storage method according to an exemplary embodiment. Figure 2 The execution subject of the method is a terminal, and includes the following steps:

[0122] 201. The terminal obtains target data to be stored.

[0123] The embodiments of the present disclosure are described by taking a target application installed in a terminal as an example, where the target application is an instant messaging application, a video application, a short video application, a game application or other applications.

[0124] Among them, the target data is the data entered by the user in the target application based on the terminal, for example, the target data is the user name, password, identity information and other data entered by the user; or, the target data is the data sent by other electronic devices to the current terminal, for example, the target data is the chat information sent by other terminals to the current terminal, or the target data is the page content sent to the terminal by the server corresponding to the target application.

[0125] In some embodiments, the terminal also obtains the field to which the target data belongs, so as to facilitate the subsequent determination of the encryption information corresponding to the target data according to the field. The field to which the target data belongs is used to indicate the content of the target data. For example, if the target data is a phone number, the corresponding field is the "contact information" field; if the target data is a link address, the corresponding field is the "link address" field.

[0126] 202. The terminal queries the database for encryption information corresponding to the field to which the target data belongs.

[0127] Among them, the database is used to store encryption information corresponding to at least one field. The encryption information corresponding to each field is pre-set, or is randomly set when the terminal stores the target data corresponding to the field for the first time. That is, after the terminal obtains the target data corresponding to the field for the first time, it randomly determines the encryption information corresponding to the field and stores the encryption information and the field in the database.

[0128] In some embodiments, for multiple applications installed in the terminal, different applications can set up corresponding databases respectively, or different applications can share a database. When sharing a database, the fields, application identifiers and encryption information need to be stored accordingly to distinguish the encryption information corresponding to the fields of different applications.

[0129] In some embodiments, the encryption information corresponding to any two fields is different, thereby avoiding reading errors when reading data based on the encryption information. In this case, when the terminal randomly sets the encryption information corresponding to the field, it is necessary to first determine the encryption information that already exists in the database, and then set the encryption information that is different from the encryption information that already exists in the database.

[0130] The terminal queries the encryption information corresponding to the field from the database according to the field to which the target data belongs, and uses the encryption information as the encryption information corresponding to the target field.

[0131] 203. The terminal combines the encrypted information with the target data to obtain encrypted data corresponding to the target data.

[0132] The terminal combines the encrypted information with the target data in any combination mode to obtain the encrypted data corresponding to the target data.

[0133] In some embodiments, the terminal combines the encrypted information, the target data and the symbol to obtain the encrypted data. The symbol is any symbol, for example, the symbol is "_", ":" or other symbols, and the symbol is one or more. This encryption method using the combination of encrypted information, target data and symbols requires not only knowing the encrypted information but also knowing the symbols used in the combination when reading the data subsequently, further improving the security of the data.

[0134] In some embodiments, when the encryption format is such that the encryption information is located before the target data and there are symbols between the encryption information and the target data, the encryption information and the target data are combined to obtain encrypted data corresponding to the target data, including: adding the encryption information before the target data and adding symbols between the encryption information and the target data to obtain the encrypted data.

[0135] Alternatively, when the encryption format is a format in which the encryption information is located after the target data and there are symbols between the encryption information and the target data, the encryption information and the target data are combined to obtain encrypted data corresponding to the target data, including: adding the encryption information after the target data and adding symbols between the encryption information and the target data to obtain the encrypted data.

[0136] In the above-mentioned method for determining encrypted data, the encrypted information and the target data can be combined in different ways. The combination methods of the encrypted information and the target data are various, and the encrypted information and the target data can also include symbols. The encrypted information and the target data are divided into two parts by the symbols, so that when the data is read subsequently, the encrypted information and the target data can be conveniently distinguished by using the symbols.

[0137] Of course, the encryption format may also be other formats, as long as the encryption format includes the encryption information and the target data. The embodiments of the present disclosure do not limit the form of the encryption format.

[0138] 204. The terminal obtains the image file.

[0139] The image file may be a lossless compressed bitmap image format, and the image file includes multiple types of data blocks, and different types of data blocks store different data. For example, the image file includes data blocks such as a file header data block, a palette data block, an image data block, a text data block, and an image end data block.

[0140] In the embodiment of the present disclosure, the terminal uses the text data block included in the picture file to store the target data. The picture file may include one or more text data blocks.

[0141] In some embodiments, the terminal saves a picture in PNG format, and the file corresponding to the picture is the picture file, that is, a PNG picture is stored in the terminal, and the picture file corresponding to the PNG picture is used as the file for storing target data. In this case, the terminal needs to store any PNG picture, and when the PNG picture is deleted later, the data stored in the corresponding picture file will be deleted; or the picture file is a picture file created by the terminal according to the format of the picture file, and no data may be stored in the data block related to the image in the picture file, that is, the terminal only uses the text data block in the picture file to store data, and there is no restriction on whether data is stored in other data blocks in the picture file.

[0142] In the embodiment of the present disclosure, the text data block includes multiple fields, each field stores different data, and the structure of the text data block is described below:

[0143] (1) The text data block includes a length field, which is used to store the number of bytes. The number of bytes is used to indicate the number of bytes contained in the text data block, that is, the number of bytes is used to indicate the length of data in the text data block.

[0144] (2) The text data block also includes a type field, which is used to store type data, and the type data is used to indicate the type of the data block. In order to facilitate the description and query of image files, the type data is represented by uppercase or lowercase ASCII code (American Standard Code for Information Interchange).

[0145] For the type field, in some embodiments, the picture file has corresponding protocol information, and the protocol information includes a correspondence between type data and the type to which the data block belongs. The terminal obtains the protocol information and determines the type data corresponding to different types based on the correspondence.

[0146] (3) The text data block also includes a data field, which is used to store data, that is, the target data stored by the terminal in the text data block is stored corresponding to the data field. The length of the data field can be 0, that is, no data can be stored in the data field.

[0147] (4) The text data block also includes a detection field, which is used to store detection data, and the detection data is used to indicate whether the type data stored in the type field and the data stored in the data field have been modified. The detection data is calculated based on the length of the type data stored in the type field and the length of the data stored in the data field. If the detection data stored in the detection field does not match the actual length of the type field and the data field, it means that the data stored in the type field or the data field has been modified. If they match, it means that they have not been modified.

[0148] In addition, for the picture file, in some embodiments, the picture file includes the following components in addition to the text data block:

[0149] (1) The picture file includes a file flag, which is used to indicate that the current file is a picture file. For any file, if the file includes a file flag, it means that the file is a picture file.

[0150] (2) The picture file includes a file header data block, which is used to indicate the starting position of the data in the file. The file header data block is the first data block in the picture file and is located at the head of the picture file, and a picture file only includes one file header data block. In some embodiments, when the picture file includes image data related to a PNG picture, the file header data block also includes brief information about the image data.

[0151] (3) The image file includes a palette data block, which is used to store color transformation data in the image. The palette data block is located before the image data block.

[0152] (4) The picture file includes an image data block, which is used to store image data. The picture file may include multiple continuous image data blocks.

[0153] (5) The image file includes an image end data block, which is used to indicate the end of the data in the file and is located at the end of the image file. For example, the image end data block includes an end mark, which indicates that the text data block ends here and the subsequent data is the data in the next data block.

[0154] (6) The image file also includes other optional data blocks besides the text data block, such as background color data block, image histogram data block, image last modified time data block, compressed text data block and other data blocks.

[0155] In some embodiments, after the terminal obtains the image file, it determines whether there is a text data block in the image file. If there is no text data block in the image file, or there is a text data block in the image file but data is already stored in the text data block, a new text data block needs to be created in the image file.

[0156] 205. The terminal determines a text data block in the image file, and stores the encrypted data in the text data block.

[0157] In the disclosed embodiment, the terminal first determines the position of the text data block in the image file, that is, first locates the text data block in the image file, and then stores the encrypted data in the determined text data block.

[0158] In some embodiments, the image file includes multiple types of data blocks, and the terminal obtains at least one type of data stored in the image file, each type of data is used to indicate the type of the data block corresponding to the type of data; from the at least one type of data, the target type of data is determined, and the target type of data is used to indicate that the data block corresponding to the target type of data belongs to the text type; the data block corresponding to the target type of data is determined as a text data block. The data block belonging to the text type indicates that the data block is a text data block.

[0159] In some embodiments, the terminal determines the target type data from at least one type of data, including: the terminal obtains protocol information of the image file, the protocol information includes a correspondence between the type data and the type to which the data block belongs, and determines the target type data corresponding to the text type from at least one type of data according to the correspondence. The target type data is determined according to the protocol information to ensure the uniformity of the correspondence between the type data and the type to which the data block belongs, and avoid using different correspondences for different image files.

[0160] In some embodiments, the terminal stores the encrypted data in the text data block, including: when the terminal creates a new text data block in the picture file, the encrypted data is stored in the new text data block, thereby storing the encrypted data in the picture file. In this case, the picture file can include multiple text data blocks, and when there is no text data block that can store the target data in the picture file, a new text data block is created to store the data, thereby storing the data in multiple text data blocks in one picture file to reduce the number of picture files.

[0161] In some embodiments, the text data block is used to store string type data, so after the terminal obtains the target data in the target application, it determines whether the data type of the target data is a string type. If the target data is a string type, the above step of storing the target data is performed, that is, the terminal combines the encryption information with the target data in response to the target data being a string type, obtains encrypted data, and stores the encrypted data in the text data block. Among them, the string type is a data type that represents text in a programming language, and the string type data includes data such as numbers, letters, and underscores.

[0162] In some embodiments, since a data block is composed of multiple bytes, the type data only determines the location of the type field in the data block, but cannot determine the location of the complete text data block. Therefore, while the terminal realizes the positioning of the text data block, it also needs to determine the number of bytes corresponding to the text data block to locate the complete text data block, so as to make the position of the located text data block more accurate. The terminal obtains the number of bytes adjacent to the target type data from the image file, and the number of bytes is used to indicate the number of bytes contained in the text data block; in the image file, the bytes of the number of bytes starting from the target type data are determined as the text data block.

[0163] The data storage process in the embodiment of the present disclosure is shown in Figure 3 As shown in the flowchart, the terminal matches the target data and the encrypted information according to the encryption format to obtain the encrypted data, adds a text data block to the image file, adds the obtained encrypted data to the newly added text data block, and saves the image file.

[0164] In addition, it should be noted that after storing the target data in the image file, the terminal can also display the PNG image to the user based on the image file. However, for the PNG image, although the target data is stored in the corresponding text data block, since the target data is stored after being encrypted based on the encryption information, when the terminal displays the PNG image, it will not display the stored target data in the PNG image. Thus, data steganographic encryption storage based on the image file is realized.

[0165] Another point that needs to be explained is that the embodiment of the present disclosure is only explained using one picture file as an example. In another embodiment, when the terminal includes multiple picture files, after the terminal stores the target data in the picture file, it also stores the file identifier and encryption information corresponding to the picture file in a database, so that when reading the data subsequently, the corresponding picture file can be determined according to the file identifier, and the data can be read from the determined picture file.

[0166] Another point that needs to be explained is that the embodiment of the present disclosure is only described by taking any target application as an example. In another embodiment, when other applications are installed in the terminal, the storage method of the data of the other applications is the same as the storage method of the data of the target application.

[0167] The method provided by the embodiment of the present disclosure obtains encryption information corresponding to the target data through a database, uses the encryption information to encrypt the target data, and stores the obtained encrypted data in a picture file, thereby realizing encrypted storage of the target data based on the picture file, and encrypting the target data by combining the encryption information with the target data, so that the encryption information needs to be used to read the target data later. If the encryption information corresponding to the target data is unknown, the data cannot be read from the picture file, thereby improving the security of the data.

[0168] In addition, since the image file uses a lossless compression algorithm to store data, and for the same amount of data, the size of the image file is smaller than that of the so binary file, because the so binary file stores not only the data but also the running code related to the data, so the image file is smaller, so that the image file can store more data for the same storage space.

[0169] In the embodiment of the present disclosure, the above Figure 2 After storing data using the data storage method shown in the figure, a corresponding data reading method can be used to read the stored data from the image file. Figure 4 The illustrated embodiment illustrates the data reading process.

[0170] Figure 4 is a flow chart of a data reading method according to an exemplary embodiment. Figure 4 The execution subject of the method is a terminal, and includes the following steps:

[0171] 401. In response to a data reading instruction carrying a field, the terminal queries encryption information corresponding to the field from a database.

[0172] The data reading instruction is used to instruct the encrypted information corresponding to the field carried by the query, and read the target data corresponding to the field.

[0173] The disclosed embodiments are described by taking the target application as an example. In some embodiments, after the terminal starts the target application and displays a certain page of the target application, a data read instruction is generated, and the data read instruction carries a field determined based on the page. In response to the data read instruction, the terminal queries the encryption information corresponding to the field from the database.

[0174] 402. The terminal searches the image file for a text data block having the same encryption information as the encryption information in the stored encrypted data.

[0175] After the terminal obtains the encrypted information, it traverses the text data blocks in the image file and queries the text data blocks whose encrypted information in the stored encrypted data is the same as the obtained encrypted information. It can then determine that the target data in the encrypted data stored in the text data block is the data to be read.

[0176] In some embodiments, the terminal queries the target type data corresponding to the text type from the image file, determines at least one data block where the queried target type data is located as a text data block, and determines a text data block matching the encryption information from the at least one queried text data block based on the encryption information. The terminal first determines at least one text data block in the image file, and then determines the text data block where the encrypted data corresponding to the encryption information is located from the determined at least one text data block, so that only at least one text data block needs to be queried, and all data blocks in the image file do not need to be traversed, thereby improving the efficiency of data extraction.

[0177] 403. The terminal reads target data corresponding to the encrypted information from the queried text data block.

[0178] When the terminal reads the target data, if the encryption information is different from the encryption information in the text data block, the target data cannot be read from the text data block. Only when the encryption information is the same as the encryption information in the text data block can the target data corresponding to the encryption information be read.

[0179] In some embodiments, the terminal reads the encrypted data from the text data block, and then determines the encryption information part and the target data part in the encrypted data according to the encryption format when the encryption information and the target data are stored, and reads the target data from the encrypted data.

[0180] The data reading process of the embodiment of the present disclosure, for example, see Figure 5 As shown in the flowchart, the terminal reads the image file, locates the text data block in the image file, reads the encrypted data from the image file, caches the encrypted data, matches the encrypted data with the encryption format, and reads the target data from the encrypted data according to the encryption information.

[0181] The method provided by the embodiment of the present disclosure queries encryption information from a data block and uses the queried encryption information to read target data from an image file to achieve data reading. If the encryption information is not known, data cannot be read from the image file, thereby improving data security.

[0182] Furthermore, at least one text data block in the image file is first determined, and then the text data block where the encrypted data corresponding to the encrypted information is located is determined from the at least one determined text data block, so that only at least one text data block needs to be queried, and there is no need to traverse all the data blocks in the image file, thereby improving the efficiency of data extraction.

[0183] Figure 6 is a block diagram of a data storage device according to an exemplary embodiment. Figure 6 , the device comprises:

[0184] The encryption information query unit 601 is configured to query the encryption information corresponding to the field to which the target data belongs from the database, and the database is used to store the encryption information corresponding to at least one field;

[0185] The encrypted data acquisition unit 602 is configured to combine the encrypted information with the target data to obtain the encrypted data corresponding to the target data;

[0186] The data storage unit 603 is configured to store the encrypted data into the text data block in the image file.

[0187] The device provided by the embodiment of the present disclosure obtains encryption information corresponding to the target data through a database, uses the encryption information to encrypt the target data, and stores the obtained encrypted data in a picture file, thereby realizing encrypted storage of the target data based on the picture file, and encrypts the target data by combining the encryption information with the target data, so that the encryption information needs to be used to read the target data later. If the encryption information corresponding to the target data is unknown, the data cannot be read from the picture file, thereby improving the security of the data.

[0188] In some embodiments, the encrypted data acquisition unit 602 is configured to combine the encryption information, the target data and the symbol to obtain the encrypted data.

[0189] In some embodiments, see Figure 7 , the data storage device further comprises:

[0190] The data block determination unit 604 is configured to execute acquisition of at least one type of data stored in the picture file, each type of data is used to indicate the type to which the data block corresponding to each type of data belongs;

[0191] The data block determination unit 604 is further configured to determine target type data from at least one type of data, where the target type data is used to indicate that the data block corresponding to the target type data belongs to a text type;

[0192] The data block determination unit 604 is further configured to determine the data block corresponding to the target type data as a text data block.

[0193] In some embodiments, see Figure 7 The data block determination unit 604 is further configured to execute:

[0194] From the image file, obtain the number of bytes adjacent to the target type data, where the number of bytes is used to indicate the number of bytes contained in the text data block;

[0195] In the image file, the bytes with the target type data as the starting position are determined as the text data block.

[0196] In some embodiments, see Figure 7 The data block determination unit 604 is further configured to execute:

[0197] Obtaining protocol information of the image file, the protocol information including the correspondence between type data and the type to which the data block belongs;

[0198] According to the corresponding relationship, target type data corresponding to the text type is determined from at least one type data.

[0199] In some embodiments, see Figure 7 , the data storage unit 603 includes:

[0200] The database creation subunit 6031 is configured to create a new text data block in the picture file in response to the text data block not existing in the picture file or the text data block existing in the picture file already storing data;

[0201] The data storage subunit 6032 is configured to store the encrypted data into a new text data block.

[0202] In some embodiments, the encrypted data acquisition unit 602 is configured to combine the encryption information with the target data in response to the target data being a string type data to obtain the encrypted data.

[0203] In some embodiments, see Figure 7 , the data storage device comprises:

[0204] The data reading unit 605 is configured to execute, in response to receiving a data reading instruction carrying a field, querying encryption information corresponding to the field from a database;

[0205] The data reading unit 605 is further configured to execute searching the encrypted data stored in the picture file for a text data block having the same encryption information as the encryption information;

[0206] The data reading unit 605 is further configured to read target data from the queried text data block.

[0207] In some embodiments, see Figure 7 The data reading unit 605 is further configured to execute:

[0208] Querying the target type data corresponding to the text type from the image file, and determining at least one data block where the queried target type data is located as a text data block;

[0209] A text data block having the same encryption information as the encryption information in the stored encrypted data is determined from at least one of the queried text data blocks.

[0210] Regarding the device in the above embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0211] In an exemplary embodiment, an electronic device is provided, which includes one or more processors and a memory for storing instructions executable by the one or more processors; wherein the one or more processors are configured to execute the data storage method in the above-mentioned embodiment.

[0212] In a possible implementation manner, the electronic device is provided as a terminal. Figure 8 800 is a block diagram of a terminal 800 according to an exemplary embodiment. The terminal 800 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 800 may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0213] The terminal 800 includes a processor 801 and a memory 802 .

[0214] The processor 801 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 801 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 801 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 801 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 801 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0215] The memory 802 may include one or more computer-readable storage media, which may be non-transitory. The memory 802 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 802 is used to store at least one program code, which is used to be executed by the processor 801 to implement the data reading method provided in the method embodiment of the present disclosure.

[0216] In some embodiments, the terminal 800 may further optionally include: a peripheral device interface 803 and at least one peripheral device. The processor 801, the memory 802 and the peripheral device interface 803 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 803 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 804, a display screen 805, a camera assembly 806, an audio circuit 807, a positioning assembly 808 and a power supply 809.

[0217] The peripheral device interface 803 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 801 and the memory 802. In some embodiments, the processor 801, the memory 802, and the peripheral device interface 803 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 801, the memory 802, and the peripheral device interface 803 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0218] The radio frequency circuit 804 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 804 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 804 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 804 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 804 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 804 may also include circuits related to NFC (Near Field Communication), which is not limited in the present disclosure.

[0219] The display screen 805 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 805 is a touch display screen, the display screen 805 also has the ability to collect touch signals on the surface or above the surface of the display screen 805. The touch signal can be input to the processor 801 as a control signal for processing. At this time, the display screen 805 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 805 can be one, set on the front panel of the terminal 800; in other embodiments, the display screen 805 can be at least two, respectively set on different surfaces of the terminal 800 or in a folding design; in other embodiments, the display screen 805 can be a flexible display screen, set on the curved surface or folding surface of the terminal 800. Even, the display screen 805 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 805 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0220] The camera assembly 806 is used to capture images or videos. Optionally, the camera assembly 806 includes a front camera and a rear camera. The front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 806 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0221] The audio circuit 807 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 801 for processing, or input them into the radio frequency circuit 804 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 800. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 801 or the radio frequency circuit 804 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 807 may also include a headphone jack.

[0222] The positioning component 808 is used to locate the current geographical location of the terminal 800 to implement navigation or LBS (Location Based Service). The positioning component 808 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas positioning system, or the European Union's Galileo positioning system.

[0223] The power supply 809 is used to power various components in the terminal 800. The power supply 809 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 809 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0224] In some embodiments, the terminal 800 further includes one or more sensors 810 , including but not limited to: an acceleration sensor 811 , a gyroscope sensor 812 , a pressure sensor 813 , a fingerprint sensor 814 , an optical sensor 815 , and a proximity sensor 816 .

[0225] The acceleration sensor 811 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 800. For example, the acceleration sensor 811 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 801 can control the display screen 805 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 811. The acceleration sensor 811 can also be used to collect game or user motion data.

[0226] The gyroscope sensor 812 can detect the body direction and rotation angle of the terminal 800, and the gyroscope sensor 812 can cooperate with the acceleration sensor 811 to collect the user's 3D actions on the terminal 800. The processor 801 can implement the following functions based on the data collected by the gyroscope sensor 812: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0227] The pressure sensor 813 can be set on the side frame of the terminal 800 and / or the lower layer of the display screen 805. When the pressure sensor 813 is set on the side frame of the terminal 800, it can detect the user's holding signal of the terminal 800, and the processor 801 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 813. When the pressure sensor 813 is set on the lower layer of the display screen 805, the processor 801 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 805. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0228] The fingerprint sensor 814 is used to collect the user's fingerprint, and the processor 801 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 814, or the fingerprint sensor 814 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 801 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 814 can be set on the front, back, or side of the terminal 800. When a physical button or a manufacturer logo is set on the terminal 800, the fingerprint sensor 814 can be integrated with the physical button or the manufacturer logo.

[0229] The optical sensor 815 is used to collect the ambient light intensity. In one embodiment, the processor 801 can control the display brightness of the display screen 805 according to the ambient light intensity collected by the optical sensor 815. Specifically, when the ambient light intensity is high, the display brightness of the display screen 805 is increased; when the ambient light intensity is low, the display brightness of the display screen 805 is reduced. In another embodiment, the processor 801 can also dynamically adjust the shooting parameters of the camera assembly 806 according to the ambient light intensity collected by the optical sensor 815.

[0230] The proximity sensor 816, also called a distance sensor, is disposed on the front panel of the terminal 800. The proximity sensor 816 is used to collect the distance between the user and the front of the terminal 800. In one embodiment, when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 is gradually decreasing, the processor 801 controls the display screen 805 to switch from the screen-on state to the screen-off state; when the proximity sensor 816 detects that the distance between the user and the front of the terminal 800 is gradually increasing, the processor 801 controls the display screen 805 to switch from the screen-off state to the screen-on state.

[0231] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the terminal 800, and the terminal 800 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0232] In an exemplary embodiment, a computer-readable storage medium is also provided, and when the instructions in the storage medium are executed by the processor of the terminal, the terminal is enabled to execute the steps performed by the terminal in the above data storage method. Optionally, the computer-readable storage medium can be a ROM (Read Only Memory), a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0233] In an exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program. The computer program is executed by a processor to implement the above data storage method.

[0234] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0235] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data storage method, characterized in that: The data storage method comprises: Querying encryption information corresponding to a field to which the target data belongs from a database, wherein the database is used to store encryption information corresponding to at least one field, and the encryption information is used to encrypt the target data, and different target data corresponds to different encryption information; Matching the target data and the encrypted information according to the encryption format to obtain the encrypted data corresponding to the target data; Determine whether there is a text data block in the acquired image file, the image file corresponds to protocol information, the protocol information includes a correspondence between each type of data and the type to which the data block belongs, and any data block belonging to the text type is used to indicate that the data block is a text data block; In the case that the text data block does not exist in the picture file or the text data block existing in the picture file already stores data, creating a new text data block in the picture file; storing the encrypted data into the new text data block; When there is a text data block in the picture file and no data is stored in the text data block, storing the encrypted data in the text data block; In response to receiving a data read instruction carrying the field, querying the encryption information corresponding to the field from the database; Based on the protocol information corresponding to the image file, query the image file for target type data corresponding to the text type, and determine at least one data block where the query target type data is located as a text data block; Determining, from the at least one text data block found, a text data block having encryption information in the stored encrypted data that is identical to the encryption information; Reading the encrypted data from the queried text data block; matching the encrypted data with the encryption format; The target data is read from the encrypted data according to the encryption information.

2. The data storage method according to claim 1, characterized in that: The step of matching the target data and the encrypted information according to an encryption format to obtain encrypted data corresponding to the target data includes: The encrypted information, the target data and a symbol are combined to obtain the encrypted data.

3. The data storage method according to claim 1, characterized in that: Before storing the encrypted data in the text data block, the data storage method further includes: Acquire at least one type of data stored in the image file, where each type of data is used to indicate the type of the data block corresponding to each type of data; Determine target type data from the at least one type data, wherein the target type data is used to indicate that the data block corresponding to the target type data belongs to a text type; The data block corresponding to the target type data is determined as the text data block.

4. The data storage method according to claim 3, characterized in that: The step of determining the data block corresponding to the target type data as the text data block includes: Acquire the number of bytes adjacent to the target type data from the picture file, where the number of bytes is used to indicate the number of bytes included in the text data block; In the picture file, the bytes of the number of bytes starting from the target type data are determined as the text data block.

5. The data storage method according to claim 3, characterized in that: The step of determining target type data from the at least one type of data comprises: Acquire protocol information of the image file, where the protocol information includes a correspondence between type data and the type to which the data block belongs; According to the corresponding relationship, the target type data corresponding to the text type is determined from the at least one type data.

6. The data storage method according to claim 1, characterized in that: The step of matching the target data and the encrypted information according to an encryption format to obtain encrypted data corresponding to the target data includes: In response to the target data being data of a character string type, the encryption information is combined with the target data to obtain the encrypted data.

7. A data storage device, characterized in that: The data storage device comprises: an encryption information query unit, configured to query encryption information corresponding to a field to which target data belongs from a database, wherein the database is used to store encryption information corresponding to at least one field, and the encryption information is used to encrypt the target data, and different target data corresponds to different encryption information; an encrypted data acquisition unit, configured to match the target data and the encrypted information according to an encryption format to obtain encrypted data corresponding to the target data; A data storage unit is configured to determine whether a text data block exists in an acquired image file, the image file corresponds to protocol information, the protocol information includes a correspondence between each type of data and the type to which the data block belongs, and any data block belonging to the text type is used to indicate that the data block is a text data block; if there is no text data block in the image file or data is already stored in the text data block in the image file, create a new text data block in the image file; store the encrypted data in the new text data block; if there is a text data block in the image file and no data is stored in the text data block, store the encrypted data in the text data block; The data reading unit is configured to execute, in response to receiving a data reading instruction carrying the field, query the encryption information corresponding to the field from the database; based on the protocol information corresponding to the image file, query the target type data corresponding to the text type from the image file, and determine at least one data block where the queried target type data is located as a text data block; determine from the at least one queried text data block a text data block in which the encryption information in the stored encrypted data is the same as the encryption information; read the encrypted data from the queried text data block; match the encrypted data with the encryption format; and read the target data from the encrypted data according to the encryption information.

8. The data storage device according to claim 7, characterized in that: The encrypted data acquisition unit is configured to combine the encryption information, the target data and the symbol to obtain the encrypted data.

9. The data storage device according to claim 7, characterized in that: The data storage device further comprises: A data block determination unit is configured to execute acquisition of at least one type of data stored in the image file, each type of data being used to indicate a type to which a data block corresponding to each type of data belongs; The data block determination unit is further configured to determine target type data from the at least one type data, wherein the target type data is used to indicate that the data block corresponding to the target type data belongs to a text type; The data block determination unit is further configured to determine the data block corresponding to the target type data as the text data block.

10. The data storage device according to claim 9, characterized in that: The data block determination unit is further configured to execute: Acquire the number of bytes adjacent to the target type data from the picture file, where the number of bytes is used to indicate the number of bytes included in the text data block; In the picture file, the bytes of the number of bytes starting from the target type data are determined as the text data block.

11. The data storage device according to claim 9, characterized in that: The data block determination unit is further configured to execute: Acquire protocol information of the image file, where the protocol information includes a correspondence between type data and the type to which the data block belongs; According to the corresponding relationship, the target type data corresponding to the text type is determined from the at least one type data.

12. The data storage device according to claim 7, characterized in that: The encrypted data acquisition unit is configured to combine the encryption information with the target data in response to the target data being character string type data to obtain the encrypted data.

13. A terminal, characterized in that: The terminal comprises: one or more processors; a memory for storing the one or more processor-executable instructions; The one or more processors are configured to execute the data storage method according to any one of claims 1 to 6.

14. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of a terminal, the terminal is enabled to execute the data storage method according to any one of claims 1 to 6.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the data storage method according to any one of claims 1 to 6 is implemented.