Data processing method and device, equipment, medium and program product

By adding validation data before writing data and performing validation immediately after writing, the integrity issues caused by data writing errors are resolved, enabling timely detection and repair, and improving the user experience.

CN121880085APending Publication Date: 2026-04-17BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING XIAOMI MOBILE SOFTWARE CO LTD
Filing Date
2024-10-16
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, when errors occur before or during data writing, it is difficult to detect and repair them within a reasonable timeframe, resulting in compromised data integrity and a poor user experience.

Method used

Add validation data before writing data, and immediately generate a read request after writing to validate the stored data, and use the validation data to determine the data integrity.

Benefits of technology

Timely detection of data writing issues facilitates targeted repairs, ensures data integrity, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880085A_ABST
    Figure CN121880085A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device, equipment, a medium and a program product, and the data processing method comprises the steps: responding to a data writing request, adding verification data to original data, and generating storage data; writing the storage data into a storage end; in response to a received write-in completion prompt sent by the storage end, generating a first data reading request to read the stored data; and based on the verification data, verifying the storage data. By adding the verification data to the original data and immediately reading the storage data after writing of the storage data is completed so as to verify the storage data according to the verification data, problems existing in data writing can be found in time, targeted repair is facilitated, data integrity is guaranteed, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data storage, specifically to a data processing method, apparatus, device, medium, and program product. Background Technology

[0002] In recent years, with the rapid development of storage technology at both the software and hardware levels, electronic devices with end-to-end data writing and reading capabilities have been widely used in many fields. The host can write data to the storage device according to write requests, and can also read data from the storage device according to read requests.

[0003] However, when using related technologies for data processing, if errors occur before or during data writing, it is difficult to detect and repair the data corruption within a reasonable timeframe, thus failing to guarantee data integrity and resulting in a poor user experience. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides a data processing method, apparatus, device, medium, and program product.

[0005] According to a first aspect of the present disclosure, a data processing method is provided, the data processing method comprising:

[0006] In response to a data write request, validation data is added to the original data to generate stored data;

[0007] Write the stored data to the storage terminal;

[0008] In response to receiving a write completion notification from the storage device, a first data read request is generated to read the stored data;

[0009] The stored data is verified based on the verification data.

[0010] In some embodiments of this disclosure, generating a first data read request to read the stored data includes:

[0011] Based on the data write request, the first data read request is generated, and the read address information of the first data read request is consistent with the storage address information of the data write request;

[0012] The first data read request is sent to the storage terminal to read the stored data.

[0013] In some embodiments of this disclosure, the step of generating a first data read request to read the stored data in response to receiving a write completion notification from the storage device includes:

[0014] In response to receiving a write completion notification from the storage device and meeting preset read conditions, a first data read request is generated to read the stored data.

[0015] In some embodiments of this disclosure, the preset reading conditions include:

[0016] The interval between the previous generation of the first data read request and the current generation of the first data read request reaches a preset duration; or,

[0017] The number of write requests between the previous generation of the first data read request and the previous generation of the first data read request reaches a first preset number.

[0018] In some embodiments of this disclosure, when the preset reading condition includes an interval of a preset duration between the initial generation of the first data reading request and the current generation of the first data reading request, the preset reading condition further includes:

[0019] When the interval between the previous generation of the second data read request and the previous generation of the second data read request reaches the preset time, the second data read request is generated in response to the user's data read request operation;

[0020] If the preset read condition includes the condition that the number of write requests between the previous generation of the first data read request and the current generation of the first data read request reaches a first preset number, the preset read condition further includes:

[0021] The number of write requests between the previous generation of the second data read request and the previous generation of the second data read request reaches the first preset number.

[0022] In some embodiments of this disclosure, the verification data includes data protection information, and the verification of the stored data based on the verification data includes:

[0023] Based on the data protection information, the stored data is verified using data integrity extension.

[0024] In some embodiments of this disclosure, the data processing method further includes:

[0025] Upon successful verification, a write success message is generated.

[0026] In some embodiments of this disclosure, the data processing method further includes:

[0027] In response to the verification failure, a memory verification is performed on the write request to determine the type of write failure.

[0028] In some embodiments of this disclosure, performing memory verification on the write request to determine the write failure type includes:

[0029] Perform cyclic redundancy check on the original data corresponding to the write request;

[0030] In response to the successful cyclic redundancy check, the write failure type is determined to be a transmission link failure;

[0031] In response to the failure of the cyclic redundancy check, the write failure type is determined to be original data corruption.

