A data processing method, device, terminal and storage medium
By using public storage files in the Flash space for data processing, you only need to create one file to realize data reading and writing, solving the problem of waste of Flash space in the existing technology and improving the efficiency and security of data storage .
Patent Information
- Application Number
- CN202110882992.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-02
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-08-02
AI Technical Summary
In the prior art, multiple small files need to be created in the Flash space for read and write operations, resulting in waste of Flash space.
By obtaining the target string and operation type data, determining the target storage location in the common storage file, and processing the original key value according to the operation type, realizing the reading and writing of data, only one file is needed.
It effectively solves the problem of Flash space waste, improves the efficiency and security of data storage, reduces the number of read and writes of Flash, and extends the life of Flash.
Smart Images

Figure CN113792020B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a data processing method, device, terminal and storage medium. Background Art
[0002] FLASH flash memory is a type of memory device, "Flash". Flash memory is a non-volatile memory that can retain data for a long time even without current supply. Its storage characteristics are equivalent to hard disks. This characteristic is the basis for flash memory to become the storage medium of various portable digital devices. EEPROM (Electrically Erasable Programmable read only memory) refers to electrically erasable programmable read-only memory. It is a storage chip that does not lose data after power failure. EEPROM can erase existing information and reprogram on a computer or dedicated device.
[0003] At present, for lightweight embedded systems that do not support databases and do not have EEPROM, when storing multiple non-volatile data in such systems, multiple small files are usually created in the Flash space according to the key-value pairs that need to be read and written. However, the read and write operations of Flash can only be performed with the minimum erase block size, so creating multiple small files easily leads to a waste of Flash space.
[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the invention
[0005] The technical problem to be solved by the present invention is that, in view of the above-mentioned defects of the prior art, a data processing method, device, terminal and storage medium are provided, aiming to solve the problem in the prior art that the read and write operations of Flash require the creation of multiple small files in the Flash space, resulting in a waste of Flash space.
[0006] The technical solution adopted by the present invention to solve the problem is as follows:
[0007] In a first aspect, an embodiment of the present invention provides a data processing method, wherein the method includes:
[0008] Get the target string and operation type data;
[0009] Acquire a public storage file, and determine a target storage location from the public storage file according to the target character string;
[0010] The original key value is acquired according to the target storage location, and the original key value is processed according to the operation type data.
[0011] In one implementation, determining the target storage location from the public storage file according to the target character string includes:
[0012] Get the preset key-value pair length;
[0013] The target storage position corresponding to the target string is searched in sequence from the file header of the public storage file, taking the key-value pair length as the search unit, wherein the string corresponding to the target storage position is the same as the target string.
[0014] In one implementation, the processing the original key value according to the operation type data includes:
[0015] When the operation type data is a write data operation type, obtaining a target key value corresponding to the target character string;
[0016] The original key value is replaced according to the target key value.
[0017] In one implementation, replacing the original key value according to the target key value includes:
[0018] Acquire preset key data, and encrypt the target key value according to the key data to obtain an encrypted key value;
[0019] The original key value is replaced according to the encrypted key value.
[0020] In one implementation, the processing the original key value according to the operation type data includes:
[0021] When the operation type data is a read data operation type, the original key value is used as a target key value corresponding to the target character string;
[0022] According to the target key value, the read data is obtained.
[0023] In one implementation, acquiring read data according to the target key value includes:
[0024] Get the preset key data;
[0025] The target key value is decrypted according to the key data to obtain the read data.
[0026] In one embodiment, the method further comprises:
[0027] When the operation type data is a data search operation type, the target storage location is used as a search result.
[0028] In a second aspect, an embodiment of the present invention further provides a data processing device, wherein the device comprises:
[0029] The acquisition module is used to obtain the target string and operation type data;
[0030] A determination module, used for acquiring a public storage file, and determining a target storage location from the public storage file according to the target character string;
[0031] A processing module is used to obtain an original key value according to the target storage location and process the original key value according to the operation type data.
[0032] In a third aspect, an embodiment of the present invention further provides a terminal, wherein the terminal includes a memory and one or more processors; the memory stores one or more programs; the program includes instructions for executing any of the data processing methods described above; and the processor is used to execute the program.
[0033] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a plurality of instructions are stored, wherein the instructions are suitable for being loaded and executed by a processor to implement the steps of any of the above-mentioned data processing methods.
[0034] Beneficial effects of the present invention: The embodiments of the present invention obtain the target string and operation type data; obtain a public storage file, and determine the target storage location from the public storage file according to the target string; obtain the original key value according to the target storage location, and process the original key value according to the operation type data. The present invention stores data through a public storage file, so only one file needs to be created in the Flash space to realize data reading and writing, which can effectively solve the problem in the prior art that the Flash read and write operations need to create multiple small files in the Flash space, resulting in a waste of Flash space. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 It is a flowchart of a data processing method provided by an embodiment of the present invention.
[0037] Figure 2It is a flowchart of a data processing method corresponding to the write data operation type provided in an embodiment of the present invention.
[0038] Figure 3 It is a flow chart of a data processing method corresponding to a read data operation type provided in an embodiment of the present invention.
[0039] Figure 4 It is a flowchart of a data processing method corresponding to a data search operation type provided in an embodiment of the present invention.
[0040] Figure 5 It is a connection diagram of internal modules of a data processing device provided by an embodiment of the present invention.
[0041] Figure 6 It is a principle block diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The present invention discloses a data processing method, device, terminal and storage medium. In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0043] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0044] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0045] FLASH flash memory is a type of memory device, "Flash". Flash memory is a non-volatile memory that can retain data for a long time even without current supply. Its storage characteristics are equivalent to hard disks. This characteristic is the basis for flash memory to become the storage medium of various portable digital devices. EEPROM (Electrically Erasable Programmable read only memory) refers to electrically erasable programmable read-only memory. It is a storage chip that does not lose data after power failure. EEPROM can erase existing information and reprogram on a computer or dedicated device.
[0046] At present, for lightweight embedded systems that do not support databases and do not have EEPROM, when storing multiple non-volatile data in such systems, multiple small files are usually created in the Flash space according to the key-value pairs that need to be read and written. However, the read and write operations of Flash can only be performed with the minimum erase block size, so creating multiple small files easily leads to a waste of Flash space.
[0047] In view of the above defects in the prior art, the present invention provides a data processing method, the method comprising: obtaining a target string and operation type data; obtaining a public storage file, and determining a target storage location from the public storage file according to the target string; obtaining an original key value according to the target storage location, and processing the original key value according to the operation type data. The present invention stores data through a public storage file, so only one file needs to be created in the Flash space to realize data reading and writing, which can effectively solve the problem in the prior art that the Flash read and write operations need to create multiple small files in the Flash space, resulting in a waste of Flash space.
[0048] like Figure 1 As shown, the method comprises the following steps:
[0049] Step S100: Obtain target character string and operation type data.
[0050] Specifically, since the data is stored in a public storage file in this embodiment, in order to facilitate the management of the public storage file, the data in the public storage file is stored in the form of a key-value pair in this embodiment, wherein the key is equivalent to the number of the stored value, usually expressed in the form of a string, and the value is equivalent to the data to be stored. Any data stored in the public storage file can be located by the string. The user can perform a variety of operations on the public storage file, and different operations correspond to different operation type data. For example, if the user wants to read data from the public storage file, the operation type data is a read data operation; if the user wants to write data to the public storage file, the operation type data is a write data operation type.
[0051] In one implementation, the method further includes the following steps:
[0052] Step S200: Acquire a public storage file, and determine a target storage location from the public storage file according to the target character string.
[0053] Specifically, in this embodiment, only one public storage file is created in the Flash space, and the public storage file can be used to store all data written into the system, so whether writing data into the system or reading data from the system, the public storage file needs to be acted on. Since the data stored in each storage location in the public storage file is in the form of key-value pairs, the corresponding target storage location in the public storage file can be located according to the target string.
[0054] In one implementation, determining the target storage location from the public storage file according to the target character string comprises the following steps:
[0055] Step S201, obtaining a preset key-value pair length;
[0056] Step S202: Using the key-value pair length as a search unit, sequentially search for a target storage location corresponding to the target string from the file header of the public storage file, wherein the string corresponding to the target storage location is the same as the target string.
[0057] Specifically, all stored data in the present embodiment are in the form of key-value pairs of uniform length. Therefore, after obtaining the target string, the data is searched sequentially from the first key-value pair (i.e., the file header) of the public storage file in units of a preset key-value pair length, that is, the strings in a key-value pair are matched each time in sequence until a string identical to the target string is matched. The storage location corresponding to the string is then the target storage location.
[0058] like Figure 1 As shown, the method further comprises the following steps:
[0059] Step S300: Acquire an original key value according to the target storage location, and process the original key value according to the operation type data.
[0060] Specifically, this embodiment defines the key value stored in the target storage location as the original key value. Since the user's operation type data can reflect what kind of processing the user expects to perform on the data in the public storage file, it is necessary to determine the specific operation to be performed on the original key value in the target storage location based on the user's operation type data.
[0061] In one implementation, step S300 specifically includes the following steps:
[0062] Step S301: when the operation type data is a write data operation type, obtaining a target key value corresponding to the target character string;
[0063] Step S302: Replace the original key value according to the target key value.
[0064] Specifically, when the user's operation type data is a write data operation type, it means that the user wants to write data to the public storage file, so it is necessary to further obtain the key value corresponding to the target string, that is, the target key value, and use the target key value to replace the original key value originally stored in the target storage location, thereby completing the writing of the target key value into the public storage file.
[0065] For example, suppose the data that the user wants to write to the system is a key-value pair A (key1, value1), then key1 is the target string, and value1 is the target key value. According to key1, the target storage location is located from the public storage file, and the data stored in the target storage location is a key-value pair B (key1, value2). After replacing value2 with value1, the key-value pair A is written into the system.
[0066] In one implementation, replacing the original key value according to the target key value specifically includes:
[0067] Step S3021, obtaining preset key data, and encrypting the target key value according to the key data to obtain an encrypted key value;
[0068] Step S3022: Replace the original key value according to the encrypted key value.
[0069] In simple terms, in order to avoid external reading of data in the public storage file, thereby causing leakage, that is, for data security considerations, this embodiment will encrypt the data written into the public storage file, so that even if the data in the public storage file is read externally, the real information corresponding to the data cannot be known. Specifically, this embodiment pre-sets a key in the system, uses a unified key to encrypt the target key value to be stored in the public storage file, obtains an encrypted key value, and finally uses the encrypted key value to replace the original key value stored in the target storage location to complete the storage of the target key value.
[0070] In one implementation, since the data stored in the public storage file are all key-value pairs of uniform length, after the target key value is encrypted, it is necessary to determine whether the total length of the key-value pair consisting of the encrypted key value and the target string meets the preset key-value pair length. When the total length is less than the key-value pair length, the empty spaces are filled with preset symbols so that the key-value pair consisting of the encrypted key value and the target string after filling meets the key-value pair length.
[0071] For example, assuming that the preset key-value pair length is 128 bytes, when the total length of the key-value pair consisting of the encryption key and the target string does not meet 128 bytes, the character 0 is used to fill the empty space until the total length of the key-value pair consisting of the encryption key and the target string reaches 128 bytes.
[0072] In one implementation, after encrypting the target key value, it is necessary to determine whether the total length of the key-value pair consisting of the encrypted key value and the target string is greater than the preset key-value pair length. When the total length is greater than the key-value pair length, the key-value pair is determined to be too long and information that the write operation failed is returned.
[0073] For example, assuming that the preset key-value pair length is 128 bytes, when the total length of the key-value pair consisting of the encryption key and the target string is 138 bytes, the key-value pair is judged to be too long and the write operation failure information is returned.
[0074] In another implementation, step S300 specifically includes the following steps:
[0075] Step S303: When the operation type data is a read data operation type, the original key value is used as a target key value corresponding to the target character string;
[0076] Step S304: Obtain read data according to the target key value.
[0077] Specifically, when the operation type data is a read operation type, it indicates that the user expects to read data from the public storage file. Therefore, after the target string is used to locate the target storage location in the public storage file, the original key value stored on the target storage file is obtained. The original key value is the target key value corresponding to the target string, and the user's expected read data can be obtained according to the target key value.
[0078] In one implementation, acquiring the target key value corresponding to the target string according to the target storage location specifically includes:
[0079] Step S3031, obtaining preset key data;
[0080] Step S3032: decrypt the target key value according to the key data to obtain the read data.
[0081] In short, in order to avoid external reading of data in the public storage file, thereby causing leakage, that is, for data security considerations, this embodiment will encrypt the data written into the public storage file, so that even if the data in the public storage file is read externally, the real information corresponding to the data cannot be known. Therefore, when it is necessary to obtain the target key value corresponding to the target string from the public storage file, the target key value also needs to be decrypted to finally obtain the desired read data of the user.
[0082] In another implementation, the method further includes:
[0083] When the operation type data is a data search operation type, the target storage location is used as a search result.
[0084] Specifically, when the user's operation type data is a data search operation type, it means that the user only needs to find the specific location where a certain data is stored in the public storage file. Therefore, after determining the target storage location in the public storage file based on the target string, the target storage location is returned to the user as a search result.
[0085] In one implementation, the method further includes:
[0086] When the operation type data is a write data operation type, and there is no storage position corresponding to the target character string in the public storage file, taking the end position of the public storage file as the target storage position;
[0087] Obtain a target key-value pair corresponding to the target character string, and store the target key-value pair in the target storage location.
[0088] Specifically, when the corresponding storage location cannot be found in the public storage file according to the target string, it means that the key-value pair corresponding to the target string is not stored in the public storage file, so it is necessary to create a new storage location at the end of the public storage file to obtain the target storage location, and store the target key-value pair corresponding to the target string in the target storage location.
[0089] In one implementation, storing the target key-value pair to the target storage location includes:
[0090] Get the preset key data;
[0091] Encrypting the key value in the target key-value pair according to the key data to obtain an encrypted key-value pair;
[0092] The encrypted key-value pair is stored in the target storage location.
[0093] Specifically, since the key value in the target key-value pair can reflect the data that the user wants to store, in order to ensure the security and privacy of the data, this embodiment needs to encrypt the key value in the target key-value pair to obtain an encrypted key-value pair, and finally store the encrypted key-value pair in the target storage location, that is, complete a data write operation. In this way, even if the data in the public storage file is read externally, only the encrypted data can be obtained, and the real information of the data cannot be known, which can effectively ensure the security of the data in the public storage file.
[0094] In another implementation, the method further includes:
[0095] When the operation type data is a read data operation type, and the storage location corresponding to the target character string does not exist in the public storage file, information indicating that the reading has failed is returned.
[0096] Specifically, when the corresponding storage location cannot be found in the public storage file according to the target string, it means that the key-value pair corresponding to the target string is not stored in the public storage file, so the data reading operation cannot be completed, and the reading failure information is returned to the user.
[0097] In another implementation, the method further includes:
[0098] When the operation type data is a data search operation type, and the storage location corresponding to the target character string does not exist in the public storage file, information indicating that the search failed is returned.
[0099] Specifically, when the corresponding storage location cannot be found in the public storage file according to the target string, it means that the key-value pair corresponding to the target string is not stored in the public storage file, so the search operation cannot be completed, and the search failure information is returned to the user.
[0100] For example, Figure 2 As shown, this embodiment provides an algorithm for executing a data processing method corresponding to write data operation type data:
[0101] Step (1), start writing key-value pairs to the file system;
[0102] Step (2), input the key-value pair to be updated;
[0103] Step (3), determine whether the length of the key plus the length of the value in the key-value pair is less than 128-1; if so, proceed to step (4); if not, proceed to step (11);
[0104] Step (4), open the file;
[0105] Step (5), search for the key-value pair position; if the search is successful, go to step (6); if the search fails, go to step (7);
[0106] Step (6), the position of the key-value pair is: the position of the key-value pair found; proceed to step (8);
[0107] Step (7), the position of the key-value pair is: the last position of the file; proceed to step (8);
[0108] Step (8), the file is offset to the location of the desired key value;
[0109] Step (9), encrypt the key-value pair (if the key-value pair is less than 128 bytes, fill the empty space with 0);
[0110] Step (10), write the encrypted key-value pair into the file; proceed to step (12);
[0111] Step (11), if the key-value pair is too long, write failure is returned and the process goes to step (12);
[0112] Step (12), end.
[0113] For example, Figure 3 As shown, this embodiment provides an algorithm for executing a data processing method corresponding to the data of the read data operation type:
[0114] Step (1), start reading key-value pairs from the file system;
[0115] Step (2), input the key value to be read;
[0116] Step (3), open the file;
[0117] Step (4), search for the key-value pair position; if the search is successful, go to step (5); if the search fails, go to step (10);
[0118] Step (5), the position of the key-value pair is: the position of the key-value pair found;
[0119] Step (6), the file is offset to the location of the desired key value;
[0120] Step (7), read the key-value pair;
[0121] Step (8), decrypt the key-value pair;
[0122] Step (9), read successfully; go to step (11);
[0123] Step (10): There is no matching key, and the reading fails; proceed to step (11);
[0124] Step (11), end.
[0125] For example, Figure 4 As shown, this embodiment provides an algorithm for executing a data processing method corresponding to a data search operation type data:
[0126] Step (1), start searching for key-value pairs;
[0127] Step (2), offset to the file header;
[0128] Step (3), read 128 bytes of data; if the reading is unsuccessful, go to step (8);
[0129] Step (4), successfully read 128 bytes of data;
[0130] Step (5), Aes128 decrypts the read data;
[0131] Step (6), searching the key value from the decrypted 128 bytes;
[0132] Step (7), find the location of the key value; if successfully found, go to step (8); if not successfully found, go to step (3);
[0133] Step (8), end.
[0134] The advantages of the data processing method provided by the present invention are:
[0135] (1) A method is provided to read and write key values to a power-off saved flash memory using a common standard file system interface;
[0136] (2) You only need to create one file to read and write multiple key-value pairs;
[0137] (3) The written data is encrypted by the program using AES128, and the read data is decrypted by the program using the AES private key. After this processing, even if the file is read by the outside, the file content cannot be obtained without the AES private key, thus improving security;
[0138] (4) Reading, writing, and modifying can be done by directly calling the read or write interface, which is easy to operate;
[0139] (5) In a lightweight embedded system that does not support a database and does not have EEPROM, when storing multiple non-volatile data, all key-value pairs are stored in one file, which reduces the number of flash read and write times and improves the flash life.
[0140] (6) No matter how many key-value pairs are read or written, only one file needs to be created. This avoids wasting flash space due to the creation of multiple small files due to the minimum block size of flash.
[0141] Based on the above-mentioned embodiments of the invention, the present invention further provides a data processing device, such as Figure 5 As shown, the device comprises:
[0142] Acquisition module 01, used to acquire target character string and operation type data;
[0143] Determining module 02, used to obtain a public storage file, and determine a target storage location from the public storage file according to the target character string;
[0144] The processing module 03 is used to obtain the original key value according to the target storage location, and process the original key value according to the operation type data.
[0145] Based on the above embodiment, the present invention further provides a terminal, whose principle block diagram can be shown as follows: Figure 6 As shown. The terminal includes a processor, a memory, a network interface, and a display screen connected through a system bus. Among them, the processor of the terminal is used to provide computing and control capabilities. The memory of the terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen.
[0146] Those skilled in the art will understand that Figure 6The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the terminal to which the scheme of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0147] In an implementation manner, one or more programs are stored in the memory of the terminal, and the one or more programs are configured to be executed by one or more processors, and include instructions for performing the data processing method.
[0148] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0149] In summary, the present invention discloses a data processing method, device, terminal and storage medium, the method comprising: obtaining a target string and operation type data; obtaining a public storage file, and determining a target storage location from the public storage file according to the target string; obtaining an original key value according to the target storage location, and processing the original key value according to the operation type data. The present invention stores data through a public storage file, so only one file needs to be created in the Flash space to realize data reading and writing, which can effectively solve the problem in the prior art that the Flash read and write operations need to create multiple small files in the Flash space, resulting in a waste of Flash space.
[0150] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A data processing method, characterized in that: The method comprises: Get the target string and operation type data; Obtain a public storage file and obtain a preset key-value pair length; using the key-value pair length as a search unit, sequentially search for a target storage position corresponding to the target string from a file header of the public storage file, wherein the string corresponding to the target storage position is the same as the target string; Acquire the original key value according to the target storage location, and when the operation type data is a write data operation type, acquire the target key value corresponding to the target character string; Acquire preset key data, and encrypt the target key value according to the key data to obtain an encrypted key value; After encrypting the target key value, determine whether the total length of the key-value pair consisting of the encrypted key value and the target string meets the preset key-value pair length. If the total length is less than the key-value pair length, fill the empty space with a preset symbol so that the key-value pair consisting of the encrypted key value and the target string after filling meets the key-value pair length. Replacing the original key value according to the encrypted key value; When the total length is greater than the length of the key-value pair, the key-value pair is judged to be too long and the write operation failure message is returned.
2. The data processing method according to claim 1, characterized in that: The method further comprises: When the operation type data is a read data operation type, the original key value is used as a target key value corresponding to the target character string; According to the target key value, the read data is obtained.
3. The data processing method according to claim 2, characterized in that: The step of obtaining read data according to the target key value includes: Get the preset key data; The target key value is decrypted according to the key data to obtain the read data.
4. The data processing method according to claim 1, characterized in that: The method further comprises: When the operation type data is a data search operation type, the target storage location is used as a search result.
5. A data processing device, characterized in that: The device comprises: The acquisition module is used to obtain the target string and operation type data; A determination module is used to obtain a public storage file and a preset key-value pair length; using the key-value pair length as a search unit, sequentially searching for a target storage position corresponding to the target string from a file header of the public storage file, wherein the string corresponding to the target storage position is the same as the target string; A processing module, configured to obtain an original key value according to the target storage location, and when the operation type data is a write data operation type, obtain a target key value corresponding to the target character string; Acquire preset key data, and encrypt the target key value according to the key data to obtain an encrypted key value; After encrypting the target key value, determine whether the total length of the key-value pair consisting of the encrypted key value and the target string meets the preset key-value pair length. If the total length is less than the key-value pair length, fill the empty space with a preset symbol so that the key-value pair consisting of the encrypted key value and the target string after filling meets the key-value pair length. Replacing the original key value according to the encrypted key value; When the total length is greater than the length of the key-value pair, the key-value pair is judged to be too long and the write operation failure message is returned.
6. A terminal, characterized in that: The terminal includes a memory and one or more processors; the memory stores one or more programs; the program includes instructions for executing the data processing method as described in any one of claims 1-4; and the processor is used to execute the program.
7. A computer-readable storage medium having a plurality of instructions stored thereon, characterized in that: The instructions are suitable for being loaded and executed by a processor to implement the steps of the data processing method described in any one of claims 1 to 4 above.