A method and device for processing data

By dividing multiple memory areas in the memory pool and establishing associations, the target data is divided and stored, and the problem of low memory data security in the existing technology is solved, and higher data security is achieved.

CN111930640BActive Publication Date: 2025-05-20VISIONVERA INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010617143.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2025-05-20
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

In the prior art, the location and reading of data in the memory resource pool have low security problems, which can easily lead to the easy location and acquisition of data.

Method used

A plurality of memory areas are divided in the memory pool, the target data is divided into at least two target data blocks, and the target memory area matching each target data block is determined in the multiple memory areas, a corresponding relationship between the identification of the target data and the first target memory area is established, and an association relationship between each target memory area is established.

Benefits of technology

By dividing and storing data in multiple memory areas and establishing association relationships, the security of storing data in memory is improved, ensuring that the entire content of the data can be obtained only when the association relationship between multiple memory areas is determined.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111930640B_ABST
    Figure CN111930640B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a data processing method and device, including: dividing received target data into at least two target data blocks, and determining a target memory area matching each target data block in multiple memory areas; storing each target data block in a corresponding target memory area; and completing the reading of the target data when a read instruction for the target data is received. In the present invention, when reading the target data in the memory pool, only a part of the target data can be obtained when only the corresponding relationship between the identifier of the target data and the first target memory area is determined. Only when the association relationship between different target memory areas is further determined, can other target memory areas storing other parts of the target data blocks in the target data be further determined to obtain the entire content of the target data, thereby improving the security of data stored in the memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information processing, and particularly to a method and apparatus for processing data. Background Art

[0002] Memory is one of the important components in a computer. It is a bridge for communication between external memory and the central processing unit (CPU). All programs in the computer run in memory. Therefore, the performance of memory has a great impact on the computer.

[0003] In the prior art, memory is used to temporarily store the operation data of the CPU when the computer executes program running tasks, as well as data exchanged with external memories such as hard disks. Specifically, the computer operating system maintains a memory resource pool. After receiving a memory application for a program running task, according to the memory application, it determines the size of the operation data of the CPU corresponding to the program running task, and determines the size of the memory block required to store this data in memory, so as to allocate a memory block of a fixed size for this data in the memory resource pool, store this data in this one memory block, and establish the corresponding relationship between the address information of this memory block and the data identification information. Thus, when reading data from memory, it can determine the memory block used to store this data from the memory resource pool according to the address information of the memory block corresponding to the identification information of the data, and then obtain the data stored in this memory block.

[0004] However, in the current solution, only by knowing the identification information of the data and the corresponding relationship between the address information of the memory block and the identification information of the data, it is easy to locate the memory block storing this data in the memory resource pool and obtain all the content of this data from the memory block, resulting in low data security. Summary of the Invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide a method for processing data and a corresponding apparatus for processing data that overcome the above problems or at least partially solve the above problems.

[0006] To solve the above problems, embodiments of the present invention disclose a method for processing data, the method comprising:

[0007] Dividing a plurality of memory areas in a memory pool;

[0008] Dividing the received target data into at least two target data blocks, and determining, in the plurality of memory areas, target memory areas that match each of the target data blocks;

[0009] Store each of the target data blocks in a corresponding target memory area, establish a correspondence between the identifier of the target data and the first target memory area, and establish an association relationship between the target memory areas, where the first target memory area is one of at least two target memory areas;

[0010] In the case of receiving a read instruction for the target data, extract the target data block from the first target memory area according to the correspondence;

[0011] According to the association relationship, determine the other target memory areas among at least two target memory areas except the first target memory area, and extract the target data blocks stored in the other target memory areas to complete the reading of the target data.

[0012] An embodiment of the present invention also discloses a data processing device, and the device includes:

[0013] A first partitioning module, configured to partition a plurality of memory areas in a memory pool;

[0014] A second partitioning module, configured to partition the received target data into at least two target data blocks, and determine, among the plurality of memory areas, the target memory areas that match each target data block;

[0015] A storage module, configured to store each target data block in a corresponding target memory area, establish a correspondence between the identifier of the target data and the first target memory area, and establish an association relationship between the target memory areas, where the first target memory area is one of at least two target memory areas;

[0016] A first extraction module, configured to, in the case of receiving a read instruction for the target data, extract the target data block from the first target memory area according to the correspondence;

[0017] A second extraction module, configured to determine, according to the association relationship, the other target memory areas among at least two target memory areas except the first target memory area, and extract the target data blocks stored in the other target memory areas to complete the reading of the target data.

[0018] An embodiment of the present invention also provides a device, including: one or more processors; and one or more machine-readable media storing instructions thereon, which, when executed by the one or more processors, cause the device to execute the data processing method provided by the present invention.

[0019] In addition, an embodiment of the present invention further provides a computer-readable storage medium, and a computer program stored therein causes a processor to execute the data processing method provided by the present invention.

[0020] The embodiments of the present invention have the following advantages: when storing received target data in a memory pool, the target data is divided into at least two target data blocks, and the at least two target data blocks are separately stored in different target memory areas in the corresponding memory pool, and a correspondence relationship is established between the identifier of the target data and one of the target memory areas, and an association relationship is established between the different target memory areas. Therefore, when reading the target data in the memory pool, only by determining the correspondence relationship, only the target data block stored in one target memory area can be determined through this correspondence relationship, that is, only a part of the target data can be obtained. Only when the association relationship between the different target memory areas is further determined can the other target memory areas storing the other target data blocks in the target data be further determined, and then all the content of the target data can be obtained, thereby improving the security of storing data in the memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flowchart of the steps of a data processing method of the present invention;

[0022] Figure 2 is a flowchart of the steps of another data processing method of the present invention;

[0023] Figure 3 is a flowchart of the steps of determining a target memory area of the present invention;

[0024] Figure 4 is a structural block diagram of a data processing device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0025] In order to make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0026] Referring to Figure 1 , a flowchart of the steps of a data processing method of the present invention is shown, and specifically may include the following steps:

[0027] Step 101, divide a plurality of memory areas in the memory pool.