[0032] In some embodiments of this disclosure, the data processing method further includes:

[0033] In response to the number of write requests whose write failure type is "transmission link failure" exceeding a second preset number, the data transmission link is reset;

[0034] If the number of write requests with the write failure type of "original data corruption" exceeds a third preset number, the application corresponding to the write request is restarted or isolated.

[0035] In some embodiments of this disclosure, the data processing method further includes:

[0036] In response to the verification failure, the system log generated based on the verification process is stored.

[0037] According to a second aspect of the present disclosure, a data processing apparatus is provided, the data processing apparatus comprising:

[0038] An add module is used to add verification data to the original data in response to a data write request, thereby generating stored data;

[0039] A writing module, used to write the stored data to the storage terminal;

[0040] A read module, configured to generate a first data read request to read the stored data in response to receiving a write completion notification from the storage terminal;

[0041] A verification module is used to verify the stored data based on the verification data.

[0042] According to a third aspect of the present disclosure, an electronic device is provided, the electronic device comprising:

[0043] processor;

[0044] Memory used to store processor-executable instructions;

[0045] The processor is configured to perform the data processing method as described in the first aspect.

[0046] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the data processing method as described in the first aspect.

[0047] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the data processing method as described in the first aspect.

[0048] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: by adding verification data to the original data and reading the stored data immediately after the stored data is written to verify the stored data according to the verification data, problems in data writing can be discovered in a timely manner, which facilitates targeted repairs, ensures data integrity, and improves user experience.

[0049] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0051] Figure 1 This is a schematic diagram of a data transmission system.

[0052] Figure 2 This is a flowchart illustrating a data processing method according to an exemplary embodiment.

[0053] Figure 3 This is a schematic diagram of the page space of a flash memory medium at the storage end, according to an exemplary embodiment.

[0054] Figure 4 This is a flowchart illustrating the generation of a first data read request to read stored data according to an exemplary embodiment.

[0055] Figure 5 This is a flowchart illustrating, according to an exemplary embodiment, a process for performing memory verification on a write request to determine the type of write failure.

[0056] Figure 6 This is a flowchart illustrating a data processing method according to another exemplary embodiment.

[0057] Figure 7 This is a flowchart illustrating a data processing method according to another exemplary embodiment.

[0058] Figure 8This is a block diagram of a data processing apparatus according to an exemplary embodiment.

[0059] Figure 9 This is a block diagram of an electronic device according to an exemplary embodiment.

[0060] In the picture:

[0061] 10-Add module; 20-Write module; 30-Read module; 40-Verify module; 101-Processing component; 102-Memory; 103-Power component; 104-Multimedia component; 105-Audio component; 106-Input / output interface; 107-Sensor component; 108-Communication component; 109-Processor. Detailed Implementation

[0062] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.

[0063] In recent years, with the rapid development of storage technology at both the software and hardware levels, electronic devices with host-to-storage data writing and reading capabilities have been widely used in many fields. The host can write data to the storage device according to a write request, and can also read data from the storage device according to a read request.

[0064] In related technologies, refer to Figure 1 As shown, the data transmission path includes both software and hardware layers. The software layer includes the host's read / write control layer (IO layer) and the storage device's firmware layer (FW layer). The hardware layer includes the host controller interface (HCI) on the host side and the flash memory (NAND) media on the storage side. When writing data to the storage device, software-related errors (such as software logic errors) and hardware-related issues (such as transmission link damage) can both lead to data errors, resulting in the corruption of the data written to the storage device.

[0065] However, when using related technologies for data processing, if errors occur before or during the writing process, the data corruption can only be detected when the data is read again. This makes it difficult to detect and repair data corruption issues in a timely manner, fails to guarantee data integrity, and results in a poor user experience.

[0066] Based on this, an exemplary embodiment of this disclosure provides a data processing method. When a data write request is detected, verification data is added to the original data to generate stored data, which is then written to the storage terminal. When a write completion notification is received from the storage terminal, a first data read request is generated to read the stored data. The stored data can be verified based on the verification data, thus verifying the completeness of the stored data written to the storage terminal. By adding verification data to the original data and immediately reading the stored data after it is written to verify it, problems in the data writing process can be detected promptly, facilitating targeted repairs, ensuring data integrity, and improving the user experience.

[0067] In one exemplary embodiment, a data processing method is provided, applied to a host device, which may be located in an electronic device such as a mobile phone. (See reference) Figure 2 As shown, the data processing methods include:

