[go: up one dir, main page]

CN119847430A - Data processing method, electronic device and computer program product - Google Patents

Data processing method, electronic device and computer program product Download PDF

Info

Publication number
CN119847430A
CN119847430A CN202411906885.1A CN202411906885A CN119847430A CN 119847430 A CN119847430 A CN 119847430A CN 202411906885 A CN202411906885 A CN 202411906885A CN 119847430 A CN119847430 A CN 119847430A
Authority
CN
China
Prior art keywords
data
preset
initial
initial data
memory card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411906885.1A
Other languages
Chinese (zh)
Inventor
邵斌澄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TP Link Technologies Co Ltd
Original Assignee
TP Link Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN202411906885.1A priority Critical patent/CN119847430A/en
Publication of CN119847430A publication Critical patent/CN119847430A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/18Error detection or correction; Testing, e.g. of drop-outs
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/18Error detection or correction; Testing, e.g. of drop-outs
    • G11B20/1816Testing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

本申请提供一种数据处理方法、电子设备及计算机程序产品,涉及存储卡读写技术领域,该方法包括:对存储卡中初始数据读取的过程中,基于预设模型或预设规则对初始数据执行异常判定操作,实现对初始数据进行检测;在检测到初始数据存在异常时,基于预设模型或预设规则对初始数据执行恢复操作,得到对初始数据恢复后的目标数据;通过软件检测和恢复的方式实现对异常的初始数据进行处理,减少存储卡中数据丢失、数据错误等数据异常导致的问题,提高存储卡的安全性和可靠性。

The present application provides a data processing method, an electronic device and a computer program product, which relate to the technical field of memory card reading and writing. The method comprises: in the process of reading initial data in a memory card, performing an abnormality determination operation on the initial data based on a preset model or preset rule to detect the initial data; when an abnormality is detected in the initial data, performing a recovery operation on the initial data based on the preset model or preset rule to obtain target data after the initial data is recovered; processing the abnormal initial data by means of software detection and recovery, 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.

Description