[0028] In this step, multiple memory segments can be divided in a fixed memory pool in the memory. Specifically, multiple memory segments can be divided in the memory pool according to a preset rule. The preset rule can be to divide the fixed memory pool in the memory into multiple consecutive memory segments of a fixed size. Since a byte (B) is the basic unit for data processing in a computer and 1 kilobyte is equal to 1024 bytes, for the convenience of data segmentation and storage, the fixed size can be the size after evenly dividing 1024B. For example, 512B after being divided into two equal parts, 256B after being divided into four equal parts, 128B after being divided into eight equal parts, 64B after being divided into sixteen equal parts, 32B after being divided into thirty-two equal parts. As shown in Table 1 below, a memory pool with a size of 3840B in the memory is divided into 30 memory segments of 512B each containing 2 storage spaces, 4 memory segments of 256B each containing 4 storage spaces, 8 memory segments of 128B each containing 8 storage spaces, 8 memory segments of 64B each containing 8 storage spaces, and 8 memory segments of 32B each containing 8 storage spaces.

[0029]

[0030] Table 1

[0031] Step 102: Divide the received target data into at least two target data blocks, and in multiple said memory segments, determine the target memory segment that matches each said target data block.

[0032] In this step, first receive the target data, where the target data is the data that needs to be stored in the memory pool.

[0033] Furthermore, after receiving the target data, the target data can be divided into at least two target data blocks, and in multiple said memory segments, determine the target memory segment that matches each said target data block, obtaining at least two said target memory segments.

[0034] Specifically, the target data can be divided according to the size of the target data and the storage space of the determined memory areas. For example, if the size of the target data is 850B, as listed in Table 1, the specifications of each memory area in the memory pool are 512B, 256B, 128B, 64B, and 32B respectively. Therefore, the target data can be divided into three target data blocks with sizes of 512B, 256B, and 82B respectively. The target memory area matching the target data block with a size of 512B is the memory area with a storage space of 512B, which can be any one of the memory areas numbered 1 to 2 in Table 1; the target memory area matching the target data block with a size of 256B is the memory area with a storage space of 256B, which can be any one of the memory areas numbered 3 to 6 in Table 1; the target memory area matching the target data block with a size of 82B is the memory area with a storage space of 128B, which can be any one of the memory areas numbered 7 to 14 in Table 1.

[0035] In the embodiment of the present invention, if there are multiple memory areas in the memory pool that match the target data block, the memory area with the smallest serial number can be determined as the target memory area matching the target data block according to the serial number of the memory area. Therefore, the memory area numbered 1 in Table 1 can be determined as the target memory area matching the target data block with a size of 512B, the memory area numbered 3 can be determined as the target memory area matching the target data block with a size of 256B, and the memory area numbered 7 can be determined as the target memory area matching the target data block with a size of 82B.

[0036] Step 103: Store each target data block in the corresponding target memory area, establish a correspondence between the identifier of the target data and the first target memory area, and establish an association relationship between each target memory area. The first target memory area is one of at least two target memory areas.

[0037] In this step, after determining the target memory area matching each target data block, the target data block can be stored in the corresponding target memory area. Since there are at least two target data blocks and at least two target memory areas, the purpose of separately storing the target data can be achieved by storing the target data blocks in the corresponding target memory areas respectively.

[0038] Further, in order to identify the storage location of the target data in the memory pool so that when reading the target data, the storage location of the target data can be located in the memory pool. After each target data block is stored in the target memory area corresponding to the target data block, one memory area can be selected from at least two target memory areas as the first target memory area, and the start address of the first target memory area can be obtained. Furthermore, a correspondence relationship is established between the identifier of the target data and the first target memory area.

[0039] For example, if the identifier of the target data is: 00001111, and the start address of the first target memory area storing the target data is: Faddr, then a correspondence relationship can be established between the identifier 00001111 of the target data and the start address Faddr. So that when reading the target data in the memory pool, according to the identifier of the target data, the start address of the first target memory area storing a part of the target data, that is, a target data block, can be determined, and thus the target data block stored in the first target memory area can be obtained.

[0040] Further, in order to identify the storage locations of all target data blocks in the target data in the memory pool so that when reading the target data, the storage locations of all target data can be located in the memory pool. While establishing the correspondence relationship between the identifier of the target data and the start address of the first target memory area, an association relationship is established between each target memory area in at least two target memory areas.

[0041] Specifically, an identification bit can be set at a fixed position in the memory area, and the identification bits of multiple memory areas storing different parts of the target data are set so that the identification information recorded in the identification bits of the multiple memory areas is the same. Therefore, after determining the first target memory area storing a part of the target data, that is, a target data block, through the above correspondence relationship, and reading the corresponding target data block from the first target memory area, according to the association relationship, other target memory areas storing other parts of the target data can be determined, and then the corresponding other parts of the data can be read from the other target memory areas to complete the reading of all the content of the target data.

[0042] For example, if the target data is divided into three target data blocks, and these three target data blocks are respectively stored in three target memory areas with serial numbers 1, 3, and 7 shown in Table 1, then the identification information recorded at the fixed position in these three target memory areas can be set to the same character, for example, set to 00100000, to represent that the target data blocks stored in these three target memory areas are different parts of the same target data.

[0043] Step 104, when a read instruction for the target data is received, according to the corresponding relationship, extract a target data block from the first target memory area.

[0044] In this step, if a read instruction for the target data is received, at least two target data blocks stored in at least two target memory areas need to be read from the memory pool.

[0045] Specifically, first, according to the corresponding relationship between the identifier of the target data and the first target memory area, determine the first target memory area corresponding to the target data, so as to obtain the target data block stored in the first target memory area.

[0046] Step 105, according to the association relationship, determine other target memory areas in the at least two target memory areas except the first target memory area, and extract the target data blocks stored in the other target memory areas to complete the reading of the target data.

[0047] In this step, since only the target data block stored in the first target memory area is obtained in the above step 104, that is, only part of the data in the target data is obtained. Therefore, in order to obtain all the content of the target data, the other target memory areas associated with the first target memory area can be further determined according to the association relationship between the at least two target memory areas based on the first target memory area, and then other parts of the target data can be read from the other target memory areas to complete the reading of all the content of the target data.