[0068] S100: In response to a data write request, add verification data to the original data and generate stored data.

[0069] In step S100, when the host detects a data write request, it adds corresponding verification data to the original data, generating stored data consisting of the original data and the verification data. The data write request can be generated, for example, based on a user's data write operation to the host, and the addition of verification data can be performed through the block sublayer in the host's I / O layer.

[0070] For example, the original data consists of multiple 4K data units. Multiple check units can be generated for each data unit, and the check data is composed of these check units. The check data and the original data can be accessed independently via Direct Memory Access (DMA). The check data may include, for example, data generated based on the Data Integrity Extensions (DIX) mechanism, i.e., DIX data.

[0071] S200: Write the stored data to the storage terminal.

[0072] In step S200, the storage device may be located in the same electronic device as the host device, such as a mobile phone. The host device writes the stored data from the block sublayer to the Nand medium of the storage device via a data transmission link. Figure 3 As shown, the page space of the Nand medium includes a data space for storing raw data and a spare space for storing verification data, enabling the data to be stored at the storage end.

[0073] S300: In response to receiving a write completion notification from the storage device, generate a first data read request to read the stored data.

[0074] In step S300, after the data is written to the storage device, the storage device sends a write completion notification to the host device to indicate that the write process corresponding to this data write request has been completed. When the host device receives the write completion notification, it generates a first data read request, which enables it to read the stored data written to the storage device, thereby providing a basis for verifying the stored data.

[0075] S400: Verify the stored data based on the verification data.

[0076] In step S400, the host can verify the integrity of the stored data based on the verification data in the read stored data to determine whether the stored data stored on the storage end has been corrupted. If the verification is successful, it means that the write process corresponding to this data write request is successful; if the verification fails, it means that the write process corresponding to this data write request has failed. For example, the host can perform DIX verification on the read stored data based on the verification data, i.e., DIX data, to determine whether the stored data generated on the host is consistent with the stored data written to the storage end.

[0077] Understandably, by adding verification data and generating the first data read request, the stored data written to the storage end can be verified immediately after a complete write process, without having to wait until there is a subsequent data read requirement to discover the problems in the data write.

[0078] In this embodiment, when a data write request is detected, verification data is added to the original data to generate stored data, which is then written to the storage terminal. When a write completion notification is received from the storage terminal, a first data read request is generated to read the stored data. The stored data can be verified based on the verification data, thus ensuring the completeness of the data written to the storage terminal. By adding verification data to the original data and immediately reading the stored data after it is written to verify its integrity, problems in the data writing process can be identified promptly, facilitating targeted repairs, ensuring data integrity, and improving the user experience.

[0079] In some embodiments, reference Figure 4 As shown, generating a first data read request to read stored data includes:

[0080] S310. Based on the data write request, generate a first data read request, wherein the read address information of the first data read request is consistent with the storage address information of the data write request.

[0081] In step S310, a corresponding first data read request is generated based on the data write request, such that the read address information used by the first data read request to read data is consistent with the storage address information used by the data write request to write data.

[0082] S320: Send the first data read request to the storage end to read the stored data.

[0083] In step S320, the host sends a first data read request to the storage end to read data using the read address information of the first data read request. Since the read address information of the first data read request is consistent with the storage address information of the data write request, the actual mapping address for the data read by the first data read request is the same as the actual mapping address for the data write by the data write request, thereby enabling the storage data written to the storage end corresponding to the data write request to be read.

[0084] In this embodiment, a first data read request is generated based on the data write request and sent to the storage terminal to read the stored data. This realizes the generation of the first data read request and the reading of the stored data, providing a basis for the verification of the stored data. By setting the read address information of the first data read request to be consistent with the storage address information of the data write request, it is ensured that the read storage data is the storage data written to the storage terminal corresponding to the write request. The accuracy of the verification target can be improved by controlling the consistency of the address information.

[0085] In some embodiments, in response to receiving a write completion notification sent by the storage device, generating a first data read request to read the stored data includes: in response to receiving a write completion notification sent by the storage device and meeting preset read conditions, generating a first data read request to read the stored data.

[0086] When the host receives a write completion notification from the storage terminal, it can determine whether the current data write request meets the preset read conditions, and only generate the first data read request and read the stored data if the preset read conditions are met.

[0087] For example, for multiple data write requests, the frequency of the data write requests can be used as the basis for determining whether the preset read conditions are met. A certain frequency of sampling can be performed on multiple data write requests, and a corresponding first data read request can be generated for the sampled data write requests to read the stored data corresponding to these data write requests and perform subsequent verification.

