Data processing method, device, electronic device and computer readable storage medium
By transferring the target mapping table from the flash memory to the data storage area of the random access memory during data operations, the problem of frequent flash memory access caused by the small capacity of the random access memory mapping table is solved and the data operation efficiency is improved.
Patent Information
- Application Number
- CN202310659113.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-06-05
AI Technical Summary
In the existing technology, the capacity of the mapping table of the random access memory is small, which results in the need to frequently access the flash memory during data operations, which reduces the efficiency of data reading and writing.
By detecting whether the target mapping table exists in the random access memory, and if it does not exist, it is determined from the flash memory and stored in the data storage area of the random access memory, thereby reducing the number of accesses to the flash memory.
The efficiency of data operations is improved, the number of accesses to flash memory is reduced, the number of mapping tables stored in random access memory is increased, and the dependence on flash memory is reduced.
Smart Images

Figure CN116880746B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method, device, electronic device and computer-readable storage medium. Background Art
[0002] Storage devices based on flash memory, such as solid state disks (SSDs) and universal flash storage (UFS), usually use page mapping when performing read and write operations. The storage space of random access memory (RAM) is usually divided into a mapping table storage area and a data storage area. Since the capacity of the mapping table storage area of RAM is small, only a small number of mapping tables can be stored. Most of the mapping tables are stored in the flash memory. Therefore, when performing data operations, such as data writing or data reading, it is necessary to first read the mapping table from the flash memory, and then access the random access memory according to the mapping table. When multiple mapping tables corresponding to random data reading and writing are stored in the flash memory, it is necessary to access the flash memory multiple times, resulting in low data reading and writing efficiency. Summary of the invention
[0003] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a data processing method, device, electronic device and computer-readable storage medium, which can reduce the number of accesses to a flash memory when performing data operations, thereby improving the efficiency of data operations.
[0004] The first aspect of the present application provides a data processing method, including:
[0005] Obtaining a first data operation request;
[0006] According to the first data operation request, detecting whether there is a target mapping table corresponding to the first data operation request in the random access memory;
[0007] In a case where it is detected that the random access memory does not have the target mapping table, determining the target mapping table corresponding to the first data operation request from a flash memory;
[0008] According to the first data operation request, detecting whether the remaining capacity of the data storage area of the random access memory can store the target mapping table;
[0009] When it is detected that the remaining capacity of the data storage area is capable of storing the target mapping table, the target mapping table is stored in the data storage area.
[0010] According to the data processing method of the embodiment of the present application, at least the following beneficial effects are achieved: after receiving the first data operation request, the method of the embodiment of the present application detects whether there is a target mapping table corresponding to the first data operation request in the random access memory according to the first data operation request; when it is detected that the random access memory does not have the target mapping table, the target mapping table corresponding to the first data operation request is determined from the flash memory; according to the first data operation request, it is detected whether the remaining capacity of the data storage area of the random access memory can store the target mapping table; when it is detected that the remaining capacity of the data storage area can store the target mapping table, the target mapping table is stored in the data storage area. The data processing method of the embodiment of the present application stores the target mapping table in the data storage area of the random access memory so that the random access memory can store more mapping tables. When the target mapping table corresponding to the data operation is stored in the random access memory, there is no need to access the flash memory when performing the data operation. Therefore, the random access memory storing more mapping tables can reduce the number of times the flash memory is accessed, thereby improving the efficiency of data operation.
[0011] According to some embodiments of the first aspect of the present application, detecting, according to the first data operation request, whether there is a target mapping table corresponding to the first data operation request in a random access memory includes:
[0012] According to the first data operation request, detecting whether the target mapping table exists in the mapping table storage area;
[0013] In the case where it is detected that the target mapping table does not exist in the mapping table storage area, detecting whether the target mapping table exists in the data storage area;
[0014] In the case where it is detected that the target mapping table does not exist in the data storage area, it is determined that the target mapping table does not exist in the random access memory.
[0015] According to some embodiments of the first aspect of the present application, before detecting, according to the first data operation request, whether the remaining capacity of the data storage area of the random access memory can store the target mapping table, the method further includes:
[0016] Detecting whether the remaining capacity of the mapping table storage area of the random access memory is sufficient to store the target mapping table;
[0017] When it is detected that the remaining capacity of the mapping table storage area is capable of storing the target mapping table, the target mapping table is stored in the mapping table storage area.
[0018] According to some embodiments of the first aspect of the present application, after storing the target mapping table in the data storage area, the method further includes:
[0019] Acquire a second data operation request, where the second data operation request includes data to be written;
[0020] Detecting whether the remaining capacity of the data storage area is less than the data length of the data to be written;
[0021] When it is detected that the remaining capacity of the data storage area is less than the data length of the data to be written, part or all of the target mapping tables in the data storage area are deleted to make the remaining capacity of the data storage area greater than the data length of the data to be written.
[0022] According to some embodiments of the first aspect of the present application, deleting part or all of the target mapping tables in the data storage area so that the remaining capacity of the data storage area is greater than the data length of the data to be written includes:
[0023] Determining a target mapping table deletion amount according to the data length of the data to be written and the remaining capacity of the data storage area;
[0024] The target mapping table in the data storage area is deleted according to the target mapping table deletion amount.
[0025] According to some embodiments of the first aspect of the present application, deleting the target mapping table in the data storage area according to the target mapping table deletion amount includes:
[0026] The target mapping table in the data storage area is deleted according to the target mapping table deletion amount by using a least recently used algorithm or a least frequently used page replacement algorithm.
[0027] According to some embodiments of the first aspect of the present application, the first data operation request includes a logical address and a first data operation;
[0028] After determining the target mapping table corresponding to the first data operation request from the flash memory, the method further includes:
[0029] Determine a physical address corresponding to the logical address from the target mapping table;
[0030] The first data operation is performed according to the physical address.
[0031] A second aspect of the present application provides a data processing device, including:
[0032] A receiving unit, configured to obtain a first data operation request;
[0033] a flash memory detection unit, configured to detect, according to the first data operation request, whether a target mapping table corresponding to the first data operation request exists in the random access memory;
[0034] a flash memory determining unit, configured to determine the target mapping table corresponding to the first data operation request from a flash memory when detecting that the target mapping table does not exist in the random access memory;
[0035] a data storage area detection unit, configured to detect, according to the first data operation request, whether the remaining capacity of the data storage area of the random access memory can store the target mapping table;
[0036] The storage unit is used to store the target mapping table in the data storage area when it is detected that the remaining capacity of the data storage area can store the target mapping table.
[0037] A third aspect of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the data processing method of the first aspect is implemented.
[0038] The fourth aspect of the present application provides a computer-readable storage medium, which stores a computer program, and is characterized in that when the computer program is executed by a processor, it implements the data processing method as described in any one of the first aspect embodiments.
[0039] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The present application is further described below with reference to the accompanying drawings and embodiments, wherein:
[0041] Figure 1 A flowchart of the steps of the data processing method of some embodiments of the present application;
[0042] Figure 2 A flowchart of the steps of the data processing method of some other embodiments of the present application;
[0043] Figure 3 A flowchart of the steps of the data processing method of some other embodiments of the present application;
[0044] Figure 4 A flowchart of the steps of the data processing method of some other embodiments of the present application;
[0045] Figure 5 A flowchart of the steps of the data processing method of some other embodiments of the present application;
[0046] Figure 6A schematic diagram of the structure of a data processing device according to some embodiments of the present application;
[0047] Figure 7 This is a schematic diagram of the structure of an electronic device according to some embodiments of the present application. DETAILED DESCRIPTION
[0048] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0049] In the description of the present application, it should be understood that descriptions involving orientation, such as up, down, front, back, left, right, etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0050] In the description of this application, "several" means more than one, "more" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0051] In the description of this application, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in this application based on the specific content of the technical solution.
[0052] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0053] In the related art, the storage space of the random access memory RAM is usually divided into a mapping table storage area and a data storage area. Since the capacity of the mapping table storage area of the RAM is small, only a small number of target mapping tables can be stored, and most of the target mapping tables are stored in the flash memory. Therefore, when performing data operations, such as data writing or data reading, it is necessary to first read the mapping table from the flash memory, and then access the random access memory according to the mapping table. When multiple mapping tables corresponding to random data reading and writing are stored in the flash memory, it is necessary to access the flash memory multiple times, resulting in low data reading and writing efficiency. For example, the data operation is random reading and writing, and the random reading and writing corresponds to 10 target mapping tables, of which 8 target mapping tables are stored in the flash memory and 2 target mapping tables are stored in the random access memory. When performing the data operation, it is necessary to access the flash memory 8 times, which is inefficient. Based on this, the present application proposes a data processing method, device, electronic device and computer-readable storage medium, which can enable a random access memory to store more mapping tables. When performing data operations, the corresponding target mapping table has a greater probability of being located in the random access memory, thereby reducing the number of times the flash memory is accessed, thereby improving the efficiency of data operations.
[0054] Reference Figure 1 The first aspect of the present application provides a data processing method, including but not limited to the following steps:
[0055] Step S110, obtaining a first data operation request;
[0056] Step S120, according to the first data operation request, detecting whether there is a target mapping table corresponding to the first data operation request in the random access memory;
[0057] Step S130, when it is detected that the random access memory does not have a target mapping table, determining a target mapping table corresponding to the first data operation request from the flash memory;
[0058] Step S140, according to the first data operation request, detecting whether the remaining capacity of the data storage area of the random access memory can store the target mapping table;
[0059] Step S150: When it is detected that the remaining capacity of the data storage area is capable of storing the target mapping table, the target mapping table is stored in the data storage area.
[0060] After receiving a first data operation request, the method of the embodiment of the present application detects whether there is a target mapping table corresponding to the first data operation request in the random access memory according to the first data operation request; when it is detected that the random access memory does not have the target mapping table, the target mapping table corresponding to the first data operation request is determined from the flash memory; according to the first data operation request, it is detected whether the remaining capacity of the data storage area of the random access memory can store the target mapping table; when it is detected that the remaining capacity of the data storage area can store the target mapping table, the target mapping table is stored in the data storage area. The data processing method of the embodiment of the present application stores the target mapping table in the data storage area of the random access memory so that the random access memory can store more mapping tables. When the target mapping table corresponding to the data operation is stored in the random access memory, there is no need to access the flash memory when performing the data operation. Therefore, the random access memory storing more mapping tables can reduce the number of times the flash memory is accessed, thereby improving the efficiency of data operations.
[0061] It should be noted that the data processing method of the embodiment of the present application can be applied to an electronic device having a flash memory and a random access memory. The electronic device can include any intelligent terminal such as a desktop computer, a laptop computer, a tablet computer, and a car computer.
[0062] It is worth noting that in step S140, according to the first data operation request, it is detected whether the remaining capacity of the data storage area of the random access memory can store the target mapping table; when the first data operation request is a data write request, the first data operation request includes the data to be written, determines the data length of the data to be written, determines the remaining capacity of the data storage area, determines the data length of the target mapping table, and if the remaining capacity of the data storage area is greater than the data length of the data to be written + the data length of the target mapping table, it indicates that the remaining capacity of the data storage area can store the target mapping table. When the first data operation request is a data read request, if the remaining capacity of the data storage area is greater than the data length of the target mapping table, it indicates that the remaining capacity of the data storage area can store the target mapping table.
[0063] It should be noted that the first data operation request may be generated by the electronic device during the execution of the computer program. For example, the first data operation request may be a data write request. During the execution of the computer program, the electronic device needs to write data to the random access memory, thereby generating a data write request. The first data operation request may also be a data read request. During the execution of the computer program, the electronic device needs to read data from the random access memory, thereby generating a data read request.
[0064] It can be understood that the first data operation request includes a logical address and a first data operation; Figure 2After step S130, the following steps are also included but not limited to:
[0065] Step S210, determining a physical address corresponding to the logical address from a target mapping table;
[0066] Step S220, performing a first data operation according to the physical address.
[0067] For example, if the first data operation is a data read operation, the first data operation includes a logical address corresponding to the data to be read. In step S130, a target mapping table containing the logical address is determined in the flash memory according to the logical address, and then a physical address corresponding to the logical address is determined from the target mapping table, and then the first data operation is performed according to the physical address to read the data stored at the physical address.
[0068] It is understandable that, referring to Figure 3 Step S120 may include but is not limited to the following steps:
[0069] Step S310, detecting whether a target mapping table exists in a mapping table storage area according to the first data operation request;
[0070] Step S320, in the case where it is detected that the target mapping table does not exist in the mapping table storage area, detecting whether the target mapping table exists in the data storage area;
[0071] Step S330: When it is detected that the target mapping table does not exist in the data storage area, it is determined that the random access memory does not exist the target mapping table.
[0072] The first data operation request usually includes a logical address. The mapping table storage area is first detected to see whether there is a target mapping table containing the logical address. If it is detected that the mapping table storage area does not have the target mapping table, the data storage area is detected to see whether there is a target mapping table containing the logical address. If the data storage area does not have the target mapping table containing the logical address either, it is determined that the random access memory does not have a target mapping table corresponding to the first data operation request.
[0073] It is understandable that, referring to Figure 4 The data processing method of the embodiment of the present application, before step S140, further includes but is not limited to the following steps:
[0074] Step S410, detecting whether the remaining capacity of the mapping table storage area of the random access memory can store the target mapping table;
[0075] Step S420: When it is detected that the remaining capacity of the mapping table storage area is capable of storing the target mapping table, the target mapping table is stored in the mapping table storage area.
[0076] In step S410 and step S420, the data length of the target mapping table is determined, and it is detected whether the remaining capacity of the target mapping table storage space is greater than or equal to the data length of the target mapping table. If the remaining capacity of the target mapping table storage space is greater than or equal to the data length of the target mapping table, the target mapping table is stored in the mapping table storage area.
[0077] It is understandable that, referring to Figure 5 After step S150, the following steps may also be included but are not limited to:
[0078] Step S510, obtaining a second data operation request, where the second data operation request includes data to be written;
[0079] Step S520, detecting whether the remaining capacity of the data storage area is less than the data length of the data to be written;
[0080] Step S530, when it is detected that the remaining capacity of the data storage area is less than the data length of the data to be written, delete part or all of the target mapping tables in the data storage area to make the remaining capacity of the data storage area greater than the data length of the data to be written.
[0081] The second operation request is a data write request. To avoid the remaining capacity of the data storage area being insufficient to store the data to be written, when it is detected that the remaining capacity of the data storage area is less than the data length of the data to be written, some or all of the target mapping tables in the data storage area are deleted to make the remaining capacity of the data storage area greater than the data length of the data to be written, so that the data to be written can be stored in the data storage area.
[0082] It should be noted that the second data operation request may be generated by the electronic device during the execution of a computer program. For example, the second data operation request may be a data write request. During the execution of a computer program, the electronic device needs to write data to a random access memory, thereby generating a data write request.
[0083] It is understandable that step S530 may include but is not limited to the following steps:
[0084] Determine the target mapping table deletion amount according to the data length of the data to be written and the remaining capacity of the data storage area;
[0085] Delete the target mapping table in the data storage area according to the target mapping table deletion amount.
[0086] For example, when the remaining capacity of the data storage area cannot store the data to be written and 3 mapping tables need to be deleted, the target mapping table deletion amount is 3, and 3 mapping tables need to be deleted from the data storage area to make the remaining capacity of the data storage area greater than the data length of the data to be written, so that the data to be written can be stored in the data storage area.
[0087] It can be understood that deleting the target mapping table in the data storage area according to the target mapping table deletion amount may specifically include the following steps:
[0088] According to the target mapping table deletion amount, the target mapping table in the data storage area is deleted through the least recently used algorithm or the least frequently used page replacement algorithm.
[0089] The least frequently used (LFU) page replacement algorithm requires that the page with the smallest reference count be replaced during page replacement, because frequently used pages should have a larger reference count. However, some pages are used many times at the beginning, but are no longer used later. Such pages will remain in memory for a long time, so the reference count register can be periodically shifted right by one position to form an exponentially decaying average number of uses.
[0090] Specifically, for example, if the mapping table deletion amount is 3, the LFU algorithm can be used to screen out the three mapping tables that are used the least in the data storage area, and then delete the three mapping tables that are used the least, so that the remaining capacity of the data storage area is greater than the data length of the data to be written, so that the data to be written can be stored in the data storage area.
[0091] Least Recently Used (LRU) is a commonly used page replacement algorithm that selects the page that has not been used the longest to be eliminated. This algorithm gives each page an access field to record the time t that has elapsed since the page was last accessed. When a page needs to be eliminated, the page with the largest t value among the existing pages, that is, the page that has been used the least recently, is selected for elimination.
[0092] Specifically, for example, the mapping table deletion amount is 4, and the LRU algorithm is used to determine the four mapping tables with the shortest usage time in the data storage area, and then delete the four mapping tables with the shortest usage time, so that the remaining capacity of the data storage area is greater than the data length of the data to be written, so that the data to be written can be stored in the data storage area.
[0093] Reference Figure 6 The second aspect of the present application provides a data processing device, including:
[0094] The receiving unit 610 is configured to obtain a first data operation request;
[0095] The flash memory detection unit 620 is used to detect whether there is a target mapping table corresponding to the first data operation request in the random access memory according to the first data operation request;
[0096] The flash memory determining unit 630 is configured to determine a target mapping table corresponding to the first data operation request from the flash memory when it is detected that the random access memory does not have the target mapping table;
[0097] The data storage area detection unit 640 is used to detect whether the remaining capacity of the data storage area of the random access memory can store the target mapping table according to the first data operation request;
[0098] The storage unit 650 is configured to store the target mapping table in the data storage area when it is detected that the remaining capacity of the data storage area is capable of storing the target mapping table.
[0099] After the receiving unit 610 receives the first data operation request, the flash memory detection unit 620 detects whether there is a target mapping table corresponding to the first data operation request in the random access memory according to the first data operation request; the flash memory determination unit 630 determines the target mapping table corresponding to the first data operation request from the flash memory when it is detected that the random access memory does not have the target mapping table; the data storage area detection unit 640 detects whether the remaining capacity of the data storage area of the random access memory can store the target mapping table according to the first data operation request; the storage unit 650 stores the target mapping table in the data storage area when it is detected that the remaining capacity of the data storage area can store the target mapping table. The data processing device of the embodiment of the present application stores the target mapping table in the data storage area of the random access memory so that the random access memory can store more mapping tables. When the target mapping table corresponding to the data operation is stored in the random access memory, there is no need to access the flash memory when performing the data operation. Therefore, the random access memory storing more mapping tables can reduce the number of times the flash memory is accessed, thereby improving the efficiency of the data operation.
[0100] It should be noted that the specific implementation of the data processing device is basically the same as the specific implementation example of the above-mentioned data processing method, and will not be repeated here.
[0101] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above data processing method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0102] See also Figure 7 , Figure 7 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0103] The processor 701 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0104] The memory 702 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 702 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 702, and the processor 701 calls and executes the data processing method of the embodiment of this application;
[0105] Input / output interface 703, used to implement information input and output;
[0106] Communication interface 704, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0107] A bus 705 that transmits information between the various components of the device (e.g., the processor 701, the memory 702, the input / output interface 703, and the communication interface 704);
[0108] The processor 701 , the memory 702 , the input / output interface 703 and the communication interface 704 are connected to each other in communication within the device via a bus 705 .
[0109] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above-mentioned data processing method when executed by a processor.
[0110] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0111] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present application. In addition, the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
Claims
1. A data processing method, characterized in that: include: Obtaining a first data operation request; detecting, according to the first data operation request, whether a target mapping table corresponding to the first data operation request exists in a random access memory; The storage space of the random access memory is divided into a mapping table storage area and a data storage area; In a case where it is detected that the random access memory does not have the target mapping table, determining the target mapping table corresponding to the first data operation request from a flash memory; detecting, according to the first data operation request, whether a remaining capacity of a data storage area of the random access memory can store the target mapping table; When it is detected that the remaining capacity of the data storage area is capable of storing the target mapping table, storing the target mapping table in the data storage area so that the random access memory can store more mapping tables; After storing the target mapping table in the data storage area, the method further includes: Obtaining a second data operation request, where the second data operation request includes data to be written; Detecting whether the remaining capacity of the data storage area is less than the data length of the data to be written; When it is detected that the remaining capacity of the data storage area is less than the data length of the data to be written, deleting part or all of the target mapping tables in the data storage area so that the remaining capacity of the data storage area is greater than the data length of the data to be written; The detecting, according to the first data operation request, whether the remaining capacity of the data storage area of the random access memory can store the target mapping table includes: When the first data operation request is a data write request, the first data operation request includes the data to be written, determining the data length of the data to be written, determining the remaining capacity of the data storage area, and determining the data length of the target mapping table; if the remaining capacity of the data storage area is greater than the data length of the data to be written + the data length of the target mapping table, it indicates that the remaining capacity of the data storage area is sufficient to store the target mapping table; The deleting part or all of the target mapping tables in the data storage area so that the remaining capacity of the data storage area is larger than the data length of the data to be written includes: Determining a target mapping table deletion amount according to the data length of the data to be written and the remaining capacity of the data storage area; Deleting the target mapping table in the data storage area according to the target mapping table deletion amount; The deleting the target mapping table in the data storage area according to the target mapping table deletion amount includes: The target mapping table in the data storage area is deleted according to the target mapping table deletion amount by using a least recently used algorithm or a least frequently used page replacement algorithm.
2. The data processing method according to claim 1, wherein: The detecting, according to the first data operation request, whether a target mapping table corresponding to the first data operation request exists in a random access memory includes: detecting, according to the first data operation request, whether the target mapping table exists in the mapping table storage area; In the case of detecting that the target mapping table does not exist in the mapping table storage area, detecting whether the target mapping table exists in the data storage area; In a case where it is detected that the target mapping table does not exist in the data storage area, it is determined that the target mapping table does not exist in the random access memory.
3. The data processing method according to claim 1, wherein: Before detecting, according to the first data operation request, whether the remaining capacity of the data storage area of the random access memory can store the target mapping table, the method further includes: detecting whether the remaining capacity of the mapping table storage area of the random access memory is sufficient to store the target mapping table; When it is detected that the remaining capacity of the mapping table storage area is capable of storing the target mapping table, the target mapping table is stored in the mapping table storage area.
4. The data processing method according to claim 1, wherein: The first data operation request includes a logical address and a first data operation; After determining the target mapping table corresponding to the first data operation request from the flash memory, the method further includes: Determine a physical address corresponding to the logical address from the target mapping table; The first data operation is performed according to the physical address.
5. A data processing device, characterized in that: include: A receiving unit, configured to obtain a first data operation request; a flash memory detection unit, configured to detect, based on the first data operation request, whether a target mapping table corresponding to the first data operation request exists in a random access memory; a storage space of the random access memory being divided into a mapping table storage area and a data storage area; a flash memory determining unit, configured to determine the target mapping table corresponding to the first data operation request from a flash memory when detecting that the target mapping table does not exist in the random access memory; a mapping table storage area detection unit, configured to detect whether the remaining capacity of the mapping table storage area of the random access memory is sufficient to store the target mapping table; a data storage area detection unit, configured to detect, based on the first data operation request, whether the remaining capacity of the data storage area of the random access memory can store the target mapping table if it is detected that the remaining capacity of the mapping table storage area is unable to store the target mapping table; a storage unit, configured to store the target mapping table in the data storage area when detecting that the remaining capacity of the data storage area is capable of storing the target mapping table, so that the random access memory can store more mapping tables; After storing the target mapping table in the data storage area, the method further includes: Obtaining a second data operation request, where the second data operation request includes data to be written; Detecting whether the remaining capacity of the data storage area is less than the data length of the data to be written; When it is detected that the remaining capacity of the data storage area is less than the data length of the data to be written, deleting part or all of the target mapping tables in the data storage area so that the remaining capacity of the data storage area is greater than the data length of the data to be written; The detecting, according to the first data operation request, whether the remaining capacity of the data storage area of the random access memory can store the target mapping table includes: When the first data operation request is a data write request, the first data operation request includes the data to be written, determining the data length of the data to be written, determining the remaining capacity of the data storage area, and determining the data length of the target mapping table; if the remaining capacity of the data storage area is greater than the data length of the data to be written + the data length of the target mapping table, it indicates that the remaining capacity of the data storage area is sufficient to store the target mapping table; The deleting part or all of the target mapping tables in the data storage area so that the remaining capacity of the data storage area is larger than the data length of the data to be written includes: Determining a target mapping table deletion amount according to the data length of the data to be written and the remaining capacity of the data storage area; Deleting the target mapping table in the data storage area according to the target mapping table deletion amount; The deleting the target mapping table in the data storage area according to the target mapping table deletion amount includes: The target mapping table in the data storage area is deleted according to the target mapping table deletion amount by using a least recently used algorithm or a least frequently used page replacement algorithm.
6. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the data processing method according to any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data processing method according to any one of claims 1 to 4 is implemented.