[0048] In summary, a data processing method provided by an embodiment of the present invention includes: dividing a plurality of memory areas in a memory pool; dividing received target data into at least two target data blocks, and determining, among the plurality of memory areas, target memory areas that match each target data block; storing each target data block in a corresponding target memory area, establishing a correspondence between an identifier of the target data and a first target memory area, and establishing an association relationship between the respective target memory areas, where the first target memory area is one of the at least two target memory areas; in the case of receiving a read instruction for the target data, extracting a target data block from the first target memory area according to the correspondence; determining, according to the association relationship, other target memory areas among the at least two target memory areas except the first target memory area, and extracting target data blocks stored in the other target memory areas to complete the reading of the target data. In the present invention, when storing the received target data in the memory pool, the target data is divided into at least two target data blocks, and the at least two target data blocks are separately stored in different target memory areas in the corresponding memory pool, and a correspondence between an identifier of the target data and one of the target memory areas is established, and an association relationship between the respective different target memory areas is established. Thus, when reading the target data in the memory pool, in the case of only determining the correspondence, only the target data block stored in one target memory area can be determined through the correspondence, that is, only a part of the target data can be obtained. Only in the case of further determining the association relationship between the different target memory areas can the other target memory areas storing the other part of the target data blocks in the target data be further determined, and then all the content of the target data can be obtained, thereby improving the security of storing data in the memory.

[0049] Referring to Figure 2 , a step flowchart of another data processing method of the present invention is shown, which may specifically include the following steps:

[0050] Step 201, dividing a plurality of storage spaces with a fixed size in the memory pool according to a preset rule to generate the plurality of memory areas.

[0051] In this step, a plurality of storage spaces with a fixed size can be divided in the memory pool according to a preset rule, so as to generate the plurality of memory areas.

[0052] Among them, the memory area includes the head of the memory area and the storage space of the memory area. The head of the memory area is used to store the identification information of the memory area, and the storage space of the memory area is used to store the data block. Among them, the structure of the head of the memory area is shown in Table 2. The identification information of the memory area includes a first identifier and a second identifier. The first identifier indicates whether the storage space of the memory area stores a data block. The positions corresponding to the 1st to M bits of the memory area can be set to record the first identifier. The second identifier indicates the size of the storage space of the memory area. The positions corresponding to the (M + 1)th to (M + N)th bits of the memory area can be set to record the second identifier.

[0053] Optionally, the identification information of the memory area further includes a third identifier. The third identifier indicates the size of the remaining data, that is, the size of the remaining data that has not been stored after part of the data is stored in the target memory area before storing the target data. The positions corresponding to the (M + N + 1)th to (M + N + K)th bits of the memory area can be set to record the third identifier.

[0054] Optionally, the identification information of the memory area further includes a fourth identifier. The fourth identifier indicates the identifier of the data corresponding to the data block stored in the memory area. The positions corresponding to the (M + N + K + 1)th to (M + N + K + T)th bits of the memory area can be set to record the fourth identifier.

[0055] For example, M can be 1, that is, the position corresponding to the 1st bit in the memory area is used to record the first identifier; N can be 4, that is, the positions corresponding to the 2nd to 5th bits in the memory area are used to record the second identifier; K can be 11, that is, the positions corresponding to the 6th to 16th bits in the memory area are used to record the third identifier; T can be 8, that is, the positions corresponding to the 17th to 24th bits in the memory area are used to record the fourth identifier.

[0056] In the embodiment of the present invention, after generating the multiple memory areas, no data blocks are stored in the storage spaces of the multiple memory areas, and the characters at the first T bit positions in the heads of the multiple memory areas are set to 0 for initialization processing.

[0057] First identifier (Mbit) Second identifier (Nbit) Third identifier (Kbit) Fourth identifier (Tbit)

[0058] Table 2

[0059] Step 202, determine the first identifier of the memory area according to whether the data block is stored in the storage space of the memory area.

[0060] In this step, the first identifier of the memory area can be determined according to whether the data block is stored in the storage space of the memory area.

[0061] Referring to Table 2, if M is 1, the first identifier can be determined according to the pre-set correspondence between the first identifier and whether the data block is stored in the storage space. The correspondence between the first identifier and whether the data block is stored in the storage space is listed in Table 3 below. If the storage space of the memory area stores the data block, the position corresponding to the 1st bit in this memory area is set to 1, that is, the first identifier of this memory area is 1; if the storage space of the memory area does not store the data block, the position corresponding to the 1st bit in this memory area is set to 0, that is, the first identifier of this memory area is 1.

[0062] First identifier Whether the storage space of the memory area stores a data block 0 No 1 Yes

[0063] Table 3

[0064] Step 203: According to the pre-set size of the head of the memory area, the difference between the fixed size and the size of the head of the memory area is determined as the size of the storage space of the memory area, and the second identifier of the memory area is determined according to the size of the storage space of the memory area.

[0065] In this step, the size of the storage space of the memory area can be determined according to the size of the head of the memory area and the size of this memory area determined when dividing multiple memory areas, so as to determine the second identifier of this memory area.

[0066] Specifically, since the head of the memory area is used to store the identification information of the memory area, and the storage space of the memory area is used to store the data block, the size of the storage space that the memory area can use to store data is the size of this memory area determined when dividing multiple memory areas. Therefore, the difference between the multiple fixed sizes allocated when dividing multiple memory areas and the size of the head of the memory area can be calculated, and the difference is determined as the size of the storage space of the memory area.

[0067] For example, referring to Table 2, if M is 1, N is 4, K is 11, and T is 8, the size of the head of the memory area is 24 bits, that is, 3B. Therefore, the size of the storage space of the memory area is the difference between the multiple fixed sizes allocated when dividing multiple memory areas minus 3B. Therefore, when dividing multiple storage spaces with fixed sizes in the memory pool, if the sizes of the respective memory areas in the memory pool are 512B, 256B, 128B, 64B, and 32B respectively, the sizes of the storage spaces of the respective memory areas are 509B, 253B, 125B, 61B, and 29B respectively.

[0068] Further, the second identifier can be determined according to the correspondence between the pre-set second identifier and the storage space size of the memory area. The correspondence between the second identifier and the storage space size of the memory area is listed in Table 4 below.