[0088] In this embodiment, when a write completion prompt is received from the storage terminal and the preset read conditions are met, a first data read request is generated to read the stored data. This can limit the number of data write requests that perform corresponding data verification processes in multiple data write requests, eliminating the need to perform a data verification process for each data write request. This saves system resources occupied by the data verification process and reduces the power consumption generated by the data verification process.

[0089] In some embodiments, the preset read conditions include: the interval between the previous generation of the first data read request and the previous generation of the first data read request reaches a preset duration, or the number of write requests between the previous generation of the first data read request and the previous generation of the first data read request reaches a first preset number.

[0090] If the preset read conditions include a preset interval between the current time and the previous generation of the first data read request, the host, upon receiving the write completion notification, also needs to determine whether the interval between the current time and the previous generation of the first data read request has reached the preset interval. This ensures that a first data read request corresponding to the current data write request is generated only when the interval reaches the preset interval. Under these preset read conditions, the interval between data write requests can be used as a standard for sampling multiple data write requests. The generation of the first data read request has a fixed period, allowing data verification to be performed only on one of the multiple data write requests within a fixed period.

[0091] If the preset condition includes that the number of write requests between the current data write request and the previous first data read request reaches a first preset number, the host, upon receiving the write completion notification, also needs to determine whether the number of write requests between the current data write request and the previous first data read request reaches the first preset number. Only when the number reaches the first preset number will a first data read request corresponding to the current data write request be generated. Under this preset condition, the interval between data write requests can be used as a standard for sampling multiple data write requests. Each generation of a first data read request corresponds to a fixed number of data write requests, ensuring that for a fixed number of multiple data write requests, only one data write request is subject to data verification.

[0092] In this embodiment, the preset reading condition is that the interval between the previous generation of the first data read request reaches a preset duration or the number of write requests between the previous generation of the first data read request reaches a first preset number. This allows the interval or number between data write requests to be used as a standard for sampling multiple data write requests. For multiple data write requests at a certain time or frequency, the data verification process is performed only for one of the data write requests, saving system resources occupied by the data verification process and reducing the power consumption generated by the data verification process.

[0093] Understandably, in addition to generating the first data read request when receiving a write completion notification and meeting preset conditions, the host can also generate a second data read request based on the user's data read request when there is a real data read demand. The second data read request can also read the stored data written to the storage end and verify it according to the verification data. At this time, the sampling frequency of the data write request will change, which may lead to an increase in the consumption of system resources and power consumption.

[0094] To address the aforementioned issues, in some embodiments, if the preset reading conditions include the interval between the previous generation of the first data reading request and the previous generation of the second data reading request reaching a preset duration, the preset reading conditions further include the interval between the previous generation of the second data reading request and the previous generation of the second data reading request reaching a preset duration, and the second data reading request is generated in response to the user's data reading request operation.

[0095] If a preset reading condition is set for the interval between the previous generation of the first data read request and the previous generation of the second data read request, then when the host receives a write completion notification, it needs to simultaneously check both the interval between the previous generation of the first data read request and the previous generation of the second data read request. If both intervals reach the preset time, a first data read request corresponding to the current data write request is generated. This ensures that for multiple data write requests within a fixed period, only one data write request is used to generate either a first or second data read request to perform the data verification process.

[0096] If the preset read conditions include the number of write requests between the previous generation of the first data read request and the previous generation of the second data read request reaching a first preset number, the preset read conditions also include the number of write requests between the previous generation of the second data read request and the previous generation of the second data read request reaching a first preset number.

[0097] If the number of write requests between the previous generation of the first data read request and the previous generation of the second data read request reaches a first preset number, then the host needs to simultaneously determine the number of write requests between the previous generation of the first data read request and the previous generation of the second data read request after receiving the write completion notification. If both numbers reach the preset number, a first data read request corresponding to the current data write request is generated. This ensures that for a fixed number of multiple data write requests, only one of the data write requests is used to generate either a first data read request or a second data read request to perform the data verification process.

[0098] In this embodiment, when the preset read condition includes the interval between the previous generation of the first data read request and the current generation of the second data read request reaching a preset time, the same preset read condition is used. Similarly, when the preset read condition includes the number of write requests between the previous generation of the first data read request and the current generation of the second data read request reaching a first preset number, the same preset read condition is used. This maintains the sampling frequency for write requests. It ensures that for multiple data write requests within a fixed period or a fixed number, only one data write request is generated to perform the data verification process, saving system resources and reducing power consumption associated with the data verification process.

