Data processing method, intelligent terminal and storage medium
By optimizing the management of address mapping tables during logical page migration, the problem of duplicate data writing on mobile devices is solved, the device life and performance are improved, and the storage space utilization is optimized.
Patent Information
- Application Number
- CN202510472335.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-08-08
AI Technical Summary
Mobile devices have duplicate data writing problems during logical page migration, resulting in frequent write operations, shortening device life and occupying storage bandwidth, affecting performance and storage space utilization.
When the logical page is migrated, the target logical page is mapped to the target physical page and set it to invalid in the forward address mapping table, and at the same time, the reverse address mapping information is recorded into the reverse address mapping table, avoiding duplicate data writing and optimizing the use of storage bandwidth.
Eliminate duplicate data writing from mobile devices, improve device life, performance and storage space utilization, and ensure data processing accuracy and efficiency.
Smart Images

Figure CN120448294A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent terminal storage technology, and in particular to a data processing method, an intelligent terminal and a storage medium. Background Art
[0002] Smart terminals such as mobile devices usually use a forward address mapping table to record the forward address mapping information from logical pages to physical pages. When a mobile device needs to migrate a logical page, it is necessary to write the physical data corresponding to the logical page into a new physical page, and invalidate the original forward address mapping information corresponding to the logical page in the forward address mapping table. Then, the forward address mapping information from the logical page to the new physical page is recorded in the forward address mapping table. This method will result in repeated writing of the physical data corresponding to the logical page.
[0003] During the process of conceiving and implementing this application, the inventors discovered that there are at least the following problems: repeated data writing will lead to write amplification of the mobile device, and the more write operations the mobile device undergoes, the shorter its lifespan will be; and / or, the write operations of the mobile device will occupy storage bandwidth, resulting in a decrease in the performance of the mobile device.
[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention
[0005] In response to the above technical problems, the present application provides a data processing method, an intelligent terminal and a storage medium, which can eliminate duplicate data writing in mobile devices, avoid excessive occupation of the storage bandwidth of mobile devices, and thus improve the life, performance and / or storage space utilization of mobile devices.
[0006] This application provides a data processing method applied to a mobile device, comprising the steps of: S1: In response to a logical page migration instruction, mapping a first target logical page to a first target physical page corresponding to a second target logical page; S2: invalidate the forward address mapping information from the second target logical page to the first target physical page in the forward address mapping table, and record the forward address mapping information from the first target logical page to the first target physical page in the forward address mapping table.
[0007] Optionally, the forward address mapping table is stored in SRAM.
[0008] Optionally, the data processing method further comprises the steps of: S3: Record the reverse address mapping information from the first target physical page to the first target logical page into a reverse address mapping table preset in the flash memory.
[0009] Optionally, the garbage collection log in the flash memory includes the reverse address mapping table.
[0010] Optionally, the data processing method further comprises the steps of: S4: Reconstructing the forward address mapping table based on the reverse address mapping table.
[0011] Optionally, step S4 includes: Constructing a first forward address mapping table according to the logical page numbers in the out-of-band areas of the physical pages; Error correction is performed on the first forward address mapping table based on the reverse address mapping table to obtain a reconstructed forward address mapping table.
[0012] Optionally, the data processing method further comprises the steps of: S5: in response to the physical page migration instruction, updating the reverse address mapping table according to the reverse address mapping information of the physical page to be migrated; S6: Moving the data in the physical page to be migrated according to the reverse address mapping table; S7: Update the forward address mapping table according to the reverse address mapping table.
[0013] Optionally, step S5 includes: In response to the physical page migration instruction, determining a second target physical page in the physical page to be migrated; optionally, the second target physical page is a physical page whose reverse address mapping information is not in the reverse address mapping table; According to the logical page number in the out-of-band area of the second target physical page, the reverse address mapping information corresponding to the second target physical page is recorded in the reverse address mapping table.
[0014] Optionally, step S6 includes: Moving the data in the physical page to be migrated to a third target physical page; Obtain reverse address mapping information from the physical page to be migrated to the third target logical page in the reverse address mapping table; recording a page number of the third target logical page in an out-of-band area of the third target physical page according to the reverse address mapping information; The reverse address mapping information from the physical page to be migrated to the third target logical page in the reverse address mapping table is deleted.
[0015] The present application also provides an intelligent terminal, which includes: a memory and a processor, wherein a data processing program is stored in the memory, and when the data processing program is executed by the processor, the steps of any of the above-mentioned data processing methods are implemented.
[0016] The present application also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned data processing methods are implemented.
[0017] As described above, the data processing method of the present application, applied to a mobile device, includes the following steps: in response to a logical page migration instruction, mapping a first target logical page to a first target physical page corresponding to a second target logical page; invalidating the forward address mapping information from the second target logical page to the first target physical page in a forward address mapping table, and recording the forward address mapping information from the first target logical page to the first target physical page in the forward address mapping table. Through the above technical solution, duplicate data writing in a mobile device can be eliminated, preventing the storage bandwidth of the mobile device from being excessively occupied, thereby improving the lifespan, performance, and / or storage space utilization of the mobile device. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for describing the embodiments. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without inventive work.
[0019] Figure 1 A schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present application.
[0020] Figure 2 A communication network system architecture diagram provided for an embodiment of the present application.
[0021] Figure 3 It is a flowchart of a data processing method according to the first embodiment.
[0022] Figure 4 FIG. 1 is a diagram showing an example of a forward address mapping table in the data processing method according to the first embodiment.
[0023] Figure 5 is a flowchart of a data processing method according to the second embodiment.
[0024] Figure 6 is a flowchart of a data processing method according to the third embodiment.
[0025] Figure 7 1 is an example diagram of a forward address mapping table and a reverse address mapping table in a data processing method according to the third embodiment.
[0026] Figure 8 is a flowchart of a data processing method according to the fourth embodiment.
[0027] Figure 9 FIG. 1 is an example diagram of a forward address mapping table and a physical page in a data processing method according to the fourth embodiment.
[0028] The purpose of this application, its features, and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and the accompanying text are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of this application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0029] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0030] It should be noted that, in this document, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. Optionally, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined based on their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0031] It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are used solely to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the term "if," as used herein, may be interpreted as "upon," "when," or "in response to a determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprising" and "including" indicate the presence of the recited features, steps, operations, elements, components, items, types, and / or groups, but do not preclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or," "and / or," "including at least one of the following," etc., as used herein, may be interpreted as inclusive, meaning any one or any combination. For example, “comprising at least one of the following: A, B, C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”; and for another example, “A, B or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some manner.
[0032] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and they can be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0033] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.
[0034] It should be noted that in this article, step codes such as S2 and S3 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial restriction on the order. When implementing the step, those skilled in the art may execute S3 first and then S2, etc., but these should all be within the scope of protection of this application.
[0035] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0036] In the subsequent description, the use of suffixes such as "module", "component" or "unit" to represent elements is only for the purpose of facilitating the description of the present application and has no specific meaning. Therefore, "module", "component" or "unit" can be used interchangeably.
[0037] Smart terminals can be implemented in various forms. For example, the smart terminals described in this application may include mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, etc., as well as fixed terminals such as digital TVs and desktop computers.
[0038] The subsequent description will be made by taking a mobile terminal as an example. It will be understood by those skilled in the art that, in addition to components specifically used for mobile purposes, the configuration according to the embodiments of the present application can also be applied to fixed-type terminals.
[0039] See also Figure 1 , which is a schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present application. The mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (Audio / Video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will understand that Figure 1 The structure of the mobile terminal shown in the figure does not constitute a limitation to the mobile terminal. The mobile terminal may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0040] The following combination Figure 1 A detailed introduction to each component of the mobile terminal is given below: The RF unit 101 can be used to send and receive information or receive signals during calls. Specifically, it receives downlink information from the base station and transmits it to the processor 110 for processing. It also transmits uplink data to the base station. Typically, the RF unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, and more. Furthermore, the RF unit 101 can communicate with the network and other devices via wireless communication. The above-mentioned wireless communications may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing- Long Term Evolution), TDD-LTE (Time Division Duplexing- Long Term Evolution), 5G and 6G, etc.
[0041] WiFi is a short-range wireless transmission technology. Mobile terminals can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 102. It provides users with wireless broadband Internet access. Figure 1 The WiFi module 102 is shown, but it is understandable that it is not an essential component of the mobile terminal and can be omitted as needed without changing the essence of the invention.
[0042] The audio output unit 103 can convert audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Furthermore, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, or the like.
[0043] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data from still images or videos captured by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the GPU 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the RF unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) in various operating modes, such as phone call mode, recording mode, and voice recognition mode, and process such sound into audio data. In phone call mode, the processed audio (voice) data may be converted into a format that can be transmitted to a mobile communication base station via the RF unit 101. The microphone 1042 may implement various noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.
[0044] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, or other sensors. Optionally, the light sensor includes an ambient light sensor and a proximity sensor. Optionally, the ambient light sensor can adjust the brightness of the display panel 1061 based on the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is brought to your ear. An accelerometer, a type of motion sensor, can detect acceleration in all directions (typically three axes) and, when stationary, can detect the magnitude and direction of gravity. This can be used for applications that recognize the phone's posture (e.g., switching between landscape and portrait modes, related games, magnetometer posture calibration), vibration recognition-related functions (e.g., pedometer, tapping), and other functions. Other sensors that may be configured on a mobile phone, such as a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., are not described here.
[0045] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0046] The user input unit 107 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the mobile terminal. Optionally, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can detect user touch operations on or near it (for example, operations performed on or near the touch panel 1071 using a finger, stylus, or any other suitable object or accessory) and drive corresponding connected devices according to pre-set programs. The touch panel 1071 may include a touch detection device and a touch controller. Optionally, the touch detection device detects the user's touch position and detects signals generated by the touch operation, transmitting the signals to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 110. The touch controller can also receive and execute commands from the processor 110. Furthermore, the touch panel 1071 can be implemented using various types of sensors, including resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may further include other input devices 1072. Optionally, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power keys, etc.), a trackball, a mouse, a joystick, etc., and the specifics are not limited here.
[0047] Optionally, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. The processor 110 then provides a corresponding visual output on the display panel 1061 according to the type of touch event. Figure 1 In the embodiment, the touch panel 1071 and the display panel 1061 are two independent components to realize the input and output functions of the mobile terminal. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the mobile terminal, which is not limited here.
[0048] The interface unit 108 serves as an interface through which at least one external device can be connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
[0049] Memory 109 can be used to store software programs and various data. Memory 109 may primarily include a program storage area and a data storage area. Optionally, the program storage area may store an operating system and at least one application required for a function (such as sound playback or image playback); the data storage area may store data generated based on the use of the phone (such as audio data and a phone book). Memory 109 may also include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0050] Processor 110 is the control center of the mobile terminal, connecting all components of the mobile terminal using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 109 and accessing data stored in memory 109, it executes various functions of the mobile terminal and processes data, thereby providing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, processor 110 may integrate an application processor and a modem processor. Optionally, the application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 110.
[0051] The mobile terminal 100 may further include a power supply 111 (such as a battery) for supplying power to various components. Preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption.
[0052] although Figure 1 Not shown, the mobile terminal 100 may further include a Bluetooth module, etc., which will not be described in detail here.
[0053] To facilitate understanding of the embodiments of the present application, the communication network system on which the mobile terminal of the present application is based is described below.
[0054] See also Figure 2 , Figure 2 A communication network system architecture diagram is provided for an embodiment of the present application. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203 and an operator's IP service 204, which are connected in sequence.
[0055] Optionally, UE201 may be the above-mentioned terminal 100, which will not be described in detail here.
[0056] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 . Optionally, eNodeB 2021 may be connected to other eNodeBs 2022 via a backhaul (eg, an X2 interface). eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 may provide UE 201 with access to EPC 203 .
[0057] The EPC 203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving GateWay) 2034, a PGW (PDN GateWay) 2035, and a PCRF (Policy and Charging Rules Function) 2036. Optionally, the MME 2031 is a control node that processes signaling between the UE 201 and the EPC 203, providing bearer and connection management. The HSS 2032 provides registers for managing functions such as the Home Location Register (not shown) and stores user-specific information such as service features and data rates. All user data can be sent through SGW2034. PGW2035 can provide IP address allocation and other functions for UE 201. PCRF2036 is the policy and charging control policy decision point for service data flows and IP bearer resources. It selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).
[0058] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem), or other IP services.
[0059] Although the above introduction takes the LTE system as an example, those skilled in the art should know that this application is not only applicable to the LTE system, but can also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA and future new network systems (such as 5G), etc., which are not limited here.
[0060] Based on the above-mentioned mobile terminal hardware structure and communication network system, various embodiments of the present application are proposed.
[0061] First embodiment See Figure 3 In one aspect, an embodiment of the present application provides a data processing method, which can be applied to a smart terminal (such as a mobile phone), including steps S1 and S2: Step S1: in response to a logical page migration instruction, mapping a first target logical page to a first target physical page corresponding to a second target logical page; Optionally, a logical page is a memory unit viewed from the application's perspective and is the basic unit of virtual memory management. A physical page is a storage area in actual physical memory. Logical and physical pages are associated through forward address mapping information. The smart terminal maintains a forward address mapping table to record forward address mapping information from logical pages to physical pages. Forward address mapping information refers to the mapping of logical page numbers to physical page numbers.
[0062] A single logical page migration instruction is used to migrate a single logical page. Logical page migration refers to migrating the contents of the second target logical page to the first target logical page. Therefore, the physical data corresponding to the first target logical page and the second target logical page are the same. Optionally, the physical data refers to the data stored in the physical page mapped by the logical page.
[0063] Step S2: invalidate the forward address mapping information from the second target logical page to the first target physical page in the forward address mapping table, and record the forward address mapping information from the first target logical page to the first target physical page in the forward address mapping table.
[0064] Optionally, the forward address mapping table may be stored in an SRAM (Static Random-Access Memory).
[0065] When the smart terminal is defragmenting, or in other scenarios where logical page migration is required, the smart terminal will issue a logical page migration instruction. The technical solution of the present application responds to the logical page migration instruction, maps the first target logical page to the first target physical page corresponding to the second target logical page, invalidates the forward address mapping information from the second target logical page to the first target physical page in the forward address mapping table, and records the forward address mapping information from the first target logical page to the first target physical page in the forward address mapping table.
[0066] Through the technical solution of the present application, logical pages are remapped to physical pages when migrating logical pages, without the need to repeatedly write the physical data corresponding to the second target logical page. This can eliminate repeated data writing in the smart terminal and avoid excessive occupation of the storage bandwidth of the smart terminal, thereby improving the life, performance and / or storage space utilization of the smart terminal.
[0067] Optionally, the technical solution of the present application adjusts the defragmentation trigger time of the smart terminal from the background idle time to any time. The reason for fragmentation is mainly due to file updates and file deletions in the memory. When the technical solution of the present application recognizes that the file update is completed, it immediately defragments the file. When the file deletion is recognized, it determines whether the degree of fragmentation of the memory unit where the file is located exceeds the preset threshold. If it exceeds the preset threshold, defragmentation is performed immediately and a logical page migration instruction is generated.
[0068] See also Figure 4 , Figure 4 This is an example diagram of the forward address mapping table in the data processing method provided in an embodiment of the present application. Optionally, L1 and L2 are logical page numbers, P1 and P2 are physical page numbers, and before the logical page migration, the forward address mapping table contains forward address mapping information of the logical page L1 mapped to the physical page P1.
[0069] In some solutions, the logical page migration method is as follows: when the intelligent terminal migrates the contents of logical page L1 to logical page L2, it first writes the data in physical page P1 to physical page P2, then invalidates the original forward address mapping information in the forward address mapping table that maps logical page L1 to physical page P1, and then records the forward address mapping information from logical page L2 to physical page P2 in the forward address mapping table. Because the physical data corresponding to logical page L1 and logical page L2 is the same, this method has the problem of duplicate data writing.
[0070] The logical page migration method of the technical solution of the present application is as follows: when the smart terminal migrates the contents of logical page L1 to logical page L2, it first maps logical page L2 to physical page P1, invalidates the original forward address mapping information of logical page L1 to physical page P1 in the forward address mapping table, and then records the forward address mapping information of logical page L2 to physical page P1 in the forward address mapping table. This avoids duplicate writing of data in physical page P1, prevents excessive use of the storage bandwidth of the smart terminal, and improves the lifespan, performance, and / or storage space utilization of the smart terminal.
[0071] Second embodiment See Figure 5 Based on the above first embodiment, a second embodiment of the present application is proposed, in which the data processing method further includes step S3: Step S3: Record the reverse address mapping information from the first target physical page to the first target logical page into a reverse address mapping table preset in the flash memory.
[0072] Optionally, the garbage collection log in the flash memory may include a reverse address mapping table. The reverse address mapping table is primarily used to record reverse address mapping information from physical pages to logical pages during logical page migration. The reverse address mapping information refers to the mapping of physical page numbers to logical page numbers. Optionally, the garbage collection log is typically stored in a pre-defined area in the flash memory that has power-off protection.
[0073] Smart terminal memory typically includes SRAM and flash memory (FLASH). The forward address mapping table is stored in SRAM. Since SRAM is not a power-off protection area, it is necessary to write the forward address mapping table stored in SRAM back to flash memory before the smart terminal is powered off. The next time the smart terminal is powered on, the forward address mapping table is loaded from flash memory into SRAM.
[0074] If a smart terminal experiences an abnormal power outage, the forward address mapping table in the SRAM cannot be written back to the flash memory. Some solutions employ a power outage recovery method where the smart terminal reconstructs a forward address mapping table based on the reverse address mapping information stored in the out-of-band area (00B area) of the flash memory. The out-of-band area refers to the portion of each physical page of the flash memory outside the main data area. It is typically used to store metadata such as error correction code (ECC) and bad block flags, as well as the logical page number corresponding to each physical page.
[0075] The logical page number stored in the out-of-band area of the flash memory of some smart terminals cannot be updated. Therefore, after the above steps S1 and S2 are completed, the logical page number stored in the out-of-band area of the first target physical page is still the page number of the second target logical page. If the smart terminal experiences an abnormal power outage after the logical page migration, the forward address mapping table in the SRAM will not be written back to the flash memory in time. At this time, if the forward address mapping table is reconstructed according to the existing technology, a forward address mapping table will be reconstructed based on the reverse address mapping information stored in the out-of-band area of the flash memory. However, in the reconstructed forward address mapping table, the forward address mapping information from the second target logical page to the first target physical page is wrong, and the correct forward address mapping information should be the forward address mapping information from the first target logical page to the first target physical page.
[0076] The technical solution of the present application records the reverse address mapping information from the first target physical page to the first target logical page into a reverse address mapping table preset in the flash memory during the logical page migration. When an abnormal power outage occurs in the smart terminal, or in other scenarios where the forward address mapping table needs to be rebuilt, the forward address mapping table can be rebuilt based on the reverse address mapping table. Since the reverse address mapping information from the first target physical page to the first target logical page is correct information, the problem of data errors in the rebuilt forward address mapping table due to abnormal power outage of the smart terminal is avoided, thereby ensuring the data accuracy of the rebuilt forward address mapping table.
[0077] In some scenarios, when a smart terminal needs to migrate physical pages, if the physical pages to be migrated include the first target physical page, a reverse address mapping table is needed to ensure data consistency during the migration process and data accuracy after the migration.
[0078] Therefore, the technical solution of the present application can ensure data accuracy in subsequent data processing by recording the reverse address mapping information from the first target physical page to the first target logical page in a reverse address mapping table preset in the flash memory.
[0079] Third embodiment See Figure 6 Based on the above second embodiment, a third embodiment of the present application is proposed, wherein the data processing method further comprises step S4 of the intelligent terminal: Step S4: reconstructing the forward address mapping table based on the reverse address mapping table.
[0080] Optionally, step S4 may include: Constructing a first forward address mapping table according to the logical page numbers in the out-of-band areas of the physical pages; Error correction is performed on the first forward address mapping table based on the reverse address mapping table to obtain a reconstructed forward address mapping table.
[0081] See also Figure 7 , Figure 7This is an example diagram of the forward address mapping table and reverse address mapping table in the data processing method provided in an embodiment of the present application. Optionally, L1 and L2 are logical page numbers, and P1 and P2 are physical page numbers. Before the logical page migration, the forward address mapping table contains forward address mapping information that maps logical page L1 to physical page P1. After the smart terminal migrates the content of logical page L1 to logical page L2 according to the above steps S1 and S2, the logical page number stored in the out-of-band area of physical page P1 is still L1. If an abnormal power outage occurs in the smart terminal after the logical page migration, if the forward address mapping table is reconstructed according to the prior art, the forward address mapping information from logical page L1 to physical page P1 in the reconstructed forward address mapping table is wrong, and the correct forward address mapping information should be the forward address mapping information from logical page L2 to physical page P1. Therefore, the prior art method of constructing the forward address mapping table cannot guarantee data accuracy.
[0082] The technical solution of the present application records the reverse address mapping information from physical page P1 to logical page L2 into a reverse address mapping table preset in the flash memory during logical page migration. When the forward address mapping table needs to be rebuilt, the forward address mapping table can be rebuilt based on the reverse address mapping table. Because the reverse address mapping information from physical page P1 to logical page L2 is correct information, data errors in the rebuilt forward address mapping table caused by abnormal power failure of the smart terminal are avoided, ensuring the data correctness of the rebuilt forward address mapping table.
[0083] Fourth embodiment See Figure 8 Based on the above second embodiment and / or third embodiment, a fourth embodiment of the present application is proposed, in which the data processing method further includes steps S5 to S7: Step S5: in response to the physical page migration instruction, updating the reverse address mapping table according to the reverse address mapping information of the physical page to be migrated; Step S6: Moving the data in the physical page to be migrated according to the reverse address mapping table; Step S7: Update the forward address mapping table according to the reverse address mapping table.
[0084] In this way, when the smart terminal performs garbage collection, or in other scenarios where physical page migration is required, the smart terminal will issue a physical page migration instruction. The technical solution of the present application responds to the physical page migration instruction and updates the reverse address mapping table according to the reverse address mapping information of the physical page to be migrated, thereby ensuring that before the physical page migration, the latest reverse address mapping information of the physical page to be migrated is recorded in the reverse address mapping table. Afterwards, according to the updated reverse address mapping table, the data in the physical page to be migrated is moved, and the forward address mapping table is updated according to the updated reverse address mapping table. In this way, the accuracy of the physical page migration process and the data accuracy of the forward address mapping table after the physical page migration are ensured.
[0085] Optionally, step S5 may include: In response to the physical page migration instruction, a second target physical page among the physical pages to be migrated is determined.
[0086] According to the logical page number in the out-of-band area of the second target physical page, the reverse address mapping information corresponding to the second target physical page is recorded in the reverse address mapping table.
[0087] Optionally, the second target physical page is a physical page whose reverse address mapping information is not in the reverse address mapping table. In this way, the reverse address mapping table can be updated to ensure the accuracy of the migrated data.
[0088] Optionally, step S6 may include: Moving the data in the physical page to be migrated to the third target physical page; Obtain reverse address mapping information from the physical page to be migrated to the third target logical page in the reverse address mapping table; recording a page number of the third target logical page in an out-of-band area of the third target physical page according to the reverse address mapping information; The reverse address mapping information from the physical page to be migrated to the third target logical page in the reverse address mapping table is deleted.
[0089] Optionally, a single physical migration instruction does not necessarily migrate only a single physical page, and may involve multiple physical pages, which may depend on the memory management policy of the intelligent terminal and the current memory usage.
[0090] The physical page migration method in some schemes is: in response to a physical page migration instruction, the data in the physical page to be migrated is moved to a third target physical page, the logical page number in the out-of-band area of the physical page to be migrated is written into the out-of-band area of the third target physical page, and the forward address mapping table is updated according to the reverse address mapping information corresponding to the third target physical page.
[0091] Since the logical page number stored in the out-of-band area of the flash memory of some smart terminals cannot be updated, after the above step S2 is completed, the logical page number stored in the out-of-band area of the first target physical page is still the page number of the second target logical page. At this time, if the first target physical page is migrated to the third target physical page according to the existing technology, the logical page number in the out-of-band area of the first target physical page will be written into the out-of-band area of the third target physical page, and the forward address mapping table will be updated according to the reverse address mapping information corresponding to the third target physical page. At this time, the updated forward address mapping table includes the forward address mapping information from the second target logical page to the third target physical page, but the forward address mapping information is wrong, and the correct forward address mapping information should be the forward address mapping information from the first target logical page to the third target physical page.
[0092] If the physical pages to be migrated include the first target physical page after the above steps S2 and S3 are completed, the logical page number stored in the out-of-band area of the first target physical page is still the page number of the second target logical page, and the reverse address mapping information from the first target physical page to the first target logical page is recorded in the reverse address mapping table. Since the logical page number stored in the out-of-band area of the first target physical page is error information, the reverse address mapping information recorded in the reverse address mapping table is correct information, and therefore there is no need to update the reverse address mapping table according to the logical page number stored in the out-of-band area of the first target physical page. At this point, it is only necessary to determine the second target physical page in the physical pages to be migrated, and based on the logical page number in the out-of-band area of the second target physical page, record the reverse address mapping information corresponding to the second target physical page into the reverse address mapping table, so as to ensure that the correct reverse address mapping information of the physical page to be migrated is recorded in the reverse address mapping table before the physical page is migrated.
[0093] See also Figure 9 , Figure 9The forward address mapping table and physical page example diagram in the data processing method provided in the embodiment of the present application, optionally, L1 and L2 are logical page numbers, and P1 and P2 are physical page numbers. Before the logical page is migrated, the forward address mapping table includes forward address mapping information of logical page L1 to physical page P1. After the smart terminal migrates the content of logical page L1 to logical page L2 according to the above steps S1 and S2, the logical page number stored in the out-of-band area of physical page P1 is still L1, the forward address mapping table includes forward address mapping information of logical page L2 to physical page P1, and the reverse address mapping table includes reverse address mapping information of physical page P1 to logical page L2. When physical page P1 needs to be migrated to physical page P100, since the reverse address mapping table includes the reverse address mapping information of physical page P1, it is not necessary to update the reverse address mapping table according to the out-of-band area of physical page P1. The data in physical page P1 is moved to physical page P100. The reverse address mapping information from physical page P1 to logical page L2 is obtained from the reverse address mapping table. The corresponding logical page number L2 is recorded in the out-of-band area of physical page P100. Finally, the forward address mapping information from logical page L2 to physical page P1 in the forward address mapping table is updated to the forward address mapping information from logical page L2 to physical page P100. The reverse address mapping information from physical page P1 to logical page L2 in the reverse address mapping table is deleted. This ensures the data correctness of the forward address mapping table after the physical page migration.
[0094] The present application also provides an intelligent terminal, which includes a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the steps of the data processing method in any of the above embodiments are implemented.
[0095] The present application also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method in any of the above embodiments are implemented.
[0096] It is understood that the above scenarios are merely examples and do not limit the application scenarios of the technical solutions provided in the embodiments of this application. The technical solutions of this application can also be applied to other scenarios. For example, those skilled in the art will appreciate that with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application will also be applicable to similar technical problems.
[0097] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0098] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0099] The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0100] In this application, the same or similar terminology, technical solutions and / or application scenario descriptions are generally only described in detail the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of this application, for the same or similar terminology, technical solutions and / or application scenario descriptions that are not described in detail later, you can refer to the previous relevant detailed descriptions.
[0101] In this application, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0102] The various technical features of the technical solution of this application can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0103] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as mentioned above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present application.
[0104] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. Available media can include magnetic media (e.g., floppy disks, storage disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state disks (SSDs)).
[0105] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A data processing method, characterized in that: Including steps: S1: In response to a logical page migration instruction, mapping a first target logical page to a first target physical page corresponding to a second target logical page; S2: invalidate the forward address mapping information from the second target logical page to the first target physical page in the forward address mapping table, and record the forward address mapping information from the first target logical page to the first target physical page in the forward address mapping table.
2. The data processing method according to claim 1, wherein: The forward address mapping table is stored in SRAM, and the method further comprises the steps of: S3: Record the reverse address mapping information from the first target physical page to the first target logical page into a reverse address mapping table preset in the flash memory.
3. The data processing method according to claim 2, wherein: The garbage collection log in the flash memory includes the reverse address mapping table.
4. The data processing method according to claim 2, wherein: The method further comprises the steps of: S4: Reconstructing the forward address mapping table based on the reverse address mapping table.
5. The data processing method according to claim 4, wherein: The step S4 comprises: Constructing a first forward address mapping table according to the logical page numbers in the out-of-band areas of the physical pages; Error correction is performed on the first forward address mapping table based on the reverse address mapping table to obtain a reconstructed forward address mapping table.
6. The data processing method according to any one of claims 2 to 5, characterized in that: The method further comprises the steps of: S5: in response to the physical page migration instruction, updating the reverse address mapping table according to the reverse address mapping information of the physical page to be migrated; S6: Moving the data in the physical page to be migrated according to the reverse address mapping table; S7: Update the forward address mapping table according to the reverse address mapping table.
7. The data processing method according to claim 6, wherein: The step S5 comprises: In response to a physical page migration instruction, determining a second target physical page among the physical pages to be migrated, the second target physical page being a physical page whose reverse address mapping information is not in the reverse address mapping table; According to the logical page number in the out-of-band area of the second target physical page, the reverse address mapping information corresponding to the second target physical page is recorded in the reverse address mapping table.
8. The data processing method according to claim 6, wherein: The step S6 comprises: Moving the data in the physical page to be migrated to a third target physical page; Obtain reverse address mapping information from the physical page to be migrated to the third target logical page in the reverse address mapping table; Recording a page number of the third target logical page in an out-of-band area of the third target physical page according to the reverse address mapping information; The reverse address mapping information from the physical page to be migrated to the third target logical page in the reverse address mapping table is deleted.
9. An intelligent terminal, characterized in that: The intelligent terminal includes: a memory and a processor. The memory stores a data processing program. When the data processing program is executed by the processor, the steps of the data processing method according to any one of claims 1 to 8 are implemented.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the data processing method according to any one of claims 1 to 8.