[0069] If the storage space size of the memory area is 509B, then the positions corresponding to the 2nd to 5th bits in this memory area are set to 0001, that is, the second identifier of this memory area is 0001; if the storage space size of the memory area is 253B, then the positions corresponding to the 2nd to 5th bits in this memory area are set to 0010, that is, the second identifier of this memory area is 0010; if the storage space size of the memory area is 125B, then the positions corresponding to the 2nd to 5th bits in this memory area are set to 0011, that is, the second identifier of this memory area is 0011; if the storage space size of the memory area is 61B, then the positions corresponding to the 2nd to 5th bits in this memory area are set to 0100, that is, the second identifier of this memory area is 0100; if the storage space size of the memory area is 29B, then the positions corresponding to the 2nd to 5th bits in this memory area are set to 0101, that is, the second identifier of this memory area is 0101.

[0070] Second identifier Size of the storage space of the memory area (B) 0001 509 0010 253 0011 125 0100 61 0101 29

[0071] Table 4

[0072] Step 204: Determine multiple available memory areas among the multiple memory areas according to the first identifier of each memory area. The available memory area is a memory area that does not store the data block.

[0073] In this step, before storing the target data in multiple target memory areas, it is necessary to determine multiple memory areas that do not store the data block among the multiple memory areas divided in the memory pool as the available memory areas for storing the target data block corresponding to the target data.

[0074] Specifically, since the first identifier in the header of the memory area represents whether the storage space of the memory area stores a data block, multiple available memory areas among the multiple memory areas can be determined according to the first identifier of each memory area in the memory pool.

[0075] Step 205: Determine the storage space size of the available memory area according to the second identifier of the available memory area.

[0076] In this step, before storing the target data in multiple target memory areas, it is necessary to determine, among the multiple memory areas divided in the memory pool, the target memory area that matches the target data block corresponding to the target data. Therefore, first, according to the second identifiers of the multiple available memory areas determined in the above steps, the storage space sizes of the multiple available memory areas can be determined, so as to determine, among the multiple available memory areas, the target memory area that matches the target data block corresponding to the target data.

[0077] Step 206: Receive the target data. According to the storage space sizes of the multiple available memory areas and the size of the target data, divide the target data into at least two target data blocks, and determine, among the multiple available memory areas, the target memory area that matches each target data block, to obtain at least two target memory areas.

[0078] In this step, after receiving the target data to be stored in the memory pool, the target data can be divided into at least two target data blocks according to the storage space sizes of the multiple available memory areas and the size of the target data, and the target memory area that matches each target data block can be determined among the multiple available memory areas, to obtain at least two target memory areas.

[0079] Optionally, the step of determining the target memory area that matches each target data block specifically includes the following sub-steps:

[0080] Sub-step 2061: Determine, among the multiple available memory areas, the first target memory area, where the first target memory area is the available memory area whose storage space size is smaller than the size of the target data and the difference from the size of the target data is the smallest.

[0081] In this step, among the multiple available memory areas, the available memory area whose storage space size is smaller than the size of the target data and the difference from the size of the target data is the smallest can be determined as the first target memory area.

[0082] For example, when the available memory areas include memory areas with storage space sizes of 253B, 125B, and 61B, if the size of the target data is 300B, the first target memory area is the memory area with a storage space size of 253B; if the size of the target data is 200B, the first target memory area is the memory area with a storage space size of 125B, so as to ensure that the target data is divided into at least two target data blocks and stored in the corresponding target memory areas.

[0083] Sub-step 2062: Determine a first target data block from a portion of the target data that is the same size as the storage space of the first target memory area.

[0084] In this step, after determining the first target memory area, a portion of the target data that is the same size as the storage space of the first target memory area can be determined as the first target data block.

[0085] For example, if the size of the target data is 300B and the first target memory area is a memory area with a storage space size of 253B, then a portion of the target data with a size of 253B can be determined as the first target data block; if the size of the target data is 200B and the first target memory area is a memory area with a storage space size of 125B, then a portion of the target data with a size of 125B can be determined as the first target data block.

[0086] Sub-step 2063: Among multiple available memory areas other than the first target memory area, determine a second target memory area, and determine a second target data block from a portion of the target data that matches the second target memory area.

[0087] In this step, after determining the first target memory area and the corresponding first target data block, a second target memory area can be further determined among multiple available memory areas other than the first target memory area, and a portion of the target data that matches the second target memory area can be determined as the second target data block.

[0088] For example, if the size of the target data is 350B, the first target memory area is a memory area with a storage space size of 253B, and the first target data block is a portion of the target data with a size of 253B, then the second target memory area needs to store the remaining portion of the target data with a size of 97B. Therefore, the second target memory area can be a memory area with a storage space size of 125B, and the second target data block is a portion of the target data with a size of 97B.

[0089] Optionally, the step of determining the second target memory area among multiple available memory areas other than the first target memory area specifically includes:

[0090] (1) Determine the size of the first remaining data as the difference between the size of the target data and the size of the first target data block.

[0091] In this step, after determining the first target data block, the size of the remaining data in the target data that needs to be stored, that is, the size of the first remaining data, can be further calculated.

[0092] Specifically, the difference between the size of the target data and the size of the first target data block can be calculated, and the difference can be determined as the size of the first remaining data to characterize the size of the data in the target data that has not been stored yet.

[0093] (2) Among multiple available memory regions other than the first target memory region, determine the second target memory region, where the second target memory region is the available memory region with the smallest difference between the storage space size and the size of the first remaining data.

[0094] In this step, after determining the first target memory region, the second target memory region for storing the other data in the target data except the first target data block can be further determined.

[0095] Specifically, the memory region with the smallest difference between the storage space size in the available memory regions and the size of the first remaining data can be determined as the second target memory region.

[0096] For example, when the available memory regions include memory regions with storage space sizes of 253B, 125B, and 61B, the size of the target data is 350B, the first target memory region is the memory region with a storage space size of 253B, the first target data block is a partial data of the target data with a size of 253B, and the size of the first remaining data is 97B. Among the available memory regions other than the first target memory region, the difference between the storage space size of the memory region with a size of 125B and the size of the first remaining data is the smallest. Therefore, the memory region with a storage space size of 125B can be determined as the second target memory region.

[0097] (3) Determine the size of the target data as the third identifier of the first target memory region.