[0099] In some embodiments, the verification data includes data protection information. Verifying the stored data based on the verification data includes: performing data integrity extension-based verification on the stored data based on the data protection information.

[0100] The verification data includes data protection information (PI), which is 8 bytes in size. When verifying stored data based on the verification data, a data integrity extension-based verification, namely DIX verification, can be performed on the stored data based on the data protection information. This allows the data protection information to be used as DIX data, providing a basis for DIX verification of the stored data.

[0101] For example, verification based on data integrity extension can generate new data protection information by using the same method on the original data in the read storage data, and compare it with the initial data protection information added when generating the storage data. If the two are the same, the verification is considered successful; if they are different, the verification is considered to have failed.

[0102] In this embodiment, data protection information is used as verification data. Based on this information, extended verification of stored data based on data integrity is performed, enabling timely detection of data writing problems and facilitating targeted repairs, thus ensuring data integrity. The addition of data protection information does not interfere with the original data, and the extended verification based on data integrity effectively reduces the computational overhead on the host side during data verification, contributing to improved overall host performance.

[0103] In some embodiments, the data processing method further includes: generating a write success message in response to successful verification.

[0104] When the verification result of the stored data based on the verification data is successful, the host generates a write success message to indicate that the stored data has not been corrupted and the write process corresponding to this write request has been successfully executed. The write success message can be displayed on the electronic device's screen, allowing the user to intuitively observe the successful write result without needing to perform any data repair.

[0105] In this embodiment, by generating a write success message upon successful verification, the user can know that the stored data has been successfully written without being corrupted, eliminating the need for further processing of this stored data and improving data processing efficiency.

[0106] In some embodiments, the data processing method further includes: performing a memory check on the write request to determine the type of write failure in response to a check failure.

[0107] When the verification result of checking the stored data based on the verification data fails, the host performs a memory check on the write request and determines the write failure type based on the memory check result. Memory check can, for example, use a specific algorithm to generate check bits for the original data stored in the host's memory and verify the integrity of the original data based on the check bits.

[0108] If the memory verification is successful, it means that the original data was not corrupted when the storage data was generated, and an error occurred during the data writing process. If the memory verification fails, it means that the original data itself was corrupted when the storage data was generated, and an error occurred before the data was written. This allows us to determine the different write failure types corresponding to successful or failed memory verification.

[0109] In this embodiment, when the verification fails, memory verification of the write request can be performed to determine whether the original data was corrupted before the writing process, thereby determining the write failure type corresponding to this write request. This facilitates targeted repair processing based on the write failure type and improves the user experience.

[0110] It should be noted that the storage end can also verify the data written to the storage end through specific verification methods. The host end performs memory verification on the write request to determine the type of write failure. This can be executed not only when the host end determines that the verification has failed, but also when the storage end determines that the verification has failed.

[0111] In some embodiments, reference Figure 5 As shown, memory verification is performed on write requests to determine the type of write failure, including:

[0112] S510. Perform cyclic redundancy check on the original data corresponding to the write request.

[0113] In step S510, Cyclic Redundancy Check (CRC) can be selected as the type of memory verification. A CRC code is generated for the original data in memory using a preset polynomial. The original data written to the storage terminal is then calculated using the preset polynomial. When the remainder is zero, it means that the CRC verification is successful and the original data is not corrupted when generating the storage data. When the remainder is not zero, it means that the CRC verification fails and the original data has been corrupted when generating the storage data.

[0114] S520: In response to the successful cyclic redundancy check, the write failure type is determined to be transmission link corruption.

[0115] In step S520, when the cyclic redundancy check is successful, it means that the original data was not destroyed when the storage data was generated. The reason for the failure to write the storage data to the storage end is the damage to the hardware-level data link. Therefore, the write failure type can be determined as the damage to the data link.

[0116] S530, In response to the failure of cyclic redundancy check, the write failure type is determined to be original data corruption.

[0117] In step S530, when the cyclic redundancy check fails, it means that the original data itself has been corrupted when the storage data is generated. The reason for the failure to write the storage data to the storage end is due to software-level memory access failure, software logic error, etc., so the write failure type can be determined as transmission link damage.

[0118] In this embodiment, cyclic redundancy check is performed on the original data corresponding to the write request. Based on the cyclic redundancy check result, it can be determined whether the write failure type is due to transmission link damage or original data corruption. This facilitates targeted repair processing based on the write failure type and improves the user experience.

[0119] In some embodiments, reference Figure 6 As shown, the data processing method also includes:

[0120] S610. In response to the number of write requests with the write failure type of transmission link damage exceeding the second preset number, the data transmission link is reset.

[0121] In step S610, the host can count the write requests that fail due to transmission link failure. When the count exceeds the second preset count, it means that there are too many write failures caused by transmission link failure. Targeted repair processing is needed for this type of write failure. In this case, the data transmission link can be reset to fix the hardware-level error and ensure the successful writing of subsequent write requests.

[0122] S620: In response to the number of write requests with the write failure type of original data corruption exceeding the third preset number, the application corresponding to the write request is restarted or isolated.

[0123] In step S620, the host can count the write requests that fail due to corrupted original data. When the count exceeds a third preset count, it means that there are too many write failures caused by corrupted original data. Targeted repair of this write failure type is required. In this case, the application corresponding to the write request can be restarted or isolated to fix the software-level error and ensure the successful writing of subsequent write requests.

[0124] In this embodiment, when the number of write requests with the write failure type of transmission link damage exceeds the second preset number, the error at the hardware level of the write process can be repaired by resetting the data transmission link. When the number of write requests with the write failure type of original data damage exceeds the third preset number, the error at the software level of the write process can be repaired by restarting or isolating the application corresponding to the write request. This achieves targeted repair of the problems existing in data writing and provides a guarantee for ensuring data integrity.

[0125] In some embodiments, the data processing method further includes: storing system logs generated based on the verification process in response to a verification failure.

[0126] When the host verifies the stored data, it generates corresponding system logs. If verification fails, the system logs generated during the verification process can be dumped, facilitating subsequent statistical analysis of write requests over a longer period. Staff can then use the statistical analysis results to report to the server, continuously monitor the data, and provide patch revisions to reduce the probability of subsequent write failures.

[0127] In this embodiment, when the verification fails, the system log generated according to the verification process is stored. This facilitates the statistical analysis of the write status of write requests over a longer period of time based on the system log, and the execution of corresponding maintenance operations, thereby reducing the probability of subsequent write failures and improving the user experience.

[0128] In one exemplary embodiment, a data processing method is provided, applied to a host side, with reference to... Figure 7 As shown, the data processing methods include:

[0129] S1. In response to a data write request, add data protection information to the original data and generate stored data;

[0130] S2. Write the stored data to the storage device;

[0131] S3. In response to receiving a write completion notification from the storage terminal and meeting the preset read conditions, generate a first data read request to read the stored data;

[0132] S4. Based on data protection information, perform extended verification on the stored data based on data integrity.

[0133] S5. In response to successful verification, generate a write success message;

[0134] S6. In response to verification failure, perform cyclic redundancy verification on the original data corresponding to the write request.

[0135] S7. In response to the successful cyclic redundancy check, the write failure type is determined to be a transmission link failure.

[0136] S8. In response to the number of write requests with the write failure type of transmission link damage exceeding the second preset number, the data transmission link is reset;

[0137] S9. In response to the failure of cyclic redundancy check, the write failure type is determined to be original data corruption.

[0138] S10. In response to the number of write requests with the write failure type of original data corruption exceeding the third preset number, the application corresponding to the write request is restarted or isolated.

[0139] S11. In response to a verification failure, store the system logs generated based on the verification process.

[0140] In this embodiment, when a data write request is detected, data protection information is added to the original data to generate stored data, which is then written to the storage terminal. When a write completion notification is received from the storage terminal, a first data read request is generated to read the stored data. The stored data can be verified based on the data protection information, thus verifying the completeness of the stored data written to the storage terminal. By adding data protection information to the original data and immediately reading the stored data after writing to verify it based on the data protection information, problems in the data writing process can be detected promptly, facilitating targeted repairs, ensuring data integrity, and improving the user experience.

[0141] In one exemplary embodiment, a data processing apparatus is provided, applied to a host side, with reference to... Figure 8 As shown, the data processing device includes an adding module 10, a writing module 20, a reading module 30, and a verification module 40. The adding module 10 adds verification data to the original data in response to a data write request, generating stored data. The writing module 20 writes the stored data to the storage terminal. The reading module 30 generates a first data read request to read the stored data in response to receiving a write completion notification from the storage terminal. The verification module 40 verifies the stored data based on the verification data.

[0142] In this embodiment, when a data write request is detected, the adding module 10 adds verification data to the original data to generate stored data, and the writing module 20 writes the stored data to the storage terminal. When a write completion notification is received from the storage terminal, the reading module 30 generates a first data read request to read the stored data. The verification module 40 verifies the stored data based on the verification data, thus verifying the completeness of the stored data written to the storage terminal. By adding verification data to the original data and immediately reading the stored data after it is written to verify it based on the verification data, problems in the data writing process can be detected in a timely manner, facilitating targeted repairs, ensuring data integrity, and improving the user experience.

[0143] In one embodiment, the reading module 30 is further configured to: generate a first data reading request based on a data writing request, wherein the reading address information of the first data reading request is consistent with the storage address information of the data writing request; and send the first data reading request to the storage end to read the stored data.

[0144] In one embodiment, the reading module 30 is further configured to: generate a first data reading request to read stored data in response to receiving a write completion prompt sent by the storage terminal and meeting preset reading conditions.

[0145] In one embodiment, the preset read conditions include: the interval between the previous generation of the first data read request and the previous generation of the first data read request reaches a preset duration; or, the number of write requests between the previous generation of the first data read request and the previous generation of the first data read request reaches a first preset number.

[0146] In one embodiment, if the preset read condition includes the interval between the previous generation of the first data read request and the previous generation of the second data read request reaching a preset duration, the preset read condition further includes the interval between the previous generation of the second data read request reaching a preset duration, wherein the second data read request is generated in response to the user's data read request operation; if the preset read condition includes the number of write requests between the previous generation of the first data read request and the previous generation of the second data read request reaching a first preset number, the preset read condition further includes the number of write requests between the previous generation of the second data read request and the previous generation of the second data read request reaching a first preset number.

[0147] In one embodiment, the verification data includes data protection information, and the verification module 40 is further configured to: perform data integrity extension-based verification on the stored data based on the data protection information.

[0148] In one embodiment, the data processing device further includes a prompting module, which generates a write success prompt in response to a successful verification.

[0149] In one embodiment, the data processing apparatus further includes a determination module, which is configured to perform a memory check on the write request to determine the type of write failure in response to a check failure.

[0150] In one embodiment, the determining module is further configured to: perform cyclic redundancy check on the original data corresponding to the write request; in response to successful cyclic redundancy check, determine that the write failure type is transmission link damage; in response to failed cyclic redundancy check, determine that the write failure type is original data corruption.

[0151] In one embodiment, the data processing device further includes a repair module, which is configured to reset the data transmission link in response to the number of write requests with the write failure type of transmission link damage exceeding a second preset number; and to restart or isolate the application corresponding to the write request in response to the number of write requests with the write failure type of original data damage exceeding a third preset number.

[0152] In one embodiment, the data processing apparatus further includes a storage module for storing system logs generated based on the verification process in response to a verification failure.

[0153] In one exemplary embodiment, an electronic device is provided, which may be, for example, a mobile phone, a tablet computer, or the like. The electronic device may include, for example, a host device and a storage device as described above.

[0154] refer to Figure 9 As shown, the electronic device may include one or more of the following components: processing component 101, memory 102, power component 103, multimedia component 104, audio component 105, input / output (I / O) interface 106, sensor component 107, and communication component 108.

[0155] Processing component 101 typically controls the overall operation of an electronic device, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 101 may include one or more processors 109 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 101 may include one or more modules to facilitate interaction between processing component 101 and other components. For example, processing component 101 may include a multimedia module to facilitate interaction between multimedia component 104 and processing component 101.

[0156] Memory 102 is configured to store various types of data to support the operation of the electronic device. Examples of such data include instructions for any application or method used to operate on the electronic device, contact data, phonebook data, messages, pictures, videos, etc. Memory 102 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0157] Power component 103 provides power to various components of the electronic device. Power component 103 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.

[0158] Multimedia component 104 includes a screen that provides an output interface between the electronic device and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 104 includes a front-facing camera and / or a rear-facing camera. When the electronic device is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0159] Audio component 105 is configured to output and / or input audio signals. For example, audio component 105 includes a microphone (MIC) configured to receive external audio signals when the electronic device is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 102 or transmitted via communication component 108. In some embodiments, audio component 105 also includes a speaker for outputting audio signals.

[0160] I / O interface 106 provides an interface between processing component 101 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0161] Sensor assembly 107 includes one or more sensors for providing state assessments of various aspects of the electronic device. For example, sensor assembly 107 can detect the on / off state of the electronic device, the relative positioning of components such as the display and keypad of the electronic device, changes in the position of the electronic device or a component of the electronic device, the presence or absence of user contact with the electronic device, the orientation or acceleration / deceleration of the electronic device, and temperature changes of the electronic device. Sensor assembly 107 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 107 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 107 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0162] Communication component 108 is configured to facilitate wired or wireless communication between electronic devices and other devices. Devices can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 108 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 108 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0163] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the data processing method applied to the electronic device described above.

[0164] In one exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 102 including instructions, which can be executed by a processor 109 of an electronic device to perform the data processing method applied to the electronic device described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc. When the instructions in the storage medium are executed by the processor 109 of the electronic device, the electronic device is able to perform the data processing method shown in the above embodiments.

[0165] In one exemplary embodiment, a computer program product is also provided, including a computer program that, when executed by a processor 109, implements the data processing method shown in the above embodiments.

[0166] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.

[0167] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A data processing method, characterized by, The data processing method includes: In response to a data write request, validation data is added to the original data to generate stored data; Write the stored data to the storage terminal; In response to receiving a write completion notification from the storage device, a first data read request is generated to read the stored data; The stored data is verified based on the verification data.

2. The data processing method according to claim 1, characterized in that, The process of generating a first data read request to read the stored data includes: Based on the data write request, the first data read request is generated, and the read address information of the first data read request is consistent with the storage address information of the data write request; The first data read request is sent to the storage terminal to read the stored data.

3. The data processing method of claim 1, wherein, The step of generating a first data read request to read the stored data in response to receiving a write completion notification from the storage device includes: In response to receiving a write completion notification from the storage device and meeting preset read conditions, a first data read request is generated to read the stored data.

4. The data processing method according to claim 3, characterized in that, The preset reading conditions include: The interval between the previous generation of the first data read request and the current generation of the first data read request reaches a preset duration; or, The number of write requests between the previous generation of the first data read request and the previous generation of the first data read request reaches a first preset number.

5. The data processing method according to claim 4, characterized in that, If the preset reading condition includes a preset time interval between the previous generation of the first data reading request and the current generation of the first data reading request, the preset reading condition further includes: When the interval between the previous generation of the second data read request and the previous generation of the second data read request reaches the preset time, the second data read request is generated in response to the user's data read request operation; If the preset read condition includes the condition that the number of write requests between the previous generation of the first data read request and the current generation of the first data read request reaches a first preset number, the preset read condition further includes: The number of write requests between the previous generation of the second data read request and the previous generation of the second data read request reaches the first preset number.

6. The data processing method according to any one of claims 1 to 5, characterized in that, The verification data includes data protection information, and the verification of the stored data based on the verification data includes: Based on the data protection information, the stored data is verified using data integrity extension.

7. The data processing method according to any one of claims 1 to 5, characterized in that, The data processing method further includes: Upon successful verification, a write success message is generated.

8. The data processing method according to any one of claims 1 to 5, characterized in that, The data processing method further includes: In response to the verification failure, a memory verification is performed on the write request to determine the type of write failure.

9. The data processing method according to claim 8, characterized in that, The step of performing memory verification on the write request to determine the write failure type includes: Perform cyclic redundancy check on the original data corresponding to the write request; In response to the successful cyclic redundancy check, the write failure type is determined to be a transmission link failure; In response to the failure of the cyclic redundancy check, the write failure type is determined to be original data corruption.

10. The data processing method according to claim 9, characterized in that, The data processing method further includes: In response to the number of write requests whose write failure type is "transmission link failure" exceeding a second preset number, the data transmission link is reset; If the number of write requests with the write failure type of "original data corruption" exceeds a third preset number, the application corresponding to the write request is restarted or isolated.

11. The data processing method according to any one of claims 1 to 5, characterized in that, The data processing method further includes: In response to the verification failure, the system log generated based on the verification process is stored.

12. A data processing apparatus, characterized by The data processing device includes: An add module is used to add verification data to the original data in response to a data write request, thereby generating stored data; A writing module, used to write the stored data to the storage terminal; A read module, configured to generate a first data read request to read the stored data in response to receiving a write completion notification from the storage terminal; A verification module is used to verify the stored data based on the verification data.

13. An electronic device, comprising: The electronic device includes: processor; Memory used to store processor-executable instructions; The processor is configured to perform the data processing method as described in any one of claims 1 to 11.

14. A non-transitory computer-readable storage medium, comprising: When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the data processing method as described in any one of claims 1 to 11.

15. A computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data processing method as described in any one of claims 1 to 11.