Data processing method, electronic device and computer program product
By implementing data detection and recovery methods in the memory card, the problems of memory card data errors and loss are solved, and the security and reliability of the memory card are improved.
Patent Information
- Application Number
- CN202411906885.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-18
Smart Images

Figure CN119847430A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of memory card reading and writing, and in particular to a data processing method, an electronic device and a computer program product. Background Art
[0002] As the application scenarios of memory cards continue to expand, the security and integrity of their data are becoming increasingly important. During the use of memory cards, many factors often cause abnormal phenomena such as errors and loss of data in the memory card due to sudden power outages that interrupt data transmission, and file system damage that causes data read and write errors.
[0003] In the related art, the number of memory card mounting failures is mainly used as the basis for memory card abnormality detection, and the memory card is recovered by resetting or resetting. However, after the memory card is successfully mounted or the memory card is reset or re-set, data abnormalities such as data loss and data errors may still occur, affecting the security and reliability of the memory card and resulting in a poor user experience. Summary of the invention
[0004] The present application provides a data processing method, an electronic device, and a computer program product, which can detect abnormal data during the process of reading data in a memory card, and can recover the abnormal data when a system abnormality occurs, thereby reducing problems caused by data abnormalities such as data loss and data errors in the memory card, and improving the security and reliability of the memory card.
[0005] In a first aspect, a data processing method is provided, which is applied to an electronic device, wherein the electronic device includes a memory card, and the data processing method includes the following steps:
[0006] Acquire initial data that needs to be accessed in a storage card; detect the initial data based on a preset detection strategy, wherein the preset detection strategy is used to indicate that an abnormality determination operation is performed on the initial data based on a preset model or preset rules; when an abnormality is detected in the initial data, restore the initial data based on a preset recovery strategy to obtain target data, wherein the preset recovery strategy is used to indicate that a recovery operation is performed on the initial data based on a preset model or preset rules.
[0007] During the process of reading the initial data in the memory card, an abnormality determination operation is performed on the initial data based on a preset model or preset rules to detect the initial data; when an abnormality is detected in the initial data, a recovery operation is performed on the initial data based on the preset model or preset rules to obtain the target data after the initial data is recovered; the abnormal initial data is processed by software detection and recovery, thereby reducing problems caused by data anomalies such as data loss and data errors in the memory card and improving the security and reliability of the memory card.
[0008] In one possible implementation, when an abnormality is detected in the initial data, the initial data is recovered based on a preset recovery strategy to obtain target data, and the method also includes: when an abnormality is detected in the initial data, the initial data is recorded to obtain abnormal record information; during the use of the initial data, whether the initial data will trigger a system abnormality of the electronic device; when the initial data triggers a system abnormality of the electronic device, the initial data is recovered based on the preset recovery strategy and the abnormal record information to obtain the target data.
[0009] It should be understood that some of the initial data in the memory card may not affect the normal use of the electronic device when an abnormality is detected; and some of the initial data may not immediately cause a system abnormality in the electronic device when an abnormality is detected, but will only trigger the system abnormality of the electronic device when other data associated with the initial data (also initial data) is read at a later time. Therefore, if the initial data is restored every time an abnormality is detected in the initial data, the data processing efficiency of the electronic device will be reduced, and even the user experience will be affected.
[0010] In order to improve the efficiency of data processing, when an abnormality is detected in the initial data and the initial data triggers a system abnormality of the electronic device, the embodiment of the present application recovers the initial data based on a preset recovery strategy to obtain target data.
[0011] In a possible implementation, the data processing method further includes: receiving write data to be stored in a storage card; inputting the write data into a preset model for feature extraction to obtain feature data; and analyzing the feature data to obtain preset rules.
[0012] The embodiment of the present application adds a process for determining a preset model and preset rules during the storage and writing of data to the memory card. In other words, the process for determining the preset model and preset rules and the process for writing data to the memory card are independent of each other and can be executed in parallel. Therefore, adding a process for determining the preset model and preset rules will not affect the efficiency of writing data to the memory card.
[0013] In a possible implementation, the initial data includes first data, the memory card includes a boot area, the boot area is used to store the first data, and the data processing method also includes: acquiring the first data, the first data is data of a first offset field stored in the boot area; detecting the first data based on a data rule in a preset rule; if the first data does not exist in the data corresponding to the first offset field in the data list corresponding to the data rule, it is detected that the first data is abnormal; if the first data triggers a system abnormality of the electronic device, the first data is restored based on other data corresponding to the first offset field in the data list to obtain the target data.
[0014] The first data in the boot area of the memory card has a certain fixedness, and therefore, can be detected using a rule algorithm corresponding to a preset rule, and repaired using a recovery method corresponding to the preset rule, thereby improving the security of the data in the boot area of the memory card.
[0015] In a possible implementation, the initial data includes second data, the memory card also includes a file allocation table area, the file allocation table area is used to store the second data, and the data processing method also includes: acquiring the second data, the second data is data of a second offset field stored in the file allocation table area; detecting the second data based on a first model in a preset model to obtain a predicted probability of a sequence corresponding to the second data; if the predicted probability of the sequence corresponding to the second data is lower than a preset first threshold, an abnormality is detected in the second data; if the second data triggers a system abnormality of the electronic device, restoring the second data based on other data of the second offset field determined by the first model to obtain target data.
[0016] For the second data in the file allocation table area in the storage card, there is a certain relationship between the second data. Therefore, the first model used for probability prediction in the preset model can be used for detection, and the recovery method corresponding to the first model can be used for repair, so as to improve the reliability of the data in the file allocation table area in the storage card.
[0017] In a possible implementation, the initial data includes third data, the memory card also includes a data area, the data area is used to store the third data, and the data processing method also includes: obtaining the third data, the third data is data of a third offset field stored in the data area; detecting the third data based on a second model in a preset model to obtain a predicted probability of the third data; if the predicted probability of the third data is lower than a preset second threshold, it is detected that the third data is abnormal; if the third data triggers a system abnormality of the electronic device, restoring the third data based on other data in the third offset field determined by the second model to obtain the target data.
[0018] The third data in the data area of the memory card can be detected using the second model for semantic learning in the preset model, and repaired using the recovery method corresponding to the second model, thereby improving the accuracy of the data in the data area of the memory card.
[0019] In a possible implementation, after acquiring the initial data in the storage card, it also includes: if the offset field corresponding to the initial data is fixed data, detecting the initial data based on a fixed rule in a preset rule, where the fixed rule is a rule determined by feature data obtained through a preset model; when an abnormality is detected in the initial data, restoring the initial data based on the fixed rule to obtain the target data.
[0020] For fixed data or initial data of fixed length in the memory card, fixed rules can be used for detection, and fixed rules, or prescribed rules and preset models can be used for repair to improve the accuracy of such data in the memory card.
[0021] It should also be understood that the data recovery in the memory card in the embodiment of the present application is achieved through software means, and during the process, no hardware operations such as forced reset or resetting of the memory card are performed, thereby improving the security of the data in the memory card.
[0022] In the above-mentioned implementations, the initial data is divided according to different areas and types. It should be noted that the corresponding processes are independent of each other and do not interfere with each other. Using different methods for detection and recovery can accurately handle data anomalies, thereby effectively restoring data availability and integrity.
[0023] In a possible implementation, the electronic device also includes a learning module, a detection module and a data usage module, and the data processing method also includes: the detection module receives initial data; the initial data is detected based on a preset model or preset rules in the detection module; when the detection module detects that the initial data has an abnormality, the initial data is recorded in the abnormality recording submodule in the detection module, and the initial data is output to the data usage module; when the data usage module detects that the initial data triggers a system abnormality of the electronic device, the detection module recovers the initial data based on the preset model or preset rules to obtain target data, and outputs the target data to the data usage module.
[0024] In order to reasonably divide the various processes in the above method through modules and improve the maintainability of the data processing method; and to process the abnormal initial data through software detection and recovery, reduce the problems caused by data anomalies such as data loss and data errors in the memory card, and improve the security and reliability of the memory card.
[0025] In a second aspect, a data processing device is provided, comprising a unit for executing any one of the data processing methods in the first aspect. The device may be a terminal device or a chip in the terminal device.
[0026] In a third aspect, an electronic device is provided, comprising a processor. When the processor executes instructions, the processor executes any one of the data processing methods in the first aspect.
[0027] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by an electronic device, the electronic device executes any one of the data processing methods in the first aspect.
[0028] In a fifth aspect, a computer program product is provided, the computer program product comprising: a computer program, when the computer program is executed by an electronic device, the electronic device executes any one of the data processing methods in the first aspect.
[0029] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A framework diagram of an electronic device in some embodiments of the present application is shown;
[0031] Figure 2 A flowchart showing a data processing method in some embodiments of the present application is shown;
[0032] Figure 3 A flowchart showing a data processing method in some embodiments of the present application is shown;
[0033] Figure 4 A flowchart showing a data processing method in some embodiments of the present application is shown;
[0034] Figure 5 A flowchart showing a data processing method in some embodiments of the present application is shown;
[0035] Figure 6 A flowchart showing a data processing method in some embodiments of the present application is shown;
[0036] Figure 7 A schematic diagram of the second model in some embodiments of the present application is shown;
[0037] Figure 8 A flowchart showing a data processing method in some embodiments of the present application is shown;
[0038] Fig. 9 A schematic diagram of the software architecture in an electronic device in some embodiments of the present application is shown;
[0039] Fig.10 A schematic diagram of the software architecture in an electronic device in some embodiments of the present application is shown;
[0040] Fig.11 A schematic diagram of the software architecture in an electronic device in some embodiments of the present application is shown;
[0041] Fig.12 It is a schematic diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0043] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
[0044] For the purpose of illustration rather than limitation, specific details such as specific system structures, technologies, etc. are provided to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0045] For ease of understanding, some concepts involved in the embodiments of the present application are introduced and explained below:
[0046] (1) Memory card
[0047] A memory card is a physical device used to store data. It saves data through storage media such as flash memory. Common memory cards include SD card (Secure Digital Card), CF card (Compact Flash Card), TF card (Trans-Flash Card, also known as Micro-SD card), etc.
[0048] The storage capacity of memory cards has different specifications, such as 64GB, 128GB, 256GB, 1TB, etc.; memory cards can be used to store various files such as photos, videos, documents, etc.
[0049] (2) File system
[0050] The file system is a logical structure used by the operating system to specify how data is stored and organized on the memory card. It defines many aspects of the file, such as the naming rules, storage location, and access permissions. For example, common file systems include FAT32 (File Allocation Table 32), NTFS (New Technology File System), exFAT (Extended File Allocation Table), etc.
[0051] It should be understood that the memory card itself only provides a physical space for storing data. Without a file system, the data will be stored in a disorderly manner on the memory card, making it difficult to manage and access it effectively. The file system can divide the memory card into multiple areas, thereby building an orderly storage architecture, making data access, reading and writing on the memory card convenient and efficient.
[0052] With the rapid development of digital information, memory cards, as an indispensable data storage medium for many electronic devices, the effectiveness and reliability of data processing are directly related to the security and integrity of stored data.
[0053] The use of memory cards, whether in various electronic devices in daily life scenarios or in response to the need for large-scale data storage in professional fields, faces challenges from multiple factors such as physical environment, electrical performance fluctuations, software system interaction and human operation. These factors may lead to data errors, data loss and other data anomalies, which in turn may lead to data reading abnormalities, which in turn have a serious impact on the user experience.
[0054] Among them, the memory card encounters a sudden power outage, which causes data transmission to be interrupted. For example, if the power is cut off during data writing, the actual written data is uncontrollable, and the data may be wrong after powering on again. In addition, file system damage causes data reading and writing disorder, such as data errors in the boot area, which makes it impossible to read and write; data errors or loss in the file allocation table area, and the corresponding data area files cannot be located; video and picture data errors in the data area make the video or picture unable to be used normally.
[0055] In the related art, the number of memory card mounting failures is mainly used as a basis for memory card abnormality detection, and the memory card is recovered through a reset or resetting operation.
[0056] However, after the memory card is successfully mounted or reset, data anomalies such as data loss and data errors may occur. After the memory card is reset, all data will be lost, affecting the security and reliability of the memory card and resulting in a poor user experience.
[0057] In view of this, an embodiment of the present application provides a data processing method, an electronic device and a computer program product. The data processing method includes: in the process of reading the initial data in the memory card, performing an abnormality determination operation on the initial data based on a preset model or preset rules to detect the initial data; when it is detected that the initial data has an abnormality, performing a recovery operation on the initial data based on the preset model or preset rules to obtain target data after the initial data is recovered; and processing the abnormal initial data through software detection and recovery, thereby reducing problems caused by data anomalies such as data loss and data errors in the memory card, and improving the security and reliability of the memory card.
[0058] In order to facilitate further understanding of the technical solutions in some embodiments of the present application, the data processing method, the technical solution of the electronic device, and how the technical solution solves the above-mentioned technical problems are described in detail below in combination with some specific embodiments and drawings. The various embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. Obviously, the described embodiments are part of the embodiments of the present application, not all of them.
[0059] Figure 1 A framework diagram of an electronic device in some embodiments of the present application is shown, such as Figure 1 As shown, the electronic device 10 includes a memory card 12 and a processor 11. The processor 11 is in communication with the memory card 12. The processor 11 is used to process data written to and read from the memory card 12 to achieve the ability to detect abnormalities in the data in the memory card, and when an abnormality occurs, the abnormal data can be recovered, thereby reducing problems caused by data abnormalities such as data loss and data errors in the memory card, and improving the security and reliability of the memory card.
[0060] It should be understood that the electronic device 10 can be a digital camera device, a mobile communication device, an audio and video playback device, a vehicle-mounted electronic device, or other device that requires storage function, for example, a digital camera, a sports camera, a video camera, an IPCAMERA (IPC for short), a smart phone, a tablet computer, a driving recorder, etc.
[0061] The processor 11 may be the control center of the electronic device 10 , connecting various parts of the entire electronic device 10 using various interfaces and lines, and executing various functions of the electronic device 10 and processing data by running or executing software programs and / or modules and calling data stored in the memory card 12 .
[0062] The electronic device 10 includes one or more processors 11; the one or more processors 11 can support the data processing method in the electronic device 10 to implement the method embodiment. The processor 11 can be a general-purpose processor or a special-purpose processor. For example, the processor 11 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, such as discrete gates, transistor logic devices or discrete hardware components.
[0063] The processor 11 can be used to control the electronic device 10, execute software programs, and process data of the software programs.
[0064] It should also be understood that the processor 11 may also refer to a storage processor, which is only used for data processing during the process of writing and reading data from the memory card.
[0065] The electronic device 10 may include one or more memories on which programs are stored. The programs can be executed by the processor 11 to generate instructions, so that the processor 11 executes the data processing method described in the above method embodiment according to the instructions.
[0066] The processor 11 and the memory may be provided separately or integrated together; for example, integrated on a system on chip (SOC) of the terminal device.
[0067] Exemplarily, the memory can be used to store relevant programs of the data processing method provided in the embodiments of the present application, and the processor 11 can be used to call relevant programs of the data processing method stored in the memory when processing data on the electronic device, and execute the data processing method of the embodiments of the present application.
[0068] It should be noted that the electronic device mentioned in the embodiments of the present application may include more modules in the above-mentioned electronic device.
[0069] Combine the following Figures 2 to 11 The data processing method provided in the embodiment of the present application is described in detail.
[0070] It should be noted that the executor of the touch data processing method provided in the embodiment of the present application can be the above-mentioned electronic device (such as a driving recorder and a camera, etc.), or a functional module or functional entity in the electronic device that can implement the method, and the scheme can be implemented through hardware and / or software, as well as a combination of methods. The specific method can be determined according to actual usage requirements, and the embodiment of the present application does not limit this.
[0071] Figure 2 A flow chart of a data processing method in some embodiments of the present application is shown. Figure 2 As shown, the data processing method includes the following steps:
[0072] S110: Acquire initial data in the memory card.
[0073] The initial data is the data that needs to be read.
[0074] In the process of using electronic devices, for example, when a user wants to browse previously taken photos and videos through application A, share or edit photos through application B, or check various files through application C; or when running a specific application that relies on data in the memory card (such as a map navigation application calling offline map data), the initial data stored in the memory needs to be viewed and used, and the corresponding data must be read from the memory card. Therefore, when reading the initial data from the memory card, the initial data that needs to be read is first obtained.
[0075] S120: Detect the initial data based on a preset detection strategy.
[0076] The preset detection strategy is used to indicate that an abnormality determination operation is performed on the initial data through a preset model or preset rule, and the abnormality determination operation is used to detect whether the initial data has an abnormality;
[0077] It should be understood that the preset models or preset rules are specifically preset according to the different types of initial data, aiming to effectively process various types of initial data in the most suitable manner, thereby meeting the application requirements of different data processing.
[0078] A preset model is a model pre-stored in an electronic device, and there are multiple ways to construct a preset model: first, it can be trained using data previously written to a memory card and / or a known data set to obtain a trained model; second, during the use of the memory card, real-time training is performed based on the actual written data to generate a corresponding model; third, based on the trained model, it is optimized with the help of the actual written data to obtain an optimized model.
[0079] The preset model can also be used to perform feature extraction processing on the written data stored in the storage card to obtain feature data corresponding to the written data, where the processing includes data conversion, vectorization and standardization operations, etc.; the feature data includes character length, fixed character data, fixed separator symbol data, character occurrence frequency, etc.
[0080] The preset model may include multiple models, such as a first model and a second model. These models may be a neural network language model (NNLM) or a language model N-gram in natural language processing. In an embodiment of the present application, during the detection of initial data, the preset model is determined by the type of initial data.
[0081] Furthermore, the preset rules are rules determined after analyzing the characteristic data, for example, data frequency rules, fixed character rules, fixed separator rules, etc.
[0082] That is, when receiving the write data to be stored in the memory card, the write data will be feature extracted according to the pre-stored preset model to obtain feature data; and the feature data will be analyzed to obtain the preset rules. In some embodiments, the preset model can also be optimized by the write data to obtain an optimized preset model, and at this time, the write data can be feature extracted according to the optimized preset model.
[0083] It should be clear that the embodiment of the present application adds a process for determining a preset model and preset rules during the storage and writing of data to the memory card. In other words, the process for determining the preset model and preset rules and the process for writing data to the memory card are independent of each other and can be executed in parallel. Therefore, adding a process for determining the preset model and preset rules will not affect the efficiency of writing data to the memory card.
[0084] Among them, an abnormality judgment operation is performed on the initial data based on the preset model, including analyzing the initial data according to the preset model to obtain the predicted probability of the initial data; if the predicted probability is within the preset threshold range, the initial data is normal and can be directly output and used; if the predicted probability is not within the preset threshold range, the initial data is abnormal.
[0085] And, based on the preset rules, an abnormality determination operation is performed on the initial data, including analyzing whether the initial data belongs to a data list corresponding to the preset rules; if the initial data belongs to the data list, the initial data is normal and can be directly output and used; if the initial data does not belong to the data list, the initial data is abnormal.
[0086] S130: When an abnormality is detected in the initial data, the initial data is restored based on a preset recovery strategy to obtain target data.
[0087] The preset recovery strategy is used to instruct to perform a recovery operation on the initial data based on a preset model or preset rules.
[0088] The recovery operation is performed on the initial data based on the preset model, and the initial data is tried to be recovered in order from large to small according to the known predicted probabilities. After the electronic device operates normally, the recovery operation is stopped, and the target data after the initial data is recovered is obtained; wherein the known predicted probability satisfies the preset threshold range.
[0089] Among them, the initial data is first restored through the data with the highest probability according to the preset model, wherein the data with the highest probability refers to the data that meets the preset threshold range and has the largest probability among the known predicted probabilities; if the electronic device operates normally at this time, the target data after the initial data is restored is obtained; if the electronic device still has system abnormalities at this time, try to restore the initial data through data with higher probability, wherein the data with higher probability refers to the data that meets the preset threshold range and is less than the maximum probability among the known predicted probabilities, for example, data with the second highest probability, data with the third highest probability, etc.
[0090] Performing a recovery operation on the initial data based on preset rules, including attempting to recover the initial data according to the data in the data list corresponding to the preset rules; if the electronic device operates normally at this time, obtaining the target data after the initial data is recovered; if the electronic device still has a system abnormality at this time, recovering it through other data in the data list.
[0091] It should be understood that when performing a recovery operation on the initial data based on preset rules, the initial data can be tried to be recovered in order from high to low frequency in the data list. After the electronic device operates normally, the recovery attempt is stopped and the target data after the initial data is recovered is obtained.
[0092] Among them, during the recovery process, you can first try to recover the initial data from the data that appears most frequently in the data list. The data with the highest frequency is the data with the largest frequency in the data list. If the electronic device still has a system abnormality at this time, then recover the data with a higher frequency in the data list. The data with a higher frequency refers to the data in the data list whose frequency is less than the maximum frequency, such as the second most frequent data and the third most frequent data.
[0093] In the above process of reading the initial data in the memory card, an abnormality determination operation is performed on the initial data based on a preset model or preset rules to detect the initial data; when an abnormality is detected in the initial data and the initial data triggers a system abnormality of the electronic device, a recovery operation is performed on the initial data based on the preset model or preset rules to obtain the target data after the initial data is recovered; the abnormal data is processed by software detection and recovery, thereby reducing problems caused by data abnormalities such as data loss and data errors in the memory card, and improving the security and reliability of the memory card.
[0094] It should be understood that some of the initial data in the memory card may not affect the normal use of the electronic device when an abnormality is detected; and some of the initial data may not immediately cause a system abnormality in the electronic device when an abnormality is detected, but will trigger the system abnormality of the electronic device when other data associated with the initial data (also belonging to the initial data) is read at a later time. Therefore, if the initial data is restored every time an abnormality is detected in the initial data, the data processing efficiency of the electronic device will be reduced, and even the user experience will be affected. In order to improve the efficiency of data processing, when an abnormality is detected in the initial data and the initial data triggers a system abnormality in the electronic device, the embodiment of the present application restores the initial data based on a preset recovery strategy to obtain the target data.
[0095] Figure 3 A flow chart of a data processing method in some embodiments of the present application is shown. Figure 3 As shown, for Figure 2 In step 130 of the method, when an abnormality is detected in the initial data, the initial data is restored based on a preset recovery strategy to obtain target data, and the following steps are also included:
[0096] S140. When it is detected that the initial data is abnormal, the initial data is recorded to obtain abnormal record information.
[0097] For some of the above-mentioned application scenarios, the presence of anomalies in the initial data may not necessarily lead to the normal use of the electronic device. For example, some offset fields in the boot area of the memory card, such as the Volume_Size_Sect field used to record the volume size of the memory card, the heads field used to indicate the number of heads, and the fat32_version field used to indicate the version information of the file system (FAT32). Even if there are anomalies in the initial data corresponding to these fields, it will not affect the normal use of the memory card, and thus will not affect the normal use of the electronic device. Another example is some separators between various areas in the file system of the memory card: if data with all 00s is erroneous and causes an anomaly, it will not affect the normal use of the memory card, and thus will not affect the normal use of the electronic device.
[0098] Alternatively, the system abnormality of the electronic device may not be caused immediately, but the system abnormality of the electronic device will be triggered only when other data associated with the initial data (also belonging to the initial data) is read at a later time.
[0099] Therefore, the abnormal initial data can be recorded to obtain abnormal record information. It should be understood that the abnormal record information refers to the content formed by recording these abnormal initialization data and various related data when an abnormality occurs in the initial data during the process of reading the initial data from the storage card; these contents include but are not limited to the time when the abnormality occurred, the number of times the abnormality occurred in different areas, and the abnormal content (i.e., the initial data).
[0100] When a system anomaly is detected later, the associated data, i.e., the initial data of one or more anomalies, can be traced back according to the time in the anomaly record information, or the area with a higher number of anomalies can be traced back according to the number of times in the anomaly record information to try to recover.
[0101] It should also be understood that while recording the initial data, the user may also be informed by way of a reminder of the detailed information of the abnormal data in the memory card.
[0102] S150. During the use of the initial data, detecting whether the initial data will trigger a system abnormality of the electronic device.
[0103] In order to improve the efficiency of data processing, when an abnormality is detected in the initial data, the initial data will also be read out, and it will be detected whether the initial data will trigger a system abnormality of the electronic device.
[0104] It should be understood that abnormal initial data may or may not cause system abnormality. When the abnormal initial data does not cause system abnormality, the reading process will continue, and the subsequent read initial data will continue to be monitored.
[0105] S160: When the initial data triggers a system abnormality of the electronic device, the initial data is restored based on a preset recovery strategy and abnormality record information to obtain target data.
[0106] It should be understood that the initial data triggering the system abnormality of the electronic device here may be the initial data read this time, or may be the initial data read later.
[0107] It should also be understood that if the initial data does not trigger a system abnormality in the electronic device, the reading process will continue until there is an abnormality in the initial data in a subsequent reading process and a system abnormality in the electronic device is triggered, then an attempt will be made to restore the initial data based on the preset recovery strategy and abnormal record information.
[0108] It should be understood that the memory card stores a variety of data, such as documents, pictures, videos, etc. The data in the memory card can be effectively organized and managed through the file system. The file system makes data storage orderly and easy to find and manage by establishing a hierarchical structure of directories and files.
[0109] The file system in the memory card can be divided into the boot area, the file allocation table area and the data area. When writing or reading data to the memory card, the data in which area is being operated can be determined based on the logical address. The offset field is a representation of the logical address.
[0110] Among them, the boot area is the key area for storage device startup and file system loading, which contains boot code and basic file system information; the file allocation table area is used to record information about file storage locations, such as indexes for data storage; and the data area is where the file contents are actually stored.
[0111] It should also be understood that in a memory card, data in different areas have different characteristics, importance, and functions. Different preset detection strategies can be used to detect the boot area, file allocation table area, and data area, and different preset recovery strategies can be used to recover them. This can accurately handle data anomalies, thereby effectively restoring data availability and integrity.
[0112] For the initial data stored in the boot area of the memory card, that is, the first data, Figure 4 A flow chart of a data processing method in some embodiments of the present application is shown. Figure 4 As shown, the data processing method includes the following steps:
[0113] S210: Obtain first data.
[0114] The first data is data stored in a first offset field in the boot area.
[0115] There are multiple offset fields in the boot area. Different offset fields correspond to different data contents. The contents in some offset fields are one or more fixed values, and the contents in some offset fields are dynamic information related to the physical characteristics of the memory card or the file system configuration.
[0116] In this embodiment, the first data mainly refers to a plurality of fixed values, or dynamic information related to the physical characteristics of the memory card or the file system configuration.
[0117] S220: Detect the first data based on a data rule in a preset rule.
[0118] It should be understood that the first data in the boot area has a certain degree of fixity, so a preset rule is used to detect and repair abnormal first data therein.
[0119] The detection of the first data is performed through data rules in preset rules, wherein the data rules are determined based on the data type corresponding to the offset field, and through the data rules corresponding to each offset field, a data list corresponding to the data rules can be determined.
[0120] For example, when there are multiple possibilities for the data in the first offset field, the data rule is used to record the frequency of a certain data appearing in the offset field, and the generated data list is a data frequency table.
[0121] For example, the offset field w=80 in the boot area is called the file allocation table number (Number of FATs) field. The offset field is used to record the number of file allocation tables. That is, the file allocation table area is used to store the cluster information of file storage. It is like an index to determine in which clusters the various parts of the system files are stored.
[0122] It should be understood that the value of the Number of FATs field is closely related to the correct parsing and access of the FAT32 file system, and determines how to locate and access the file allocation table (FAT table) in the file system, thereby affecting the reading and writing operations of data.
[0123] The first data has several fixed values in the file system. Every time data is written to the field, the frequency of occurrence of each data is counted and analyzed to form a data rule, and the result is stored in a table, that is, a data frequency table is obtained.
[0124] For example, the offset field is written a total of 1000 times, of which 300 times the value is 1 and 700 times the value is 2. The content recorded in the data frequency table is: TF80, 1=0.3; TF80, 2=0.7; among which, TF80, 1=0.3 means that the frequency of the first offset field w=80 with a value of 1 is 0.3; TF80, 2=0.7 means that the frequency of the first offset field w=80 with a value of 2 is 0.3.
[0125] The frequency of occurrence of each value in the data frequency table can be determined by the following formula:
[0126]
[0127] Among them, TFw,x represents the frequency of occurrence of the value x at the offset field w, w represents the offset field in the memory card, and x represents the value of the offset field.
[0128] S230: If the first data does not exist in the data corresponding to the first offset field in the data list corresponding to the data rule, it is detected that the first data is abnormal.
[0129] It should be understood that if the data corresponding to the first offset field in the data rule contains the first data, the first data is detected to be normal.
[0130] For example, if during the first data reading process, the data of the offset field W=80 is obtained, and the data is 5, that is, the first data is 5. Through detection, it can be known that the data corresponding to the offset field W=80 in the data frequency table does not contain data 5, then the first data at this time is abnormal.
[0131] If the data of the offset field W=80 is obtained during the first data reading process, and the data is 2, that is, the first data is 2. Through detection, it can be known that the data corresponding to the offset field W=80 in the data frequency table contains data 2, so the first data at this time is normal.
[0132] It should be understood that the abnormal first data will also be recorded to obtain abnormal record information, so that when a system abnormality is detected later, the related data can be traced back according to the time in the abnormal record information, or the area with a higher number of abnormalities can be traced back according to the number of times in the abnormal record information to try to recover.
[0133] For example, when the first data is 5, it is detected that the first data is abnormal, and the number of abnormal times corresponding to the offset position is increased by 1 in the abnormal record information table, and the time of the abnormality and the content of the abnormal data can also be recorded.
[0134] S240: If the first data triggers a system abnormality in the electronic device, the first data is restored based on other data corresponding to the first offset field in the data list to obtain target data.
[0135] It should be understood that the system abnormality is an abnormality of the electronic device detected during the use of the first data, that is, the first data is read out to the program or algorithm that uses the first data, and an abnormality of the electronic device is detected during the use of the first data.
[0136] At this point, the memory card cannot be used any more, but you can try to recover it based on the data in the data list. For example, if the data list is a data frequency table, you can recover it based on the frequency values from high to low.
[0137] For instance, for the above example, first use the value 2 corresponding to the highest frequency 0.7 in the data frequency table as the recovery data to read out. If the electronic device can work normally at this time, the recovery is considered successful, and the 5 corresponding to the first data is restored to 2 to obtain the target data. If the electronic device still cannot work normally at this time, you can try to use the value 1 corresponding to the higher frequency 0.3 as the recovery data to read out. If the electronic device can work normally at this time, the recovery is considered successful.
[0138] The first data in the boot area of the memory card has a certain fixedness, and therefore, can be detected using a rule algorithm corresponding to a preset rule, and repaired using a recovery method corresponding to the preset rule, thereby improving the security of the data in the boot area of the memory card.
[0139] For the initial data stored in the file allocation table area in the memory card, that is, the second data, Figure 5 A flow chart of a data processing method in some embodiments of the present application is shown. Figure 5 As shown, the data processing method includes the following steps:
[0140] S310: Obtain second data.
[0141] It should be understood that the file allocation table area stores cluster numbers of fixed length. Cluster is the basic unit of file storage. When the size of a file exceeds the capacity of a cluster, multiple clusters are needed to store the file. For example, a file needs to occupy 3 clusters for storage. For example, the starting cluster number is 10. Then, in the file allocation table, the table entry corresponding to cluster number 10 will record the cluster number of the next cluster (i.e., the second cluster), such as 11; then, the table entry corresponding to cluster number 11 will record the cluster number of the third cluster, such as 12. When the value of the FAT table entry corresponding to cluster number 12 is 0x0FFFFFFF, it means that this is the last cluster of the file.
[0142] The second data is data of the second offset field stored in the file allocation table area, that is, the second offset field in the file allocation table area is used to manage and track the usage status of the cluster and the cluster chain information of the file.
[0143] It should also be understood that there is a certain relationship between the second data in the file allocation table area, and therefore, errors in the second data can be predicted and repaired through a preset statistical model.
[0144] S320: Detect the second data based on the first model in the preset model to obtain a predicted probability of a sequence corresponding to the second data.
[0145] It should be understood that the first model is a model pre-stored in the electronic device, which can be a trained model or continuously optimized by writing data. For example, the cluster numbers written are W1=6, W2=7, W3=8, ..., W10=terminator, and the first model can be optimized by the written cluster numbers.
[0146] After the second data is input into the prediction function corresponding to the first model, the second data can be output as the predicted probability of the next cluster number. The first model can be an N-gram model, a model based on the Transformer architecture, a Bayesian probability model, etc.
[0147] Taking the N-gram model as an example, the N-gram model is used to calculate the probability of a word or character appearing in a text sequence. It constructs a probability model by counting the combination frequency of words (or characters) in a large amount of text. It can output the predicted probability of the next cluster number by inputting the previous cluster number sequence; the predicted probability can be calculated by the following formula:
[0148] P(W1W2…Wn)=P(W1)P(W2|W1)…P(Wn|W1,…,Wn)
[0149] Wherein, P(W1W2…Wn) represents the predicted probability of the corresponding sequence (W1, W2, …, Wn) when the second data Wn is obtained, P(W1) represents the probability that the first one in the sequence is W1, P(W2|W1) represents the probability that the second one after W1 in the sequence is W2, and P(Wn|W1, …, Wn) represents the probability that the Nth one after the combination of W1, W2, …, Wn is W2.
[0150] For example, the second data at the second offset position in the file allocation table area is read, and the corresponding cluster number is 11. The prediction function corresponding to the N-gram model can obtain a prediction probability of 0.8 for the sequence (6, 7, 8, 9, 10, 11). For another example, the second data at the second offset position in the file allocation table area is read, and the corresponding cluster number is 5. The prediction function corresponding to the N-gram model can obtain a prediction probability of 0.1 for the sequence (6, 7, 8, 9, 10, 5).
[0151] S330: If the prediction probability of the sequence corresponding to the second data is lower than a preset first threshold, it is detected that the second data is abnormal.
[0152] The prediction probability of the sequence corresponding to the second data is judged by presetting the first threshold. If the prediction probability of the sequence corresponding to the second data is lower than the preset first threshold, it is detected that the second data is abnormal. If the prediction probability of the sequence corresponding to the second data is higher than or equal to the preset first threshold, it is detected that the second data is normal.
[0153] For the above example, the prediction function corresponding to the N-gram model can obtain the prediction probability of the sequence (6, 7, 8, 9, 10, 11) as 0.8, which is higher than the preset first threshold of 0.6, and this reading is normal; if the prediction function corresponding to the N-gram model can obtain the prediction probability of the sequence (6, 7, 8, 9, 10, 5) as 0.1, which is lower than the preset first threshold of 0.6, this detection is abnormal.
[0154] It should be understood that if the data corresponding to the second offset position is lost, the acquired second data can be considered to be 0. Similarly, the prediction probability of the second data corresponding to the first model can be output through the prediction function corresponding to the first model. For example, the probability of obtaining the sequence (6, 7, 8, 9, 10, 0) is approximately 0 through the prediction function corresponding to the N-gram model, and this detection is abnormal.
[0155] It should be understood that after detecting an anomaly, the anomaly record information is updated first, and then the second data is normally output to the program or algorithm that uses the second data.
[0156] S340: If the second data triggers a system abnormality of the electronic device, the second data is restored based on other data in the second offset field determined by the first model to obtain target data.
[0157] It should be understood that the system abnormality is an abnormality of the electronic device detected during the use of the second data.
[0158] If a system abnormality is triggered, the second data is recovered based on other data of the second offset field determined based on the first model, wherein the other data is a cluster number with a higher probability.
[0159] For example, the cluster number with a higher probability can be tried for recovery according to the model. The first model determines that the probability of the sequence (6, 7, 8, 9, 10, 11) is the highest, which is 0.8, followed by the probability of the sequence (6, 7, 8, 9, 10, end character) is 0.3. Then, the value 11 will be tried to recover the second data first, and then the end character will be used for recovery.
[0160] For the second data in the file allocation table area in the storage card, there is a certain relationship between the second data. Therefore, the first model used for probability prediction in the preset model can be used for detection, and the recovery method corresponding to the first model can be used for repair, so as to improve the reliability of the data in the file allocation table area in the storage card.
[0161] Since the initial data has many different types, such as image data, text data, audio data or video data, each type of data has its own unique characteristics, structure and processing requirements. For the initial data stored in the data area of the memory card, that is, the third data, Figure 6 A flow chart of a data processing method in some embodiments of the present application is shown. Figure 6 As shown, the data processing method includes the following steps:
[0162] S410: Obtain third data.
[0163] The third data is data stored in a third offset field in the data area.
[0164] The data area is where users actually store data. Compared with other areas, it does not have many fixed formats or lengths, but the files stored generally, such as videos, audios, pictures, and other data, have correlations or certain contextual connections.
[0165] It should be understood that when file data is written into the data area in the memory card, the data in the corresponding file allocation table area will be updated simultaneously.
[0166] S420: Detect the third data based on the second model in the preset model to obtain the predicted probability of the third data.
[0167] It should be understood that the second model is a model pre-stored in the electronic device, which may be a trained model or continuously optimized by writing data. The second model is used to learn the semantic rules of the data and perform repair.
[0168] Figure 7 The schematic diagram of the second model in some embodiments of the present application is shown, such as Figure 7 As shown, the second model can use an input layer-hidden layer-output layer model structure, by preprocessing the input data into word vectors, inputting them into the prediction function corresponding to the second model, and continuously training through deep learning to output the probability of predicting the next data.
[0169] For example, write 100 bytes of video data from offset position W to W+100, use single byte data as word vector, then train the second model with data from offset position W to W+90, and predict the probability of corresponding data appearing at offset position W+91.
[0170] For the third data, the third data is preprocessed into a word vector and input into the prediction function corresponding to the second model, and the prediction probability of the data can be output. The second model can be a language model such as an NNLM model.
[0171] Taking the NNLM model as an example, when the third data corresponding to the video data in the above example is read, if the data at the offset position W+91 is 0, the prediction probability obtained by the prediction function corresponding to the NNLM model is 0; if the data at the offset position W+91 is FF, the prediction probability obtained by the prediction function corresponding to the NNLM model is 0.8.
[0172] S430: If the predicted probability of the third data is lower than a preset second threshold, it is detected that the third data is abnormal.
[0173] The predicted probability of the third data is judged by presetting the second threshold. If the predicted probability of the third data is lower than the preset second threshold, it is detected that the third data is abnormal. If the predicted probability of the third data is higher than or equal to the preset second threshold, it is detected that the third data is normal.
[0174] For the above example, the preset second threshold is 0.6. When the third data corresponding to the video data in the above example is read, if the data at the offset position W+91 is 0, the prediction probability obtained by the prediction function corresponding to the NNLM model is 0, which is lower than the preset second threshold of 0.6, then it is detected that the third data is abnormal; if the data at the offset position W+91 is FF, the prediction probability obtained by the prediction function corresponding to the NNLM model is 0.8, which is higher than the preset second threshold of 0.6, then it is detected that the third data is normal.
[0175] It should be understood that after detecting an anomaly, the anomaly record information is updated first, and then the third data is normally output to the program or algorithm that uses the third data.
[0176] S440: If the third data triggers a system abnormality in the electronic device, the third data is restored based on other data in the third offset field determined by the second model to obtain target data.
[0177] If the third data triggers a system abnormality, the third data is restored based on other data of the third offset field determined based on the second model, wherein the other data is data that has appeared in the offset field and has a higher probability.
[0178] For the above example, when an abnormality occurs in the system, you can try to recover through other data with high probability. For example, other data that appeared in the third offset field are FF, FE, FA, and the probabilities obtained by the NNLM model are 0.8, 0.7, and 0.5. Then try to recover from the data FF with the highest probability, and read it as the value of the offset position W+91. If the electronic device is normal, the data FF is the target data. If the electronic device is still abnormal, try to recover from the data FE with a higher probability, and read it as the value of the offset position W+91.
[0179] The third data in the data area of the memory card can be detected using the second model for semantic learning in the preset model, and repaired using the recovery method corresponding to the second model, thereby improving the accuracy of the data in the data area of the memory card.
[0180] In the above areas, some initial data is fixed data, especially the data in the boot area. In order to improve the detection and recovery of such data, Figure 8 A flow chart of a data processing method in some embodiments of the present application is shown. Figure 8 As shown, in Figure 2 After obtaining the initial data in the memory card according to the steps in the above, the data processing method further comprises the following steps:
[0181] S510: If the offset field corresponding to the initial data is fixed data, the initial data is detected based on a fixed rule in a preset rule.
[0182] It should be understood that fixed rules are rules determined by feature data obtained through a preset model, and different feature data have different meanings in the subsequent data recovery process, for example, character length, fixed character data, fixed separator data, etc.
[0183] S520: When an abnormality is detected in the initial data, the initial data is restored based on a fixed rule to obtain target data.
[0184] Take the case where the initial data is fixed character data as an example. For example, the data at the offset position 0-10 in the boot area is fixed as "eXmkfs.fat". If the data corresponding to the offset position obtained during the reading process is "eYmkfs.fat", it can be known from the fixed rule that the data at the second offset position is wrong. The data "X" in the fixed rule is used to restore "Y".
[0185] Take the case where the initial data is a fixed separator, for example, the transition area between the boot area and the file allocation table area is separated by a fixed value of 0; or the separator FF is used to separate different files in the data area. If other values appear in the separation area, it is a detection anomaly, and the fixed data is restored using fixed rules.
[0186] In some embodiments, the initial data corresponding to the offset field is data of fixed length, which can also be detected and recovered by combining fixed rules and preset models.
[0187] Taking the initial data as the character length as an example, if the offset position of the data area starts at 0, it is generally the root directory data. The long file name of the root directory data is fixed to 96 bytes, the short file name is fixed to 32 bytes, and there are fixed separators at the beginning and end, such as the start character is 4334 and the end character is 0001. When the long file name is read a certain time, the length between the start character and the end character is 90 bytes, then it is a detection anomaly. When a system anomaly occurs in the electronic device during its use, it can try to fill in 6 bytes of data according to fixed rules, fill in 6 bytes 00 after the start character, or fill in 6 bytes 00 before the end character; or it can also be combined with the judgment of data errors in this area, such as judging that the offset position 10 bytes after the start character is a data parsing anomaly, data can be filled in this offset position, and the specific data filled can also be combined with the data and can be restored in combination with a preset model.
[0188] For fixed data or initial data of fixed length in the memory card, fixed rules can be used for detection, and fixed rules, or prescribed rules and preset models can be used for repair, thereby improving the security and accuracy of such data in the memory card.
[0189] It should be understood that the above Figure 4 , Figure 5 , Figure 6 and Figure 8 The method shown is divided according to the different areas and types of the initial data. It should be noted that the corresponding processes are independent of each other and do not interfere with each other. Using different methods for detection and recovery can accurately handle data anomalies, thereby effectively restoring data availability and integrity.
[0190] In some embodiments, in order to facilitate the description of the implementation of the above-mentioned data processing method, the various processes in the above-mentioned method can be reasonably divided into modules to improve the maintainability of the data processing method. Fig. 9 A schematic diagram of the software architecture in an electronic device in some embodiments of the present application is shown. Fig. 9 As shown, the software architecture in the electronic device includes a learning module, a detection module and a data usage module, and the hardware structure includes a memory card.
[0191] The data use module is a functional module for receiving, processing and utilizing data read from the memory card, and may be an application program, or a related algorithm involved in a local application in the electronic device.
[0192] The learning module is used to analyze the written data based on the preset model, and to obtain the preset rules by analyzing the written data and feature data, and to store the data list corresponding to the preset rules and the prediction function corresponding to the preset model in the detection module.
[0193] The detection module is used to analyze the initial data according to the data list corresponding to the preset rules and the prediction function corresponding to the preset model, to restore the initial data with anomalies to obtain the restored target data, and to directly output the initial data without anomalies to the data usage module.
[0194] It should be understood that the software architecture in the electronic device also includes a driver module for identifying and initializing the memory card, coordinating data transmission of the memory card, performing error handling, and providing a unified interface to facilitate the system and application programs to operate the memory card.
[0195] Fig.10 A schematic diagram of the software architecture in an electronic device in some embodiments of the present application is shown, and is described from the perspective of writing data to a memory card. Fig.10 As shown, the data use module sends the write data to the learning module, and the learning module receives the write data and stores the write data in the storage card.
[0196] Among them, the learning module also optimizes the preset model according to the received write data to obtain the optimized preset model, and analyzes the write data or the feature data obtained by the preset model to obtain the preset rules; and also stores the data list corresponding to the preset rules and the prediction function corresponding to the preset model in the detection module to facilitate the detection and recovery of the read initial data.
[0197] Taking the file system in the memory card as an example, which is divided into the boot area, the file allocation table area and the data area, for the boot area, the file allocation table area and the data area, the data lists corresponding to the preset rules are stored in the detection module respectively; the prediction function corresponding to the first model is stored in the detection module; and the prediction function corresponding to the second model is stored in the detection module.
[0198] It should be understood that in the process of storing and writing data, a process of determining a preset model and preset rules is added. The process of determining the preset model and preset rules and the process of storing the written data in the memory card are independent of each other and can be executed in parallel, and will not affect the efficiency of writing data to the memory card.
[0199] Fig.11 A schematic diagram of the software architecture in the electronic device in some embodiments of the present application is shown, and is described from the perspective of reading initial data from the memory card, such as Fig.11 As shown, the initial data to be read are obtained from the boot area, file allocation table area and data area in the memory card respectively, and then, each data is detected by the corresponding data list or prediction function in the detection module. If the initial data is detected to be abnormal, the abnormality is recorded in the abnormality recording submodule, and the initial data is output to the data use module. When it is detected that the initial data triggers a system abnormality of the electronic device, the initial data is restored based on a preset model or preset rules to obtain the target data, and the target data is output to the data use module. If it is detected that the initial data has no abnormality, the initial data is directly output.
[0200] Take the file system in the memory card as an example, which is divided into a boot area, a file allocation table area, and a data area. For the first data in the boot area, the data list corresponding to the preset rule is used for detection. If an abnormality is detected in the first data, the abnormality is recorded in the abnormality recording submodule, and the first data is output to the data use module. When it is detected that the first data triggers a system abnormality of the electronic device, the first data is restored based on the preset rule to obtain the target data, and the target data is output to the data use module. If it is detected that there is no abnormality in the first data, the first data is directly output.
[0201] It should be understood that the preset rules also include fixed rules, and the initial data is detected and restored through the data corresponding to the fixed rules.
[0202] The second data in the file allocation table area is detected by the prediction function corresponding to the first model, and if an abnormality is detected in the second data, the abnormality is recorded in the abnormality recording submodule, and the second data is output to the data use module, and when it is detected that the second data triggers a system abnormality of the electronic device, the second data is restored based on the prediction function corresponding to the first model to obtain target data, and the target data is output to the data use module. If no abnormality is detected in the second data, the second data is directly output.
[0203] The third data in the data area is detected by the prediction function corresponding to the second model, and if the third data is detected to be abnormal, the abnormality is recorded in the abnormality recording submodule, and the third data is output to the data use module, and when it is detected that the third data triggers a system abnormality of the electronic device, the third data is restored based on the prediction function corresponding to the second model to obtain the target data, and the target data is output to the data use module. If the third data is detected to be not abnormal, the third data is directly output.
[0204] By processing the data of each partition of the memory card separately, and performing detection and recovery through independent and non-interfering methods, data anomalies can be accurately handled, thereby effectively restoring the availability and integrity of the data.
[0205] It should be understood that the size of the sequence number of each process in the above embodiment does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. The various embodiments described herein can be independent schemes, or they can be combined according to internal logic, and these schemes all fall within the scope of protection of this application.
[0206] It should also be understood that the execution of each step in the flowchart in the above embodiment is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0207] The embodiment of the present application can divide the functional modules of the display device according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other feasible division methods in actual implementation. The following is an example of dividing each functional module according to each function.
[0208] Combination of the above Figures 2 to 11 , describes in detail the data processing method of the embodiment of the present application, and will be combined with Fig.12 , describes the device embodiment of the present application in detail. It should be understood that the data processing device in the embodiment of the present application can execute the various data processing methods in the aforementioned embodiment of the present application, that is, the specific working process of the following various products can refer to the corresponding process in the aforementioned method embodiment.
[0209] Fig.12 is a schematic diagram of a data processing device provided in an embodiment of the present application. It should be understood that the data processing device can execute Figures 2 to 11 The data processing method shown; Fig.12 As shown, the data processing device 600 includes a data acquiring unit 610 , a data detecting unit 620 and a data restoring unit 630 .
[0210] The data acquisition unit 610 is used to acquire initial data in the memory card, where the initial data is data that needs to be accessed.
[0211] The data detection unit 620 is used to detect the initial data based on a preset detection strategy, wherein the preset detection strategy is used to indicate that an abnormality determination operation is performed on the initial data through a preset model or preset rules.
[0212] When detecting that the initial data is abnormal, the data recovery unit 630 is used to recover the initial data based on a preset recovery strategy to obtain target data, wherein the preset recovery strategy is used to instruct to perform a recovery operation on the initial data based on a preset model or preset rules.
[0213] Each unit module of the data processing device 600 can respectively execute the corresponding steps in the above method embodiment, so each unit module will not be described in detail here. Please refer to the description of the above corresponding steps for details.
[0214] It should be noted that the above data processing device 600 is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0215] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.
[0216] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0217] like Figure 1 As shown, the electronic device 10 can be used to implement the data processing method described in the above method embodiment. The electronic device 10 may include one or more memories, on which a program is stored, and the program can be executed by the processor 11 to generate instructions, so that the processor 11 executes the data processing method described in the above method embodiment according to the instructions.
[0218] The present application also provides a computer program product, which, when executed by an electronic device, implements the data processing method of any method embodiment in the present application.
[0219] The computer program product may be stored in a memory, for example, a program, which is finally converted into an executable target file that can be executed by an electronic device after preprocessing, compiling, assembling and linking.
[0220] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the data processing method of any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.
[0221] The computer-readable storage medium is, for example, a memory. The memory may be a volatile memory or a non-volatile memory, or the memory may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.
[0222] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0223] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0224] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0225] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0226] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic; for example, the division of units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0227] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0228] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0229] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: Applied to an electronic device, the electronic device includes a memory card, and the data processing method includes: Acquire initial data in the memory card, where the initial data is data that needs to be accessed; Detecting the initial data based on a preset detection strategy, wherein the preset detection strategy is used to instruct to perform an abnormality determination operation on the initial data through a preset model or preset rules; When an abnormality is detected in the initial data, the initial data is restored based on a preset recovery strategy to obtain target data, wherein the preset recovery strategy is used to instruct to perform a recovery operation on the initial data based on the preset model or preset rule.
2. The data processing method according to claim 1, characterized in that: When the initial data is detected to be abnormal, the initial data is restored based on a preset recovery strategy to obtain target data, and further includes: When it is detected that the initial data is abnormal, the initial data is recorded to obtain abnormal record information; In the process of using the initial data, detecting whether the initial data triggers a system abnormality of the electronic device; When the initial data triggers a system abnormality of the electronic device, the initial data is restored based on a preset recovery strategy and the abnormality record information to obtain the target data.
3. The data processing method according to claim 1, characterized in that: The data processing method further includes: Receiving write data to be stored in the memory card; Inputting the written data into the preset model for feature extraction to obtain feature data; The characteristic data is analyzed to obtain the preset rules.
4. The data processing method according to any one of claims 1 to 3, characterized in that: The initial data includes first data, the memory card includes a boot area, and the boot area is used to store the first data. The data processing method further includes: Acquire the first data, where the first data is data of a first offset field stored in the boot area; Detecting the first data based on the data rule in the preset rule; If the first data does not exist in the data corresponding to the first offset field in the data list corresponding to the data rule, it is detected that the first data is abnormal; If the first data triggers a system abnormality of the electronic device, the first data is restored based on other data corresponding to the first offset field in the data list to obtain the target data.
5. The data processing method according to claim 4, characterized in that: The initial data includes second data, the memory card further includes a file allocation table area, and the file allocation table area is used to store the second data. The data processing method further includes: Acquire the second data, where the second data is data of a second offset field stored in the file allocation table area; Detecting the second data based on a first model in the preset models to obtain a predicted probability of a sequence corresponding to the second data; If the predicted probability of the sequence corresponding to the second data is lower than a preset first threshold, it is detected that the second data is abnormal; If the second data triggers a system abnormality of the electronic device, the second data is restored based on other data in the second offset field determined based on the first model to obtain the target data.
6. The data processing method according to claim 4, characterized in that: The initial data includes third data, the memory card further includes a data area, and the data area is used to store the third data. The data processing method further includes: Acquire the third data, where the third data is data of a third offset field stored in the data area; Detecting the third data based on the second model in the preset model to obtain a predicted probability of the third data; If the predicted probability of the third data is lower than a preset second threshold, it is detected that the third data is abnormal; If the third data triggers a system abnormality of the electronic device, the third data is restored based on other data of the third offset field determined based on the second model to obtain the target data.
7. The data processing method according to claim 1, characterized in that: After acquiring the initial data in the memory card, the method further includes: If the offset field corresponding to the initial data is fixed data, the detecting the initial data based on a preset detection strategy includes: Detecting the initial data based on a fixed rule in the preset rules, where the fixed rule is a rule determined by feature data obtained from the preset model; When an abnormality is detected in the initial data, the initial data is restored based on the fixed rule to obtain target data.
8. The data processing method according to any one of claims 1 to 3, characterized in that: The electronic device includes a learning module, a detection module and a data use module, and the data processing method further includes: The detection module receives the initial data; Detecting the initial data based on the preset model or the preset rule in the detection module; When the detection module detects that the initial data is abnormal, the detection module records the initial data in the abnormality recording submodule in the detection module, and outputs the initial data to the data use module; When the data usage module detects that the initial data triggers a system abnormality of the electronic device, the detection module restores the initial data based on the preset model or the preset rule to obtain the target data, and outputs the target data to the data usage module.
9. An electronic device, characterized in that: The method comprises a processor, and when the processor executes instructions, the processor performs the data processing method according to any one of claims 1 to 8.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by an electronic device, the electronic device executes the data processing method according to any one of claims 1 to 8.