[0098] Optionally, the identifier information of the memory region further includes a third identifier, where the third identifier characterizes the size of the remaining data, that is, the size of the remaining data that has not been stored yet before storing part of the data in the target memory region.

[0099] In this step, the third identifier of the first target memory region is the size of the target data.

[0100] (4) Determine the size of the first remaining data as the third identifier of the second target memory region.

[0101] In this step, the third identifier of the second target memory region is the size of the first remaining data.

[0102] Sub-step 2064: Determine the sum value of the storage space sizes of the first target memory area and the second target memory area. When the size of the target data is greater than the sum value, determine a third target memory area, and determine the part of the target data that matches the third target memory area as the third target data block until all of the target data is divided into the target data blocks.

[0103] In this step, after determining the first target memory area and the second target memory area, if the storage spaces of the first target memory area and the second target memory area are sufficient to store the target data, store the target data in the first target memory area and the second target memory area, and the storage process of the target data can be completed. If the storage spaces of the first target memory area and the second target memory area are insufficient to store the target data, it is necessary to further determine a third target memory area for jointly storing the target data using the first target memory area, the second target memory area, and the third target memory area. If the storage spaces of the first target memory area, the second target memory area, and the third target memory area are still insufficient to store the target data, it is necessary to further determine a fourth target memory area until the storage space of the determined target memory area is sufficient to store the target data.

[0104] Specifically, after determining the first target memory area and the second target memory area, the sum value of the storage space sizes of the first target memory area and the second target memory area can be determined, and based on the size relationship between the target data and the sum value, it can be judged whether it is necessary to continue to determine the third target memory area.

[0105] For example, if the size of the target data is 850B, the storage space sizes of the memory areas in the memory pool are 509B, 253B, 128B, 64B, and 32B, the first target memory area is the memory area with a storage space size of 509B, the first target data block is the part of the target data with a size of 253B, the second target memory area is the memory area with a storage space size of 253B, and the second target data block is the part of the target data with a size of 253B. At this time, the sum value of the storage space sizes of the first target memory area and the second target memory area is 762B, that is, the first target memory area and the second target memory area can store data with a size of 762B. The size of the target data is greater than this sum value. Therefore, continue to determine the third target data block until the sum value of the storage space sizes of the determined target memory areas is greater than or equal to the size of the target data, which means that the target memory area is sufficient to store the target data, and all of the target data can be divided into the target data blocks, and then the target data blocks can be stored in the corresponding target memory areas to complete the storage process of the target data.

[0106] Among them, the process of determining the third target memory area is the same as that of determining the second target memory area, which will not be elaborated here.

[0107] Step 207: Store each of the target data blocks in the corresponding target memory area.

[0108] This step can specifically refer to the above-mentioned step 103, which will not be elaborated here.

[0109] Step 208: Establish a correspondence between the identifier of the target data and the first target memory area.

[0110] In this step, in order to identify the storage location of the target data in the memory pool so that when reading the target data, the storage location of the target data can be located in the memory pool. After storing each of the target data blocks in the target memory area that matches the target data block, the starting address of the first target memory area can be determined, and then a correspondence between the identifier of the target data and the starting address of the first target memory area can be established.

[0111] Step 209: Establish an association relationship between each of the target memory areas.

[0112] In this step, in order to identify the storage locations of all the target data blocks in the target data in the memory pool so that when reading the target data, all the storage locations of the target data can be located in the memory pool. An association relationship between each of the target memory areas can be established while establishing a correspondence between the identifier of the target data and the starting address of the first target memory area, thereby completing the storage of the target data.

[0113] Optionally, the identification information of the memory area further includes a fourth identifier, and the fourth identifier represents the identifier of the data corresponding to the data block stored in the memory area.

[0114] The above step of establishing the association relationship between the target memory areas may specifically include:

[0115] Sub-step 2091: Determine the identifier of the target data and determine the identifier of the target data as the fourth identifier of each of the target memory areas.

[0116] In this step, the identifier of the target data can be determined and the identifier of the target data can be used as the fourth identifier of the target memory area, so that the data stored in the memory area can be determined through the fourth identifier at the head of the data area in the memory pool, and the target memory areas storing different target data blocks of the same target data have the same fourth identifier.

[0117] Further, when extracting target data from different memory areas in the memory pool, the identifier of the target data can be determined first, and the starting address of the first target memory area can be determined in the memory area, so as to determine the first target memory area. According to the fourth identifier of the first target memory area, the fourth identifiers of each memory area in the memory pool are queried, and the memory area with the same fourth identifier as that of the first target memory area is determined as the target memory area storing the target data. The data stored in these target memory areas is partial data of the target data, that is, the target data block. Therefore, by extracting the data stored in these target memory areas, the reading of all the content of the target data can be completed.

[0118] It should be noted that when determining the target memory area from the memory pool, verification can also be performed according to the third identifier of each memory area. Since the third identifier of the first target memory area is the size of the target data, after determining the first target memory area through the corresponding relationship between the identifier of the target data and the starting address of the first target memory area, the third identifier of the first target memory area can be compared with the size of the target data to verify the first target memory area. If the two are equal, it means that this memory area is the first target memory area.

[0119] Similarly, when determining other target memory areas according to the fourth identifier of the first target memory area, verification can also be performed according to the third identifier of each target memory area. For example, since the third identifier of the second target memory area is the size of the first remaining data, the difference between the size of the target data and the size of the first target data block can be compared with the size of the third identifier of the second target memory area to verify the second target memory area. If the two are equal, it means that this memory area is the second target memory area.

[0120] Step 210, in the case of receiving a read instruction for the target data, extract the target data block from the first target memory area according to the corresponding relationship.

[0121] In this step, if a read instruction for the target data is received, the first target memory area can be determined according to the corresponding relationship between the identifier of the target data and the starting address of the first target memory area, and the first target data block can be extracted from the first target memory area.

[0122] Step 211, determine other target memory areas except the first target memory area among at least two of the target memory areas according to the association relationship, and extract the target data blocks stored in the other target memory areas to complete the reading of the target data.

[0123] In this step, after the first target data block is extracted from the first target memory area, other target memory areas other than the first target memory area can be further determined according to the association relationship between the target memory areas, and other target data blocks stored in the other target memory areas can be extracted to complete the reading of the target data.