Data processing method, electronic device and computer program product
Technical Field
The present application relates to the field of memory card reading and writing technologies, and in particular, to a data processing method, an electronic device, and a computer program product.
Background
With the continuous expansion of application scenes of the memory card, the safety and the integrity of data of the memory card are increasingly important. In the use process of the memory card, the abnormal phenomena of error, loss and the like of data in the memory card are often caused by a plurality of factors such as data transmission interruption caused by sudden power failure, data read-write disorder caused by file system damage and the like.
In the related art, the recovery of the memory card is mainly realized by taking the number of times of mounting failure of the memory card as the basis of abnormal detection of the memory card and by resetting or resetting operation. However, the situation that the memory card is successfully mounted or the memory card is reset and the data is abnormal such as data loss and data error may still occur after the memory card is reset, which affects the security and reliability of the memory card, resulting in poor user experience.
Disclosure of Invention
The application provides a data processing method, electronic equipment and a computer program product, which can detect abnormal data in the process of reading data in a memory card, and can recover the abnormal data when a system abnormality occurs, so that the problems caused by data loss, data errors and other data abnormalities in the memory card are reduced, and the safety and the reliability of the memory card are improved.
In a first aspect, a data processing method is provided, applied to an electronic device, the electronic device including a memory card, the data processing method including the steps of:
The method comprises the steps of obtaining initial data to be accessed in a memory card, detecting the initial data based on a preset detection strategy, wherein the preset detection strategy is used for indicating to execute abnormal judgment operation on the initial data based on a preset model or a preset rule, and recovering the initial data based on a preset recovery strategy to obtain target data when the condition that the initial data is abnormal is detected, and the preset recovery strategy is used for indicating to execute recovery operation on the initial data based on the preset model or the preset rule.
In the process of reading initial data in a memory card, performing an abnormality judgment operation on the initial data based on a preset model or a preset rule to realize detection of the initial data, when the abnormality of the initial data is detected, performing a recovery operation on the initial data based on the preset model or the preset rule to obtain target data after the initial data is recovered, and processing the abnormal initial data in a software detection and recovery mode to reduce the problems caused by data abnormality such as data loss and data error in the memory card and improve the safety and reliability of the memory card.
In one possible implementation manner, when the abnormality of the initial data is detected, the initial data is recovered based on a preset recovery strategy to obtain target data, and the method further comprises the steps of recording the initial data to obtain abnormal record information when the abnormality of the initial data is detected, detecting whether the initial data triggers the system abnormality of the electronic equipment or not in the process of using the initial data, and recovering the initial data based on the preset recovery strategy and the abnormal record information when the initial data triggers the system abnormality of the electronic equipment to obtain the target data.
It should be understood that some initial data in the memory card may not affect normal use of the electronic device when detecting that there is an abnormality, and some initial data may not immediately cause a system abnormality of the electronic device when detecting that there is an abnormality, but may trigger a system abnormality of the electronic device when reading other data (also belonging to the initial data) associated with the initial data at a later time, so that if the initial data is detected to be abnormal each time, the initial data is restored, which may cause a decrease in data processing efficiency of the electronic device and even affect user experience.
In order to improve the efficiency of data processing, when the abnormality of the initial data is detected and the system of the electronic equipment is triggered by the initial data, the embodiment of the application restores the initial data based on a preset restoration strategy to obtain target data.
In one possible implementation manner, the data processing method further comprises the steps of receiving write-in data to be stored in the memory card, inputting the write-in data into a preset model to perform feature extraction to obtain feature data, and analyzing the feature data to obtain preset rules.
The embodiment of the application is to add a process for determining a preset model and a preset rule during the period of storing the written data in the memory card. That is, the process of determining the preset model and the preset rule and the process of writing data to the memory card are independent of each other and can be performed in parallel. Therefore, the process of determining the preset model and the preset rule is additionally arranged, and the efficiency of writing data into the memory card is not affected.
In a possible implementation manner, the initial data comprises first data, the memory card comprises a guide area, the guide area is used for storing the first data, the data processing method further comprises the steps of obtaining the first data, the first data are data of a first offset field stored in the guide area, detecting the first data based on a data rule in a preset rule, detecting that the first data are abnormal if the first data corresponding to the first offset field in a data list corresponding to the data rule do not exist, and recovering the first data based on other data corresponding to the first offset field in the data list if the first data trigger system abnormality of the electronic equipment to obtain target data.
The first data in the guide area in the memory card has certain fixity, so that the first data can be detected by a rule algorithm corresponding to a preset rule, and the recovery method corresponding to the preset rule is used for repairing, thereby improving the safety of the data in the guide area in the memory card.
In a possible implementation manner, the initial data comprises second data, the memory card further comprises a file allocation table area, the file allocation table area is used for storing the second data, the data processing method further comprises the steps of obtaining the second data, wherein the second data are 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 the prediction probability of a corresponding sequence of the second data, detecting that the second data are abnormal if the prediction probability of the corresponding sequence of the second data is lower than a preset first threshold, and determining other data of the second offset field based on the first model to recover the second data if the second data trigger system abnormality of the electronic equipment to obtain target data.
And for the second data in the file allocation table area in the memory card, a certain relation exists among the second data, so that the first model for probability prediction in the preset model can be used for detection, and a recovery method corresponding to the first model can be used for repairing, thereby improving the reliability of the data in the file allocation table area in the memory card.
In a possible implementation manner, the initial data comprises third data, the memory card further comprises a data area, the data area is used for storing the third data, the data processing method further comprises the steps of obtaining the third data, the third data are 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 prediction probability of the third data, detecting that the third data are abnormal if the prediction probability of the third data is lower than a preset second threshold, and determining that other data of the third offset field recover the third data based on the second model to obtain target data if the third data trigger system abnormality of the electronic equipment.
And for the third data in the data area in the memory card, detecting by using a second model for semantic learning in the preset model, and repairing by using a recovery method corresponding to the second model, thereby improving the accuracy of the data in the data area in the memory card.
In one possible implementation manner, after the initial data in the memory card is obtained, the method further comprises the steps of detecting the initial data based on a fixed rule in preset rules if the offset field corresponding to the initial data is fixed data, wherein the fixed rule is a rule determined by feature data obtained through a preset model, and recovering the initial data based on the fixed rule when the abnormality of the initial data is detected, so as to obtain target data.
For fixed data or fixed length initial data in the memory card, the fixed rule can be used for detection, and the fixed rule or the rule and the preset model can be used for repairing, so that the accuracy of the data in the memory card is improved.
It should also be understood that the data recovery in the memory card is achieved by a software means, and hardware operations such as forced reset and reset are not performed on the memory card during the process, so that the security of the data in the memory card is improved.
In the above several implementation manners, the areas and types where the initial data are located are divided, and it is to be noted that, for each corresponding flow, the detection and recovery are performed by using different methods, so that the data anomaly can be accurately processed, and the availability and the integrity of the data can be effectively recovered.
In one possible implementation manner, the electronic device further comprises a learning module, a detection module and a data use module, wherein the data processing method further comprises the steps that the detection module receives initial data, detects the initial data based on a preset model or a preset rule in the detection module, records the initial data in an abnormal recording sub-module in the detection module when detecting that the initial data is abnormal, and outputs the initial data to the data use module, and when the data use module detects that the initial data triggers the system abnormality of the electronic device, the detection module restores the initial data based on the preset model or the preset rule to obtain target data and outputs the target data to the data use module.
The method is characterized in that the method comprises the steps of processing the initial data, dividing each flow in the method reasonably in a modular manner, improving maintainability of the data processing method, processing the abnormal initial data in a software detection and recovery manner, reducing problems caused by data anomalies such as data loss and data errors in a memory card, and improving safety and reliability of the memory card.
In a second aspect, there is provided a data processing apparatus comprising means for performing any of the data processing methods of the first aspect. The device can be a terminal device or a chip in the terminal device.
In a third aspect, there is provided an electronic device comprising a processor that, when executing instructions, performs any of the data processing methods of the first aspect.
In a fourth aspect, there is provided a computer-readable storage medium storing a computer program which, when executed by an electronic device, causes the electronic device to perform any one of the data processing methods of the first aspect.
In a fifth aspect, there is provided a computer program product comprising a computer program which, when run by an electronic device, causes the electronic device to perform any one of the data processing methods of the first aspect.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
FIG. 1 illustrates a frame diagram of an electronic device in some embodiments of the application;
FIG. 2 illustrates a flow chart of a method of data processing in some embodiments of the application;
FIG. 3 illustrates a flow chart of a method of data processing in some embodiments of the application;
FIG. 4 illustrates a flow chart of a method of data processing in some embodiments of the application;
FIG. 5 illustrates a flow chart of a method of data processing in some embodiments of the application;
FIG. 6 illustrates a flow chart of a method of data processing in some embodiments of the application;
FIG. 7 illustrates a schematic diagram of a second model in some embodiments of the application;
FIG. 8 illustrates a flow chart of a method of data processing in some embodiments of the application;
FIG. 9 illustrates a software architecture diagram in an electronic device in some embodiments of the application;
FIG. 10 illustrates a software architecture diagram in an electronic device in some embodiments of the application;
FIG. 11 illustrates a software architecture diagram in an electronic device in some embodiments of the application;
fig. 12 is a schematic diagram of a data processing apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. In the description of the embodiment of the present application, unless otherwise indicated, "/" means or, for example, a/B may represent a or B, and "and/or" herein is merely an association relationship describing an association object, which means that three relationships may exist, for example, a and/or B, and that three cases, i.e., a alone, a and B together, and B alone, exist. In addition, in the description of the embodiments of the present application, "plurality" means two or more than two.
The terms "first," "second," "third," and the like, are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", or a third "may explicitly or implicitly include one or more such feature.
For purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
For ease of understanding, some concepts involved in embodiments of the application are described and illustrated below:
(1) Memory card
A memory card is a physical device for storing data, which stores data through a storage medium such as a flash memory. Common memory cards include SD cards (Secure DIGITAL CARD), CF cards (Compact FLASH CARD), TF cards (Trans-FLASH CARD, also known as Micro-SD cards), and the like.
The memory card has different specifications, such as 64GB, 128GB, 256GB, 1TB, etc., and can be used for storing various files, such as photos, videos, documents, etc.
(2) File system
A file system is a logical structure used by an operating system to clarify the manner in which data is stored and organized on a memory card. It defines the naming rules, storage locations, access rights, etc. of the file. For example, common file systems are FAT32(File Allocation Table 32)、NTFS(New Technology File System)、exFAT(Extended File Allocation Table), etc.
It should be understood that the memory card itself only provides a physical space for storing data, if there is no file system, the data will be stored in the memory card randomly, and it is difficult to effectively manage and access, and the memory card can be divided into a plurality of areas by the file system, thereby an orderly memory architecture is constructed, so that the operations of accessing, reading and writing data on the memory card become convenient and efficient.
With the rapid development of digital information, a memory card is used as a data storage carrier which is indispensable to a plurality of electronic devices, and the effectiveness and reliability of data processing are directly related to the safety and integrity of stored data.
The use of the memory card is not only in various electronic devices in daily life scenes, but also in response to the need of large-scale data storage in the professional field, the memory card faces challenges from various factors such as physical environment, electric performance fluctuation, software system interaction, manual operation and the like, and the factors can lead to abnormal data conditions such as data errors, loss and the like, so that the problem of abnormal data reading is caused, and the use experience of a user is seriously influenced.
The memory card is powered off suddenly to interrupt data transmission, for example, the data is powered off in the process of writing data, the actually written data is uncontrollable, and after the memory card is powered on again, the data may have errors. The file system is damaged to cause data read-write disorder, such as data errors in a guide area, data errors and loss in a file allocation table area, and incapability of locating corresponding data area files, and video picture data errors in a data area, so that video or pictures cannot be normally used.
In the related art, the recovery of the memory card is mainly realized by taking the number of times of mounting failure of the memory card as the basis of abnormal detection of the memory card and by resetting or resetting operation.
However, after the memory card is successfully mounted or reset, abnormal data such as data loss and data error may occur, and after the memory card is reset, all data is lost, so that the security and reliability of the memory card are affected, and the user experience is poor.
In view of the above, the embodiment of the application provides a data processing method, electronic equipment and a computer program product, wherein the data processing method comprises the steps of executing an abnormality judgment operation on initial data based on a preset model or a preset rule in the process of reading the initial data in a memory card to detect the initial data, executing a recovery operation on the initial data based on the preset model or the preset rule to obtain target data after the initial data is recovered when the initial data is detected to be abnormal, and processing the abnormal initial data in a software detection and recovery mode to reduce the problems caused by data loss, data errors and other data abnormality in the memory card and improve the safety and reliability of the memory card.
In order to facilitate further understanding of the technical solutions in some embodiments of the present application, the following details of the data processing method, the technical solution of the electronic device, and how the technical solution solves the above technical problems are described in conjunction with some specific embodiments and the accompanying drawings. Embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. It will be apparent that the described embodiments are some, but not all, of the embodiments of the application.
Fig. 1 shows a frame diagram of an electronic device according to some embodiments of the present application, as shown in fig. 1, an electronic device 10 includes a memory card 12 and a processor 11, where the processor 11 is communicatively connected to the memory card 12, and the processor 11 is configured to process data written into the memory card 12 and read from the memory card 12, so as to achieve an ability to detect an abnormality of data in the memory card, and recover abnormal data when the abnormality occurs, so as to reduce problems caused by data loss, data error and other data abnormality in the memory card, and improve security and reliability of the memory card.
It should be understood that the electronic device 10 may be a digital video device, a mobile communication device, an audio/video playback device, a vehicle-mounted electronic device, or the like that requires a storage function, for example, a digital CAMERA, a motion CAMERA, a video CAMERA, a web CAMERA (IP CAMERA, abbreviated as IPC), a smart phone, a tablet computer, a vehicle recorder, or the like.
The processor 11 may be a control center of the electronic device 10, connecting various portions of the overall electronic device 10 using various interfaces and lines, performing various functions of the electronic device 10 and processing data by running or executing software programs and/or modules, and invoking data stored in the memory card 12.
The electronic device 10 comprises one or more processors 11, which one or more processors 11 may support the electronic device 10 to implement the data processing method in the method embodiments. The processor 11 may be a general purpose processor or a special purpose processor. For example, processor 11 may be a central processing unit (central processing unit, CPU), a digital signal processor (DIGITAL SIGNAL processor, DSP), an Application Specific Integrated Circuit (ASIC), a field programmable gate array (field programmable GATE ARRAY, FPGA), or other programmable logic device such as discrete gates, transistor logic, or discrete hardware components.
The processor 11 may be used to control the electronic device 10, execute software programs, and process data of the software programs.
It should also be understood that the processor 11 may also be referred to as a memory processor, only for data processing during writing and reading of data by the memory card.
The electronic device 10 may include one or more memories having a program stored thereon that is executable by the processor 11 to generate instructions such that the processor 11 performs the data processing method described in the above method embodiments according to the instructions.
The processor 11 and the memory may be provided separately or may be integrated together, for example, on a System On Chip (SOC) of the terminal device.
The memory may be used for storing a related program of the data processing method provided in the embodiment of the present application, and the processor 11 may be used for calling the related program of the data processing method stored in the memory when performing data processing on the electronic device, to execute the data processing method of the embodiment of the present application.
It should be noted that, the electronic device according to the embodiment of the present application may include more modules in the electronic device.
The following describes in detail the data processing method provided in the embodiment of the present application with reference to fig. 2 to 11.
It should be noted that, the execution main body of the touch data processing method provided by the embodiment of the present application may be the above-mentioned electronic device (such as a vehicle recorder and a camera), or may be a functional module or a functional entity capable of implementing the method in the electronic device, and the solution may be implemented by hardware and/or software, and a combination manner, and may specifically be determined according to actual use requirements, which is not limited by the embodiment of the present application.
FIG. 2 shows a flow chart of a data processing method according to some embodiments of the application, as shown in FIG. 2, the data processing method comprising the steps of:
s110, acquiring initial data in the memory card.
Wherein the initial data is the data that needs to be read.
In the use process of the electronic device, for example, a user desires to browse the photos and videos shot in the past through the application program A, uses the application program B to implement sharing or editing operation on the photos or refers to various files through the application program C, or when a specific application program is operated, the program depends on data in a memory card (such as the map navigation application program calls offline map data) and the like, all initial data stored in the memory are required to be checked and used, and corresponding data can be read from the memory card. Therefore, when initial data is read from the memory card, these initial data which need to be read are first acquired.
S120, detecting the initial data based on a preset detection strategy.
The method comprises the steps that a preset detection strategy is used for indicating that an abnormality judgment operation is performed on initial data through a preset model or a preset rule, and the abnormality judgment operation is used for detecting whether the initial data is abnormal or not;
it is to be understood that the preset model or the preset rule is preset in a targeted manner according to different types of initial data, so that various initial data can be effectively processed in an optimal manner, and application requirements of different data processing are met.
The preset model is a model stored in the electronic equipment in advance, and the preset model is built in various modes, namely, firstly, the data written in the memory card and/or a known data set can be used for training to obtain a trained model, secondly, the real-time training is carried out according to the actually written data during the use of the memory card, so that a corresponding model is generated, thirdly, the model is optimized by means of the actually written data on the basis of the trained model, and the optimized model is obtained.
The preset model can also be used for carrying out feature extraction processing on the writing data stored in the memory card to obtain feature data corresponding to the writing data, wherein the processing comprises data conversion, vectorization standardization operation and the like, and the feature data comprises character length, fixed character data, fixed separation symbol data, character occurrence frequency and the like.
The preset model may include a plurality of models, such as a first model and a second model, and these models may be neural network language models (Neural Network Language Model, NNLM), or language models N-gram in natural language processing, etc.
And, the preset rule is a rule determined by analyzing the feature data, for example, a data frequency rule, a fixed character rule, a fixed division symbol rule, and the like.
That is, when receiving the writing data to be stored in the memory card, the writing data is subjected to feature extraction according to a pre-stored preset model to obtain feature data, and the feature data is analyzed to obtain a preset rule. In some embodiments, the preset model may be further optimized by writing data to obtain an optimized preset model, and at this time, feature extraction may be performed on the written data according to the optimized preset model.
It should be clear that, in the embodiment of the present application, a process of determining a preset model and a preset rule is added during the period of storing the written data in the memory card. That is, the process of determining the preset model and the preset rule and the process of writing data to the memory card are independent of each other and can be performed in parallel. Therefore, the process of determining the preset model and the preset rule is additionally arranged, and the efficiency of writing data into the memory card is not affected.
The method comprises the steps of executing an abnormality judgment operation on initial data based on a preset model, wherein the abnormality judgment operation comprises the steps of analyzing the initial data according to the preset model to obtain the prediction probability of the initial data, if the prediction probability is within a preset threshold range, the initial data can be directly output and used, and if the prediction probability is not within the preset threshold range, the initial data is abnormal.
And executing an abnormality judgment operation on the initial data based on the preset rule, wherein the abnormality judgment operation comprises the steps of analyzing whether the initial data belongs to a data list corresponding to the preset rule, if the initial data belongs to the data list, the initial data is normal and can be directly output and used, and if the initial data does not belong to the data list, the initial data is abnormal.
S130, when the abnormality of the initial data is detected, restoring the initial data based on a preset restoration strategy to obtain target data.
The preset recovery strategy is used for indicating to execute recovery operation on the initial data based on a preset model or a preset rule.
And executing recovery operation on the initial data based on a preset model, namely sequentially attempting to recover the initial data according to the sequence from the large to the small of the known prediction probability, stopping the operation of attempting to recover after the electronic equipment operates normally, and obtaining target data after the initial data is recovered, wherein the known prediction probability meets a preset threshold range.
The method comprises the steps of firstly recovering initial data according to a preset model through data with highest probability, wherein the data with highest probability meets a preset threshold range and is data with highest probability in known prediction probability, obtaining target data after the initial data is recovered if the electronic equipment operates normally at the moment, and then attempting to recover the initial data through data with higher probability if the electronic equipment still has system abnormality at the moment, wherein the data with higher probability meets the preset threshold range and is data with lower probability than the maximum probability in the known prediction probability, such as data with second probability, data with third probability and the like.
The method comprises the steps of executing recovery operation on initial data based on preset rules, wherein the recovery operation comprises the steps of attempting to recover the initial data according to data in a data list corresponding to the preset rules, obtaining target data after the initial data recovery if the electronic equipment operates normally at the moment, and recovering through other data in the data list if the electronic equipment still has system abnormality at the moment.
It should be understood that, based on the preset rule, the recovery operation is performed on the initial data, and the recovery of the initial data may be sequentially attempted according to the order of the frequencies from the large frequency to the small frequency in the data list, and after the electronic device operates normally, the operation of attempting the recovery is stopped, and the target data after the recovery of the initial data is obtained.
In the recovery process, the data with the highest frequency in the data list may first attempt to recover the initial data, where the data with the highest frequency is the data with the highest frequency in the data list, and if the electronic device still has a system abnormality at this time, the data with the higher frequency in the data list is recovered, where the data with the higher frequency is the data with the frequency smaller than the highest frequency in the data list, for example, the data with the second frequency and the data with the third frequency.
In the process of reading the initial data in the memory card, the abnormality judgment operation is performed on the initial data based on the preset model or the preset rule to realize the detection of the initial data, when the abnormality of the initial data is detected, the system abnormality of the electronic equipment is triggered on the initial data, the recovery operation is performed on the initial data based on the preset model or the preset rule to obtain the target data after the initial data is recovered, the abnormal data is processed in a software detection and recovery mode, the problems caused by the data abnormality such as data loss and data error in the memory card are reduced, and the safety and reliability of the memory card are improved.
It should be understood that some initial data in the memory card may not affect normal use of the electronic device when detecting that there is an abnormality, and some initial data may not immediately cause system abnormality of the electronic device when detecting that there is an abnormality, but may trigger system abnormality of the electronic device when reading other data (also belonging to the initial data) associated with the initial data at a later time, so if each time the initial data is detected to have an abnormality, restoring the initial data may cause the electronic device to reduce data processing efficiency or even affect user experience, and in order to improve efficiency of data processing, in the embodiment of the application, when detecting that there is an abnormality of the initial data and triggering the system abnormality of the electronic device by the initial data, restoring the initial data based on a preset restoration policy to obtain target data.
Fig. 3 is a flowchart of a data processing method according to some embodiments of the present application, as shown in fig. 3, for step 130 in fig. 2, when an abnormality is detected in initial data, the initial data is recovered based on a preset recovery policy to obtain target data, and further includes the following steps:
And S140, when the initial data is detected to be abnormal, recording the initial data to obtain abnormal record information.
For some existing application scenarios, when the initial data is abnormal, normal use of the electronic device is not necessarily caused, for example, some offset fields in a boot area in a memory card, such as a volume_size_ Sect field, are used for recording the Volume Size of the memory card, heads fields are used for indicating the number of magnetic heads, a FAT32_version field is used for indicating version information of a file system (FAT 32), normal use of the memory card is not affected even if the initial data corresponding to the fields is abnormal, and further normal use of the electronic device is not affected, for example, some separation symbols among all areas in the file system in the memory card, such as when all data errors of 00 cause the abnormality, normal use of the memory card is not affected, and further normal use of the electronic device is not affected.
Or may not immediately cause the system abnormality of the electronic device, but trigger the system abnormality of the electronic device when other data (also belonging to the initial data) associated with the initial data is read out sometime later.
Accordingly, the abnormal initial data may be recorded to obtain abnormal recording information, and it should be understood that the abnormal recording information refers to contents formed by recording the abnormal initial data and related various data when the initial data is abnormal during the process of reading the initial data from the memory card, wherein the contents include, but are not limited to, the occurrence time of the abnormality, the occurrence times of the abnormality in different areas, and the abnormal contents (i.e., the initial data).
When the system abnormality is detected later, the associated data, namely one or more abnormal initial data, can be traced back according to the time in the abnormality record information, or the recovery can be tried according to the times in the abnormality record information, tracing back to the area with higher abnormality times.
It should also be understood that, while recording the initial data, the user may also be informed by way of a reminder that detailed information of the abnormal data exists in the memory card.
S150, detecting whether the initial data trigger system abnormality of the electronic equipment or not in the process of using the initial data.
In order to improve the efficiency of data processing, when detecting that the initial data has an abnormality, the initial data is read out, and whether the initial data triggers the system abnormality of the electronic equipment is detected.
It should be appreciated that the anomalous initial data may or may not cause a system anomaly. When the abnormal initial data does not cause the abnormal system, the reading process is continued, and the initial data read out subsequently is continuously monitored.
S160, when the initial data trigger the system of the electronic equipment to be abnormal, the initial data is restored based on a preset restoration strategy and abnormal record information, and target data is obtained.
It should be understood that the initial data triggering the system abnormality of the electronic device may be the initial data read this time or the initial data read later.
It should be further understood that, when the system abnormality of the electronic device is not triggered by the initial data, the reading process will be continued until the initial data is abnormal in the subsequent reading process, and the system abnormality of the electronic device is triggered, and the initial data is not attempted to be recovered based on the preset recovery policy and the abnormality record information.
It should be appreciated that the memory card stores a wide variety of data, such as files, pictures, videos, etc., that the data in the memory card can be effectively organized and managed through a file system that, by creating a hierarchy of directories and files, allows the data storage to be ordered, facilitating the search and management.
The file system in the memory card may be divided into a boot area, a file allocation table area, and a data area, and writing or reading data to or from the memory card is data of which area is operated according to a logical address, and the offset field is a representation of the logical address.
The guide area is a key area for starting the storage device and loading the file system and comprises guide codes and file system basic information, the file allocation table area is used for recording information of file storage positions, such as indexes of data storage, and the data area is a place for actually storing file contents.
It should also be understood that, in the memory card, the data in different areas have different characteristics, importance and functions, and the guide area, the file allocation table area and the data area can be detected by using different preset detection strategies and restored by using different preset restoration strategies respectively, so that the data abnormality can be accurately processed, and the availability and the integrity of the data can be effectively restored.
For initial data, i.e., first data, stored in a boot area in a memory card, fig. 4 shows a flowchart of a data processing method according to some embodiments of the present application, as shown in fig. 4, the data processing method includes the steps of:
S210, acquiring first data.
Wherein the first data is data of a first offset field stored in the lead-in area.
The guide area has a plurality of offset fields, the data content corresponding to different offset fields is different, the content in some offset fields is one or more fixed values, and the content in some offset fields is dynamic information related to the physical characteristics of the memory card or the file system configuration.
In this embodiment, the first data mainly refers to a plurality of fixed values or dynamic information related to physical characteristics of the memory card or file system configuration.
S220, detecting the first data based on the data rule in the preset rules.
It should be appreciated that the first data in the boot area has a certain stationarity, and thus the preset rules are used to detect and repair the first data in which the anomaly is.
The detection of the first data is performed through a data rule in preset rules, wherein the data rule is determined based on a data type corresponding to the offset field, and a data list corresponding to the data rule can be determined through the data rule corresponding to each offset field.
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 occurrence of certain data in the offset field, and the data list is generated as a data frequency table.
Illustratively, the offset field w=80 in the boot sector, referred to as the number of file allocation tables (Number of FATs) field, is used to record the number of file allocation tables, that is, the file allocation table field is used to store cluster information for file storage, which, like an index, determines in which clusters portions of the system file are stored.
It should be appreciated that the value of Number of FATs field is in close relation to properly resolving and accessing the FAT32 file system, determining how to locate and access the file allocation table (FAT table) in the file system, thereby affecting the read and write operations of the data.
The first data has several fixed values in the file system, each time when the field has data writing, the frequency of each data occurrence is counted and analyzed to form a data rule, and the result is stored in a form of a table to obtain a data frequency table.
For example, the offset field is written 1000 times in total, wherein 300 times have a value of 1,700 times have a value of 2, and the recorded contents in the data frequency table are TF80, 1=0.3, tf80, 2=0.7, wherein TF80, 1=0.3 indicates that the first offset field w=80 has a frequency of 0.3 when the value of 1 occurs, and tf80, 2=0.7 indicates that the first offset field w=80 has a frequency of 0.3 when the value of 2 occurs.
The frequency of occurrence of each numerical value in the data frequency table can be determined by the following formula:
Wherein TFw, x represents the frequency of occurrence of the value x at the offset field w, w represents the offset field offset in the memory card, and x represents the value of the offset field.
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, detecting that the first data is abnormal.
It should be understood that if the first data exists in the data corresponding to the first offset field in the data rule, the first data is detected as normal.
For example, if during the first data reading, the data of offset field w=80 is obtained, and the data is 5, i.e. the first data is 5. As a result of the detection, it is known that the first data at this time is abnormal if the data 5 does not exist in the data corresponding to the offset field w=80 in the data frequency table.
If during the first data reading, the data with offset field w=80 is obtained, and the data is 2, i.e. the first data is 2. By detection, it is known that the first data at this time is normal if there is data 2 in the data corresponding to the offset field w=80 in the data frequency table.
It should be understood that the first data of the abnormality may be recorded to obtain abnormality record information, so that when the system abnormality is detected later, the associated data may be traced back according to the time in the abnormality record information, or the recovery may be attempted by tracing back to the area with higher abnormality times according to the times in the abnormality record information.
For example, when the first data is 5, it is detected that there is an abnormality in the first data, the number of abnormalities corresponding to the offset position is increased 1 time in the abnormality record information table, and the time of the abnormality and the content of the abnormality data may also be recorded.
S240, if the first data trigger the system abnormality of the electronic device, recovering the first data based on other data corresponding to the first offset field in the data list to obtain target data.
It should be understood that a system abnormality is an abnormality of the electronic device detected during the use of the first data, that is, a program or algorithm that reads the first data to use the first data, at which point an abnormality of the electronic device is detected during the use of the first data.
At this time, the memory card cannot be used continuously, and recovery may be attempted according to the data in the data list, for example, if the data list is a data frequency list, recovery may be performed according to the value from high to low.
For example, for the above example, the value 2 corresponding to the highest frequency 0.7 in the data frequency table is read as the recovered data, if the electronic device can normally operate at this time, the recovery is considered successful, the value 5 corresponding to the first data is recovered to 2, and the target data is obtained, if the electronic device still cannot normally operate at this time, the value 1 corresponding to the higher frequency 0.3 can be sequentially tried to be used as the recovered data for reading, and if the electronic device can normally operate at this time, the recovery is considered successful.
The first data in the guide area in the memory card has certain fixity, so that the first data can be detected by a rule algorithm corresponding to a preset rule, and the recovery method corresponding to the preset rule is used for repairing, thereby improving the safety of the data in the guide area in the memory card.
For initial data, i.e., second data, stored in a file allocation table area in a memory card, fig. 5 shows a flowchart of a data processing method according to some embodiments of the present application, and as shown in fig. 5, the data processing method includes the steps of:
S310, acquiring second data.
It should be understood that the file allocation table area stores cluster numbers of a fixed length. A cluster is a basic unit of file storage, and when a file size exceeds the capacity of one cluster, it is necessary to store the file using a plurality of clusters. For example, a file needs to occupy 3 clusters for storage, for example, the initial cluster number is 10, then in the file allocation table, the entry corresponding to the cluster number 10 records the cluster number of the next cluster (i.e. the 2 nd cluster), for example, 11, then the entry corresponding to the cluster number 11 records the cluster number of the 3 rd cluster, for example, 12, and when the value of the FAT entry corresponding to the cluster number 12 is 0x0FFFFFFF, this indicates that this is the last cluster of the file.
Wherein the second data is data of a second offset field stored in the file allocation table region, that is, the second offset field in the file allocation table region is used to manage and track a usage status of a cluster and cluster chain information of a file.
It should also be appreciated that there is a relationship between the second data in the file allocation table region, so that errors in the second data can be predicted and repaired by a predetermined model with respect to statistics.
S320, detecting the second data based on a first model in the preset model to obtain the prediction probability of the second data corresponding sequence.
It should be appreciated that the first model is a model pre-stored in the electronic device, may be a model that has been trained, or may be continuously optimized by writing data. For example, the written cluster numbers are w1=6, w2=7, w3=8, and the first model can be optimized by the written cluster numbers.
After the second data is input to the prediction function corresponding to the first model, the second data can be output as the prediction probability of the occurrence of the next cluster number. The first model may be an N-gram model, a model based on a transducer architecture, a bayesian probability model, or the like.
Taking an N-gram model as an example, the N-gram model is used for calculating the occurrence probability of a word or character in a text sequence, the probability model is constructed by counting the combination frequency of words (or characters) in a large number of texts, the prediction probability of the next cluster number can be output by inputting the previous cluster number sequence, and the prediction probability can be calculated by the following formula:
P(W1W2...Wn)=P(W1)P(W2|W1)...P(Wn|W1,...,Wn)
Where P (w1w2..wn) represents the predicted probability of the corresponding sequence (W1, W2..wjn) when the second data is Wn, P (W1) represents the probability of the first one of the sequences being W1, P (w2|w1) represents the probability of the second one of the sequences being W2 after W1, and P (wn|w1..wjn) represents the probability of the nth one of the sequences being W1, W2..wjn) after the combination of Wn.
For example, the second data of the second offset position in the file allocation table area is read, the corresponding cluster number is 11, and the prediction probability of the sequence (6, 7,8,9,10, 11) can be obtained through the prediction function corresponding to the N-gram model to be 0.8. For another example, the second data of the second offset position in the file allocation table area is read, the corresponding cluster number is 5, and the prediction probability of the sequence (6,7,8,9,10,5) can be obtained through the prediction function corresponding to the N-gram model to be 0.1.
S330, if the prediction probability of the second data corresponding sequence is lower than a preset first threshold, detecting that the second data is abnormal.
Judging the prediction probability of the second data corresponding sequence through a preset first threshold value, detecting that the second data is abnormal if the prediction probability of the second data corresponding sequence is lower than the preset first threshold value, and detecting that the second data is normal if the prediction probability of the second data corresponding sequence is higher than or equal to the preset first threshold value.
For the above example, the prediction probability of the sequence (6, 7,8,9,10, 11) can be obtained by the prediction function corresponding to the N-gram model to be 0.8, which is higher than the preset first threshold value of 0.6, and the reading is normal this time, and if the prediction probability of the sequence (6,7,8,9,10,5) can be obtained by the prediction function corresponding to the N-gram model to be 0.1, which is lower than the preset first threshold value of 0.6, the abnormality is detected this time.
It should be understood that if there is a loss of the data corresponding to the second offset position, the obtained second data may be considered as 0, and the prediction probability of the occurrence of the second data may be output through the prediction function corresponding to the first model, for example, the probability that the sequence (6,7,8,9,10,0) may be obtained through the prediction function corresponding to the N-gram model is about 0, which is the detection of the anomaly this time.
It should be understood that after detecting an abnormality, the abnormality record information is updated first, and the second data is normally output to a program or algorithm using the second data.
And S340, if the second data trigger the system abnormality of the electronic equipment, determining other data of the second offset field based on the first model, and recovering the second data to obtain target data.
It should be appreciated that a system anomaly is an anomaly of the electronic device detected during use of the second data.
If the system abnormality is triggered, other data of the second offset field is determined based on the first model to restore the second data, wherein the other data is a cluster number with higher probability.
For example, the cluster number with a higher probability of model attempt may be used to recover, and the first model determines that the probability of occurrence of the sequence (6, 7,8,9,10, 11) is at most 0.8, and then the probability of occurrence of the sequence (6, 7,8,9,10, ending symbol) is 0.3, and then attempts to recover the second data with the value 11 and then recovers with the ending symbol.
And for the second data in the file allocation table area in the memory card, a certain relation exists among the second data, so that the first model for probability prediction in the preset model can be used for detection, and a recovery method corresponding to the first model can be used for repairing, thereby improving the reliability of the data in the file allocation table area in the memory card.
Since there are a number of different types of initial data, such as image data, text data, audio data or video data, etc., each type of data has its own unique characteristics, structure and processing requirements. For initial data, i.e., third data, stored in a data area of a memory card, fig. 6 shows a flowchart of a data processing method according to some embodiments of the present application, and as shown in fig. 6, the data processing method includes the steps of:
S410, acquiring third data.
Wherein the third data is data of a third offset field stored in the data area.
The data area is an area where the user actually stores data, and has no much fixed format or length compared with other areas, but generally stored files such as video, audio, pictures and the like have relevance or have certain context relevance.
It should be understood that when writing file data in a data area in a memory card, the data in the corresponding file allocation table area is updated at the same time.
And S420, detecting the third data based on a second model in the preset model to obtain the prediction probability of the third data.
It should be appreciated that the second model is a model pre-stored in the electronic device, which may be a model already trained, or may be continuously optimized by writing data. The second model is used for learning semantic rules of the data and repairing.
Fig. 7 is a schematic diagram of a second model according to some embodiments of the present application, as shown in fig. 7, where the second model may use an input layer-hidden layer-output layer model structure, and the probability of predicting the next data is output by preprocessing input data into word vectors, inputting the word vectors into a prediction function corresponding to the second model, and performing deep learning and continuous training.
For example, writing 100 bytes of video data in total from offset position W to w+100, taking single byte data as word vector, training the second model by the data from offset position W to w+90, and predicting the prediction probability of occurrence of the corresponding data from offset position w+91.
The third data is preprocessed into word vectors, and the word vectors are input to a prediction function corresponding to the second model, so that a prediction probability for predicting the third data can be output. The second model may be a language model such as NNLM model.
Taking NNLM model as an example, when the third data corresponding to the video data in the above example is read at a certain time, if the data of the offset position w+91 is 0, the prediction probability is 0 through the prediction function corresponding to the NNLM model, and if the data of the offset position w+91 is FF, the prediction probability is 0.8 through the prediction function corresponding to the NNLM model.
S430, if the prediction probability of the third data is lower than a preset second threshold, detecting that the third data is abnormal.
Judging the prediction probability of the third data through a preset second threshold value, detecting that the third data is abnormal if the prediction probability of the third data is lower than the preset second threshold value, and detecting that the third data is normal if the prediction probability of the third data is higher than or equal to the preset second threshold value.
For the above example, the second threshold is preset to be 0.6, when the third data corresponding to the video data in the above example is read for a certain time, if the data of the offset position w+91 is 0, the prediction probability obtained through the prediction function corresponding to the NNLM model is 0, and is lower than the preset second threshold by 0.6, the abnormality of the third data is detected, and if the data of the offset position w+91 is FF, the prediction probability obtained through the prediction function corresponding to the NNLM model is 0.8, and is higher than the preset second threshold by 0.6, the third data is detected to be normal.
It should be understood that after detecting an abnormality, the abnormality record information is updated first, and the third data is normally output to a program or algorithm using the third data.
S440, if the third data trigger the system abnormality of the electronic device, determining other data of the third offset field based on the second model to recover the third data, and obtaining target data.
If the third data trigger triggers a system exception, other data of the third offset field is determined based on the second model to restore the third data, wherein the other data are the data with the offset field, and the probability of the data is higher.
For the above example, when an abnormality occurs in the system, it may be attempted to recover by another data having a high probability, for example, if another data having a third offset field is FF, FE, FA, and if the probability obtained by the NNLM model is 0.8,0.7,0.5, it is attempted to recover from the data FF having the highest probability, read out as the value of offset position w+91, and if the electronic device is normal, it is the target data, and if the electronic device is still abnormal, it is attempted to recover from the data FE having a higher probability, read out as the value of offset position w+91.
And for the third data in the data area in the memory card, detecting by using a second model for semantic learning in the preset model, and repairing by using a recovery method corresponding to the second model, thereby improving the accuracy of the data in the data area in the memory card.
In the above areas, there is also some initial data that is fixed data, especially data in the boot area, and in order to improve detection and recovery of such data, fig. 8 shows a flowchart of a data processing method according to some embodiments of the present application, as shown in fig. 8, after the step in fig. 2 is performed to obtain the initial data in the memory card, the data processing method further includes the following steps:
s510, if the offset field corresponding to the initial data is fixed data, detecting the initial data based on the fixed rules in the preset rules.
It should be understood that the fixed rule is a rule determined by feature data obtained through a preset model, and different feature data have different meanings in the subsequent data recovery process, for example, a character length, fixed character data, fixed separation symbol data, and the like.
S520, when the abnormality of the initial data is detected, recovering the initial data based on the fixed rule to obtain target data.
For example, if the initial data is fixed character data, for example, the data with the offset position of the guide area being 0-10 is fixed as "exmkfs.fat", if the data corresponding to the offset position is acquired as "exmkfs.fat" in the reading process, the data error of the second offset position can be known through the fixed rule, and the data "X" in the fixed rule is used for recovering the data "Y".
For example, the transition area between the lead area and the file allocation table area is divided by a fixed value of 0, or the data area is divided by a separator FF between different files. If other values of the separation area appear, detecting abnormality, and recovering the fixed data by using the fixed rule.
In some embodiments, the initial data corresponds to data with an offset field of a fixed length, and the initial data can be detected and recovered by combining a fixed rule and a preset model.
For example, when the initial data is character length, for example, the offset position of the data area is 0, the data area is generally 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 fixed separation symbols are arranged at the beginning and the end, for example, the beginning symbol is 4334, the end symbol is 0001, when the long file name is read for a certain time, the length between the beginning symbol and the end symbol is 90 bytes, for detecting abnormality, when the electronic device is abnormal in a system in the using process, the electronic device can try to fill 6 bytes of data through fixed rules, fill 6 bytes of 00 after the beginning symbol or fill 6 bytes of 00 before the end symbol, or can also combine judgment on the error of the area data, for example, judge that the offset position 10 bytes after the beginning symbol is abnormal in data analysis, the offset position can fill data, and the filled specific data can also combine data to restore with a preset model.
For fixed data or fixed-length initial data in the memory card, the fixed rule can be used for detection, and the fixed rule or the rule and the preset model can be used for repairing, so that the safety and the accuracy of the data in the memory card are improved.
It should be understood that the methods shown in fig. 4, fig. 5, fig. 6 and fig. 8 are divided by the difference between the areas and types where the initial data are located, and it should be noted that, for each corresponding flow, the detection and recovery are performed by using different methods, which are independent of each other and do not interfere with each other, so that the data anomaly can be accurately processed, and the availability and integrity of the data can be effectively recovered.
In some embodiments, in order to facilitate description of implementation of the data processing method, each flow in the method may be split by a module reasonably, so as to improve maintainability of the data processing method. Fig. 9 is a schematic diagram of a software architecture in an electronic device according to some embodiments of the present application, where, as shown in fig. 9, 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.
The data use module is a functional module for receiving, processing and utilizing data read from the memory card, and can be an application program, a related algorithm related to local application in the electronic device, and the like.
The learning module is used for analyzing the written data based on the preset model, obtaining preset rules through analyzing the written data and the characteristic data, and storing a data list corresponding to the preset rules and a prediction function corresponding to the preset model into the detection module.
The detection module is used for analyzing the initial data according to a data list corresponding to a preset rule and a prediction function corresponding to a preset model, recovering the initial data with the abnormality to obtain recovered target data, and directly outputting the initial data without the abnormality to the data using module.
It should be appreciated that the software architecture in the electronic device also includes a driver module for identifying and initializing the memory card, coordinating data transfer of the memory card, and performing error handling and providing a unified interface to facilitate system and application operations on the memory card.
Fig. 10 is a schematic diagram of a software architecture in an electronic device according to some embodiments of the present application, where the software architecture is described in terms of storing write data in a memory card, and as shown in fig. 10, a data usage module sends write data to a learning module, and the learning module receives the write data and stores the write data in the memory card.
The learning module optimizes the preset model according to the received written data to obtain an optimized preset model, analyzes the written data or the characteristic data obtained by the preset model to obtain a preset rule, and stores a data list corresponding to the preset rule and a prediction function corresponding to the preset model in the detection module so as to be convenient for detecting and recovering the read initial data.
Taking a file system in a memory card as an example, the file system is divided into a guide area, a file allocation table area and a data area, and the guide area, the file allocation table area and the data area are respectively provided with a data list corresponding to a preset rule to be stored in a detection module, a prediction function corresponding to a first model to be stored in the detection module, and a prediction function corresponding to a second model to be stored in the detection module.
It should be appreciated that in the process of storing the written data, a flow of determining the preset model and the preset rule is added. The process of determining the preset model and the preset rule and the process of storing the writing data into the memory card are independent of each other, can be executed in parallel, and cannot affect the efficiency of writing the data into the memory card.
Fig. 11 is a schematic diagram of a software architecture in an electronic device according to some embodiments of the present application, where the initial data is read from a memory card, and as shown in fig. 11, initial data to be read is obtained from a boot area, a file allocation table area, and a data area in the memory card, and then each data is detected through a corresponding data list or a prediction function in a detection module, if an abnormality is detected in the initial data, the abnormality is recorded in an abnormality recording sub-module, and the initial data is output to a data usage module, and when a system abnormality of the electronic device is triggered by the initial data, the initial data is restored based on a preset model or a preset rule, so as to obtain target data, and the target data is output to the data usage module. If no abnormality of the initial data is detected, the initial data is directly output.
Taking a file system in a memory card as an example, the file system is divided into a boot area, a file allocation table area, and a data area. Detecting first data in the guide area through a data list corresponding to a preset rule, recording the abnormality into an abnormality recording sub-module if the abnormality of the first data is detected, outputting the first data to a data using module, recovering the first data based on the preset rule when the abnormality of a system of the electronic equipment triggered by the first data is detected, obtaining target data, and outputting the target data to the data using module. If no abnormality of the first data is detected, the first data is directly output.
It should be understood that, for the preset rule, a fixed rule is further included, and initial data is detected and recovered through data corresponding to the fixed rule.
And detecting second data in the file allocation table area through a prediction function corresponding to the first model, recording the abnormality into an abnormality recording sub-module if the abnormality of the second data is detected, outputting the second data to a data using module, recovering the second data based on the prediction function corresponding to the first model when the abnormality of the system of the electronic equipment is detected, obtaining target data, and outputting the target data to the data using module. And if no abnormality is detected in the second data, directly outputting the second data.
Detecting third data in the data area through a prediction function corresponding to the second model, recording the abnormality into an abnormality recording sub-module if the abnormality of the third data is detected, outputting the third data to a data using module, recovering the third data based on the prediction function corresponding to the second model when the abnormality of the system of the electronic equipment triggered by the third data is detected, obtaining target data, and outputting the target data to the data using module. If no abnormality of the third data is detected, the third data is directly output.
The data of each partition of the memory card is processed respectively, and the data abnormality can be processed accurately by detecting and recovering the data by mutually independent and mutually noninterfere methods, so that the availability and the integrity of the data can be recovered effectively.
It should be understood that the sequence numbers of the processes in the above embodiments do not mean the order of execution, and the order of execution of the processes should be determined by the functions and the internal logic, and should not be construed as limiting the implementation of the embodiments of the present application. The various embodiments described herein may be separate solutions or may be combined according to inherent logic, which fall within the scope of the present application.
It should also be understood that the execution of the steps in the flowcharts in the above embodiments is not strictly limited to the order in which the steps may be executed in other orders. Moreover, at least a portion of the steps in the flowcharts may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order in which the sub-steps or stages are performed is not necessarily sequential, and may be performed in turn or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
The embodiment of the application can divide the functional modules of the display device according to the above method examples, for example, each functional module can be divided corresponding to each function, or two or more functions can be integrated in one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other possible division manners may be implemented in practice. The following description will take an example of dividing each functional module into corresponding functions.
The data processing method according to the embodiment of the present application is described in detail above with reference to fig. 2 to 11, and the device embodiment of the present application will be described in detail below with reference to fig. 12. It should be understood that the data processing apparatus in the embodiments of the present application may perform the various data processing methods in the foregoing embodiments of the present application, that is, specific working procedures of the following various products may refer to corresponding procedures in the foregoing method embodiments.
Fig. 12 is a schematic diagram of a data processing apparatus according to an embodiment of the present application. It should be understood that the data processing apparatus may perform the data processing method shown in fig. 2 to 11, and that the data processing apparatus 600 includes a data acquisition unit 610, a data detection unit 620, and a data recovery unit 630 as shown in fig. 12.
The data acquisition unit 610 is configured to acquire initial data in the memory card, where the initial data is data to be accessed.
The data detection unit 620 is configured to detect the initial data based on a preset detection policy, where the preset detection policy is used to instruct that an abnormality determination operation is performed on the initial data by a preset model or a preset rule.
The data recovery unit 630 is configured to recover the initial data based on a preset recovery policy to obtain target data when detecting that the initial data is abnormal, where the preset recovery policy is used to instruct to perform a recovery operation on the initial data based on a preset model or a preset rule.
The respective unit modules of the data processing apparatus 600 may perform the corresponding steps in the above method embodiments, so that detailed descriptions of the respective unit modules are omitted herein.
The data processing apparatus 600 is embodied as a functional unit. The term "unit" herein may be implemented in software and/or hardware, without specific limitation.
For example, a "unit" may be a software program, a hardware circuit or a combination of both that implements the functions described above. The hardware circuitry may include Application Specific Integrated Circuits (ASICs), electronic circuits, processors (e.g., shared, proprietary, or group processors, etc.) and memory for executing one or more software or firmware programs, merged logic circuits, and/or other suitable components that support the described functions.
Thus, the elements of the examples described in the embodiments of the present application can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
As shown in FIG. 1, an electronic device 10 may be used to implement the data processing method described in the method embodiments described above. The electronic device 10 may include one or more memories having a program stored thereon that is executable by the processor 11 to generate instructions such that the processor 11 performs the data processing method described in the above method embodiments according to the instructions.
The application also provides a computer program product which when executed by an electronic device implements the data processing method of any of the method embodiments of the application.
The computer program product may be stored in a memory, for example, as a program that is ultimately converted into an executable object file that can be executed by an electronic device via preprocessing, compiling, assembling, and linking processes.
The application also provides a computer readable storage medium having stored thereon a computer program which when executed by a computer implements the data processing method of any of the method embodiments of the application. The computer program may be a high-level language program or an executable object program.
The computer readable storage medium is, for example, a memory. The memory may be volatile memory or nonvolatile memory, or the memory may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an erasable programmable ROM (erasable PROM), an electrically erasable programmable EPROM (EEPROM), or a flash memory.
In the present application, "at least one" means one or more, and "a plurality" means two or more. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (a, b, or c) of a, b, c, a-b, a-c, b-c, or a-b-c may be represented, wherein a, b, c may be single or plural.
It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the partitioning of elements is merely a logical functional partitioning, and there may be additional ways in which it may be actually implemented, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of 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.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The foregoing is merely illustrative embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about variations or substitutions within the technical scope of the present application, and the application should be covered. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A data processing method, characterized by being applied to an electronic device, the electronic device including a memory card, the data processing method comprising:
Acquiring initial data in the memory card, wherein the initial data is data to be accessed;
Detecting the initial data based on a preset detection strategy, wherein the preset detection strategy is used for indicating to execute an abnormality judgment operation on the initial data through a preset model or a preset rule;
And when detecting that the initial data is abnormal, recovering the initial data based on a preset recovery strategy to obtain target data, wherein the preset recovery strategy is used for indicating to execute recovery operation on the initial data based on the preset model or the preset rule.
2. The method for processing data according to claim 1, wherein when the abnormality of the initial data is detected, the initial data is restored based on a preset restoration policy to obtain target data, further comprising:
Recording the initial data when detecting that the initial data is abnormal, and obtaining abnormal record information;
detecting whether the initial data trigger system abnormality of the electronic equipment or not in the process of using the initial data;
And when the initial data trigger the system of the electronic equipment to be abnormal, recovering the initial data based on a preset recovery strategy and the abnormal record information to obtain the target data.
3. The data processing method according to claim 1, characterized in that the data processing method further comprises:
receiving write-in data which needs to be stored in the memory card;
Inputting the written data into the preset model to perform feature extraction to obtain feature data;
And analyzing the characteristic data to obtain the preset rule.
4. A data processing method according to any one of claims 1 to 3, wherein the initial data includes first data, the memory card includes a boot area for storing the first data, the data processing method further comprising:
Acquiring the first data, wherein the first data is data of a first offset field stored in the guide area;
detecting the first data based on the data rule in the preset rules;
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, detecting that the first data is abnormal;
and if the first data trigger the system abnormality of the electronic equipment, recovering the first data 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, wherein the initial data includes second data, the memory card further includes a file allocation table area for storing the second data, the data processing method further comprising:
acquiring the second data, wherein 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 model to obtain the prediction probability of the second data corresponding sequence;
If the prediction probability of the second data corresponding sequence is lower than a preset first threshold value, detecting that the second data is abnormal;
and if the second data trigger the system abnormality of the electronic equipment, determining other data of the second offset field based on the first model to recover the second data, so as to obtain the target data.
6. The data processing method according to claim 4, wherein the initial data includes third data, the memory card further includes a data area for storing the third data, the data processing method further comprising:
acquiring the third data, wherein 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 the preset model to obtain the prediction probability of the third data;
if the prediction probability of the third data is lower than a preset second threshold value, detecting that the third data is abnormal;
And if the third data trigger the system abnormality of the electronic equipment, determining other data of the third offset field based on the second model to recover the third data, so as to obtain the target data.
7. The data processing method according to claim 1, further comprising, after acquiring the initial data in the memory card:
If the offset field corresponding to the initial data is fixed data, the detecting the initial data based on the preset detection policy includes:
Detecting the initial data based on fixed rules in the preset rules, wherein the fixed rules are rules determined by the feature data obtained through the preset model;
And when detecting that the initial data has abnormality, recovering the initial data based on the fixed rule to obtain target data.
8. A data processing method according to any one of claims 1 to 3, wherein the electronic device comprises a learning module, a detection module and a data usage module, the data processing method further comprising:
the detection module receives the initial data;
Detecting the initial data based on the preset model or the preset rule in the detection module;
The detection module records the initial data in an abnormal recording sub-module in the detection module when detecting that the initial data is abnormal, and outputs the initial data to the data using module;
When the data use module detects that the initial data trigger the system abnormality of the electronic equipment, 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 use module.
9. An electronic device comprising a processor that, when executing instructions, performs the data processing method of any one of claims 1 to 8.
10. A computer program product, characterized in that the computer program product comprises a computer program which, when executed by an electronic device, causes the electronic device to perform the data processing method of any of claims 1 to 8.
CN202411906885.1A 2024-12-20 2024-12-20 Data processing method, electronic device and computer program product Pending CN119847430A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411906885.1A CN119847430A (en) 2024-12-20 2024-12-20 Data processing method, electronic device and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411906885.1A CN119847430A (en) 2024-12-20 2024-12-20 Data processing method, electronic device and computer program product