[0124] Optionally, the step of determining other target memory areas other than the first target memory area among at least two of the target memory areas according to the association relationship specifically includes:

[0125] Sub-step 2111: Determine the memory areas with the same fourth identifier as the fourth identifier of the first target memory area as the other target memory areas according to the fourth identifier of the first target memory area.

[0126] In this step, after the first target memory area is determined, the fourth identifiers of each memory area in the memory pool can be queried according to the fourth identifier of the first target memory area, and the memory areas with the same fourth identifier as the fourth identifier of the first target memory area are determined as the other target memory areas storing the target data. The data stored in these other target memory areas are partial data of the target data, that is, target data blocks. Therefore, by extracting the data stored in these other target memory areas, the reading of all the content of the target data can be completed.

[0127] In the embodiment of the present invention, if a deletion instruction for the target data is received, the first target memory area can be determined according to the correspondence between the identifier of the target data and the start address of the first target memory area, and the first target data block stored in the first target memory area can be deleted. Further, the fourth identifiers of each memory area in the memory pool can be queried according to the fourth identifier of the first target memory area, and the memory areas with the same fourth identifier as the fourth identifier of the first target memory area are determined as the other target memory areas storing the target data, and the data stored in these other target memory areas are also deleted, so that the deletion of all the content of the target data can be completed.

[0128] In summary, a data processing method provided by an embodiment of the present invention includes: dividing a plurality of memory areas in a memory pool; dividing the received target data into at least two target data blocks, and determining, in the plurality of memory areas, target memory areas that match each target data block; storing each target data block in the corresponding target memory area, establishing a correspondence between the identifier of the target data and the first target memory area, and establishing an association relationship between the respective target memory areas, where the first target memory area is one of the at least two target memory areas; in the case of receiving a read instruction for the target data, extracting the target data block from the first target memory area according to the correspondence; determining, according to the association relationship, other target memory areas in the at least two target memory areas other than the first target memory area, and extracting the target data blocks stored in the other target memory areas to complete the reading of the target data. In the present invention, when storing the received target data in the memory pool, the target data is divided into at least two target data blocks, and the at least two target data blocks are separately stored in different target memory areas in the corresponding memory pool, and a correspondence between the identifier of the target data and one of the target memory areas is established, and an association relationship between the respective different target memory areas is established. Thus, when reading the target data in the memory pool, in the case of only determining the correspondence, only the target data block stored in one target memory area can be determined through the correspondence, that is, only a part of the target data can be obtained. Only in the case of further determining the association relationship between the different target memory areas can the other target memory areas storing the other part of the target data blocks in the target data be further determined, and then all the content of the target data can be obtained, thereby improving the security of storing data in the memory.

[0129] In addition, when reading the target data, the third identifier in the head of the memory area can be used to verify whether the memory area is the target memory area storing different target data blocks, thereby improving the accuracy of data reading.

[0130] In an embodiment of the present invention, as shown in Table 1, the plurality of memory areas may be arranged in sequence according to the size of the storage space. Figure 3 The following is a flowchart of the steps for determining the target memory area of the present invention. As Figure 3 shown, the steps for determining the target memory area among a plurality of available memory areas include:

[0131] S1, whether the size of the target data is greater than 2A1.

[0132] In an embodiment of the present invention, after determining the available memory areas among the plurality of memory areas, the storage space size of the first available memory area among the available memory areas, that is, the largest available memory area, can be determined as A1.

[0133] Further, before determining the target memory area, it is necessary to judge the size of the target data and 2A1. If the target data is greater than 2A1, it means that the target data is greater than twice the storage space size of the largest available memory area. The target data has a large data volume relative to the memory pool containing the available memory area and is not suitable for storage in the memory area of this memory pool. Then, step S2 is executed; if the target data is less than or equal to 2A1, it means that the target data is suitable for storage in the memory area of this memory pool. Then, step S3 is executed to determine the target memory area for storing the target data in the available memory area.

[0134] S2, return failure.

[0135] S3, whether the size of the target data is greater than Ai.

[0136] In this step, it is necessary to judge whether the size of the target data is greater than Ai, where i≥1, that is, starting from the first available memory area in the available memory area, judge whether the target data is greater than the size of this available memory area. If the target data is less than or equal to the size of the i-th available memory area, it means that the target data has a small data volume relative to the i-th available memory area, and only the i-th available memory area can be used to complete the storage of the target data without dividing the target data into multiple target data blocks for separate storage. Therefore, step S6 is executed; if the target data is greater than the size of the i-th available memory area, it means that part of the data in the target data can be stored in the i-th available memory area, that is, the i-th memory area can be determined as the target memory area. Therefore, step S4 is executed.

[0137] S4, determine the i-th memory area as the target memory area.

[0138] In this step, since the target data is greater than the size of the i-th available memory area, it means that part of the data in the target data can be stored in the i-th available memory area, that is, the i-th memory area can be determined as the target memory area. At the same time, the part of the target data with a size of Ai is determined as the first target data block, and the first target data block is stored in the i-th available memory area.

[0139] S5, determine the difference between the size of the target data and Ai as the remaining data.

[0140] In this step, since part of the target data with a size of Ai has been stored in the i-th available memory area, the difference between the size of the target data and Ai can be determined as the remaining data, and continue to determine the target memory area for storing the remaining data in other available memory areas.

[0141] S6, i = i + 1.

[0142] In this step, the value of i + 1 can be assigned to i, so as to start from the (i + 1)-th available memory area and determine the target memory area for storing the remaining data. Step S3 is repeatedly executed until the remaining data is less than or equal to 0, that is, until all the target data is stored in the corresponding memory areas, and then the process of determining the target memory area ends.

[0143] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequences, because according to the embodiments of the present invention, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.

[0144] Refer to Figure 4 , which shows a structural block diagram of a data processing device of the present invention, and specifically may include the following modules:

[0145] The first partitioning module 301 is used to partition a plurality of memory areas in the memory pool;

[0146] The second partitioning module 302 is used to partition the received target data into at least two target data blocks, and determine the target memory area matching each target data block among the plurality of memory areas;

[0147] The storage module 303 is used to store each target data block in the corresponding target memory area, and establish the correspondence between the identifier of the target data and the first target memory area, and establish the association relationship between the target memory areas, where the first target memory area is one of at least two target memory areas;

[0148] The first extraction module 304 is used to extract the target data block from the first target memory area according to the correspondence when receiving the read instruction for the target data;

[0149] The second extraction module 305 is used to determine the other target memory areas except the first target memory area among at least two target memory areas according to the association relationship, and extract the target data blocks stored in the other target memory areas to complete the reading of the target data.

[0150] Optionally, the memory area includes the head of the memory area and the storage space of the memory area. The head of the memory area is used to store the identification information of the memory area. The identification information of the memory area includes a first identifier and a second identifier. The first identifier indicates whether the storage space of the memory area stores a data block. The second identifier indicates the size of the storage space of the memory area. The storage space of the memory area is used to store the data block.

[0151] The first partitioning module 301 specifically includes:

[0152] A first sub-partitioning module, configured to partition a plurality of storage spaces of a fixed size in the memory pool according to a preset rule to generate the plurality of memory areas;

[0153] A first determination sub-module, configured to determine the first identifier of the memory area according to whether the storage space of the memory area stores the data block;

[0154] A second determination sub-module, configured to determine, according to the preset size of the head of the memory area, the difference between the fixed size and the size of the head of the memory area as the size of the storage space of the memory area, and determine the second identifier of the memory area according to the size of the storage space of the memory area.

[0155] Optionally, the second partitioning module 302 specifically includes:

[0156] A third determination sub-module, configured to determine a plurality of available memory areas among the plurality of memory areas according to the first identifier of each memory area. The available memory area is a memory area that does not store the data block;

[0157] A fourth determination sub-module, configured to determine the size of the storage space of the available memory area according to the second identifier of the available memory area;

[0158] A second sub-partitioning module, configured to divide the target data into at least two target data blocks according to the size of the storage space of the plurality of available memory areas and the size of the target data, and determine a target memory area matching each target data block among the plurality of available memory areas.

[0159] Optionally, the second sub-partitioning module specifically includes:

[0160] A first determination unit, configured to determine the first target memory area among the plurality of available memory areas. The first target memory area is an available memory area whose storage space size is smaller than the size of the target data and the difference from the size of the target data is the smallest;

[0161] A second determination unit, configured to determine, as a first target data block, a part of the target data that has the same storage space size as that of the first target memory area;

[0162] A third determination unit, configured to determine, in multiple available memory areas other than the first target memory area, a second target memory area, and determine, as a second target data block, a part of the target data that matches the second target memory area;

[0163] A fourth determination unit, configured to determine a sum value of the storage space sizes of the first target memory area and the second target memory area, and in a case where the size of the target data is greater than the sum value, determine a third target memory area, and determine, as a third target data block, a part of the target data that matches the third target memory area, until all of the target data is divided into the target data blocks.

[0164] Optionally, the third determination unit specifically includes:

[0165] A first determination subunit, configured to determine, as the size of a first remaining data, a difference between the size of the target data and the size of the first target data block;

[0166] A second determination subunit, configured to determine, in multiple available memory areas other than the first target memory area, the second target memory area, where the second target memory area is an available memory area with the smallest difference between the storage space size and the size of the first remaining data.

[0167] Optionally, the identification information of the memory area further includes a third identifier, where the third identifier represents the size of the remaining data,

[0168] The apparatus further includes:

[0169] A third determination subunit, configured to determine the size of the target data as the third identifier of the first target memory area;

[0170] A fourth determination subunit, configured to determine the size of the first remaining data as the third identifier of the second target memory area.

[0171] Optionally, the identification information of the memory area further includes a fourth identifier, where the fourth identifier represents an identifier of data corresponding to a data block stored in the memory area,

[0172] The storage module includes:

[0173] A fifth determination submodule, configured to determine an identifier of the target data, and determine the identifier of the target data as the fourth identifier of each of the target memory areas;

[0174] The second extraction module includes:

[0175] A sixth determination sub-module, configured to determine, according to a fourth identifier of the first target memory area, a memory area having the same fourth identifier as the other target memory area.

[0176] In summary, a data processing device provided by an embodiment of the present invention includes: dividing a plurality of memory areas in a memory pool; dividing received target data into at least two target data blocks, and determining, in the plurality of memory areas, target memory areas matching each target data block; storing each target data block in a corresponding target memory area, establishing a correspondence between an identifier of the target data and a first target memory area, and establishing an association relationship between the target memory areas, the first target memory area being one of at least two of the target memory areas; in the case of receiving a read instruction for the target data, extracting a target data block from the first target memory area according to the correspondence; determining, according to the association relationship, other target memory areas in addition to the first target memory area among at least two target memory areas, and extracting target data blocks stored in the other target memory areas to complete the reading of the target data. In the present invention, when storing the received target data in the memory pool, the target data is divided into at least two target data blocks, and the at least two target data blocks are separately stored in different target memory areas corresponding thereto in the memory pool, and a correspondence between an identifier of the target data and one of the target memory areas is established, and an association relationship between the different target memory areas is established. Therefore, when reading the target data in the memory pool, in the case of only determining the correspondence, only the target data block stored in one target memory area can be determined through the correspondence, that is, only a part of the target data can be obtained. Only when the association relationship between the different target memory areas is further determined can the other target memory areas storing the other part of the target data blocks in the target data be further determined, and then all the content of the target data can be obtained, thereby improving the security of storing data in the memory.

[0177] Preferably, an embodiment of the present invention further provides a device, including one or more processors; and one or more machine-readable media storing instructions thereon, which, when executed by the one or more processors, cause the device to execute the above-mentioned data processing method for one or more, and can achieve the same technical effect. To avoid repetition, it will not be described here again.

[0178] An embodiment of the present invention further provides a computer-readable storage medium, and a computer program stored thereon causes a processor to execute the above-mentioned data processing method.

[0179] For the device embodiments, since they are basically similar to the method embodiments, they are described relatively simply. For the relevant parts, please refer to the corresponding descriptions in the method embodiments.

[0180] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.

[0181] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention can take the form of all-hardware embodiments, all-software embodiments, or embodiments combining software and hardware aspects. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0182] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the processes and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0183] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process. Therefore, the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0185] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0186] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the element.

[0187] The above has introduced in detail a method and device for processing a kind of data provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A data processing method, characterized in that: The method comprises: Divide the memory pool into multiple memory slices; Divide the received target data into at least two target data blocks, and determine a target memory area matching each of the target data blocks among the plurality of memory areas; Each of the target data blocks is stored in a corresponding target memory slice, and a corresponding relationship between the identifier of the target data and a first target memory slice is established, as well as an association relationship between the target memory slices, wherein the first target memory slice is one of at least two target memory slices; When receiving a read instruction for the target data, extracting a target data block from the first target memory area according to the corresponding relationship; According to the association relationship, determine other target memory slices except the first target memory slice in at least two of the target memory slices, and extract target data blocks stored in the other target memory slices to complete the reading of the target data; The memory slice includes a memory slice header and a memory slice storage space, wherein the memory slice header is used to store identification information of the memory slice, and the identification information of the memory slice includes a first identification and a second identification, wherein the first identification indicates whether the storage space of the memory slice stores a data block, and the second identification indicates the size of the storage space of the memory slice, and the storage space of the memory slice is used to store the data block. The step of dividing the memory pool into multiple memory slices specifically includes: According to a preset rule, a plurality of storage spaces with fixed sizes are divided in the memory pool to generate the plurality of memory slices; Determine a first identifier of the memory slice according to whether the storage space of the memory slice stores the data block; According to the preset size of the header of the memory slice, the difference between the fixed size and the size of the header of the memory slice is determined as the size of the storage space of the memory slice, and the second identifier of the memory slice is determined according to the size of the storage space of the memory slice.

2. The method according to claim 1, characterized in that The step of dividing the received target data into at least two target data blocks, and determining a target memory area matching each of the target data blocks in the plurality of memory areas, specifically comprises: Determine, according to the first identifier of each of the memory slices, a plurality of available memory slices among the plurality of the memory slices, the available memory slices being memory slices that do not store the data block; Determining the size of the storage space of the available memory slice according to the second identifier of the available memory slice; According to the size of the storage space of the multiple available memory slices and the size of the target data, the target data is divided into at least two target data blocks, and a target memory slice matching each target data block is determined in the multiple available memory slices.

3. The method according to claim 2, characterized in that The step of dividing the target data into at least two target data blocks according to the size of the storage space of the plurality of available memory slices and the size of the target data, and determining a target memory slice matching each target data block in the plurality of available memory slices specifically comprises: Determine the first target memory slice among the plurality of available memory slices, where the first target memory slice is an available memory slice whose storage space size is smaller than the size of the target data and whose difference with the size of the target data is the smallest; Determine a portion of the target data having the same size as the storage space of the first target memory slice as a first target data block; Determine a second target memory slice from a plurality of available memory slices other than the first target memory slice, and determine a portion of the target data that matches the second target memory slice as a second target data block; Determine the sum of the size of the storage space of the first target memory slice and the size of the storage space of the second target memory slice. If the size of the target data is larger than the sum, determine a third target memory slice, and determine part of the target data that matches the third target memory slice as a third target data block, until all the target data are divided into the target data blocks.

4. The method according to claim 3, characterized in that: The step of determining a second target memory slice from a plurality of available memory slices other than the first target memory slice specifically comprises: Determine the difference between the size of the target data and the size of the first target data block as the size of the first remaining data; The second target memory slice is determined among a plurality of available memory slices except the first target memory slice, where the second target memory slice is an available memory slice having the smallest difference between the size of the storage space and the size of the first remaining data.

5. The method according to claim 4, characterized in that The identification information of the memory area also includes a third identifier, and the third identifier represents the size of the remaining data. After the step of determining the second target memory slice among a plurality of available memory slices other than the first target memory slice, the method further comprises: Determine the size of the target data as a third identifier of the first target memory slice; The size of the first remaining data is determined as a third identifier of the second target memory slice.

6. The method according to claim 1, characterized in that The identification information of the memory slice also includes a fourth identification, and the fourth identification represents the identification of data corresponding to the data block stored in the memory slice. The step of establishing the association relationship between the target memory slices includes: Determine the identifier of the target data, and determine the identifier of the target data as a fourth identifier of each target memory slice; The step of determining other target memory slices except the first target memory slice in at least two target memory slices according to the association relationship comprises: According to the fourth identifier of the first target memory slice, a memory slice having the same fourth identifier is determined as the other target memory slice.

7. A data processing device, characterized in that: The device comprises: A first partitioning module is used to partition a memory pool into a plurality of memory slices; A second partitioning module is used to partition the received target data into at least two target data blocks, and determine a target memory area matching each target data block among the plurality of memory areas; A storage module, used for storing each of the target data blocks in a corresponding target memory slice, establishing a corresponding relationship between the identifier of the target data and a first target memory slice, and establishing an association relationship between the target memory slices, wherein the first target memory slice is one of at least two target memory slices; A first extraction module, configured to extract a target data block from the first target memory area according to the corresponding relationship when receiving a read instruction for the target data; A second extraction module is used to determine other target memory areas except the first target memory area among at least two target memory areas according to the association relationship, and extract target data blocks stored in the other target memory areas to complete the reading of the target data; The memory slice includes a memory slice header and a memory slice storage space, wherein the memory slice header is used to store identification information of the memory slice, and the identification information of the memory slice includes a first identification and a second identification, wherein the first identification indicates whether the storage space of the memory slice stores a data block, and the second identification indicates the size of the storage space of the memory slice, and the storage space of the memory slice is used to store the data block. The first division module specifically includes: A first division submodule, used for dividing a plurality of storage spaces with fixed sizes in the memory pool according to a preset rule to generate the plurality of memory slices; A first determining submodule, configured to determine a first identifier of the memory slice according to whether the storage space of the memory slice stores the data block; The second determination submodule is used to determine the difference between the fixed size and the size of the header of the memory slice as the size of the storage space of the memory slice according to the preset size of the header of the memory slice, and determine the second identifier of the memory slice according to the size of the storage space of the memory slice.

8. A device, characterized in that: include: one or more processors; and One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, cause the device to perform the data processing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer program stored therein enables the processor to execute the data processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for secure data storage

    DE102013112391A1

  • Methods of and apparatus for storing data in memory in data processing systems

    US20130198485A1