Publications (1)

Publication Number Publication Date
CN119847430A true CN119847430A (en) 2025-04-18

Family

ID=95362968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411906885.1A Pending CN119847430A (en) 2024-12-20 2024-12-20 Data processing method, electronic device and computer program product

Country Status (1)

Country Link
CN (1) CN119847430A (en)

Similar Documents

Publication Publication Date Title
US10417478B2 (en) Method for improving a fingerprint template, device and terminal thereof
US20220035655A1 (en) Method and Device for Anonymous Page Management, Terminal Device, and Readable Storage Medium
CN109683825B (en) Storage system online data compression method, device and equipment
CN111290881B (en) Data recovery method, device, equipment and storage medium
CN109800181B (en) Disk-based data writing method, data writing device and terminal equipment
CN109496292A (en) Disk management method, disk management device and electronic device
CN111813465B (en) Information acquisition method, device, medium and equipment
CN113010116B (en) Data processing method, device, terminal equipment and readable storage medium
CN107870928A (en) File reading and device
CN119440426B (en) Image data simplified storage method and storage device
CN107153453A (en) A kind of linux system reset processing method and device
EP3274839B1 (en) Technologies for root cause identification of use-after-free memory corruption bugs
US9916220B2 (en) Smart logging of trace data for storage systems
CN112068781A (en) Data reading and writing method of memory and related equipment
CN115827436A (en) Data processing method, device, equipment and storage medium
CN115719423A (en) Similarity-based malicious information detection method and device and processor
CN111258649A (en) Processors, Chips and Electronics
CN119847430A (en) Data processing method, electronic device and computer program product
CN105830067B (en) A kind of file information processing method, device and document handling apparatus, system
US8407187B2 (en) Validating files using a sliding window to access and correlate records in an arbitrarily large dataset
CN114328283B (en) Counting address acquisition method, counting method, device, equipment and storage medium
CN117251863A (en) Log data protection methods, devices, equipment and storage media
CN115827404A (en) Log generation method and device, electronic equipment and storage medium
KR102445798B1 (en) A System for Storing Multimedia Data and a method therefore
US10726870B2 (en) Timing index writes to a tape medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination