CN112817911B - File system repairing method and terminal equipment - Google Patents

File system repairing method and terminal equipment Download PDF

Info

Publication number
CN112817911B
CN112817911B CN202110178834.1A CN202110178834A CN112817911B CN 112817911 B CN112817911 B CN 112817911B CN 202110178834 A CN202110178834 A CN 202110178834A CN 112817911 B CN112817911 B CN 112817911B
Authority
CN
China
Prior art keywords
file
partition
target process
file system
processor
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.)
Active
Application number
CN202110178834.1A
Other languages
Chinese (zh)
Other versions
CN112817911A (en
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.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology 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 Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN202110178834.1A priority Critical patent/CN112817911B/en
Publication of CN112817911A publication Critical patent/CN112817911A/en
Application granted granted Critical
Publication of CN112817911B publication Critical patent/CN112817911B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a file system repairing method and terminal equipment, wherein in the embodiment of the application, a first partition with an error in a file system is identified, a first file opened in the first partition is acquired, the first file is copied to a second partition, and the first partition is repaired. In the embodiment of the application, the first file of the file system of the first partition opened by the target process is copied to the file system of the second partition, the target process is controlled to open the second file copied in the file system of the second partition, and the target process is controlled to release the first file, so that the change of the opened file position of the target process is realized, when the process of opening the file of the file system of the first partition does not exist, the first file system is repaired, the file system is repaired when the operating system is occupied, the repairing efficiency of the file system is improved, and the use feeling of a user is improved.

Description

File system repairing method and terminal equipment
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a file system repair method and a terminal device.
Background
In a computer, a file system is a system that names files and places logical storage and recovery of the files. DOS, windows, OS/2, macintosh and UNIX-based operating systems all have file systems in which files are placed somewhere in a hierarchical structure, files are placed into directories (folders in Windows) or subdirectories.
However, when the operating system is running, the file system may be in error due to abnormal power failure or the like. Repairing a file system requires that the operating system execute in a special mode, or in a state in which the file system is unloaded, and that the file system's files cannot be unloaded when taken up by a process. I.e., when the operating system is running and the file system is occupied, the file system cannot be repaired.
Disclosure of Invention
The embodiment of the application provides a file system repairing method and terminal equipment, which are used for solving the problem that the file system cannot be repaired when an operating system runs and the file system is occupied in the prior art.
In a first aspect, the present application provides a file system repair method, the method including:
identifying a first partition in the file system in which an error occurred;
Acquiring a first file opened in the first partition;
copying the first file into a second partition, and repairing the first partition.
In a second aspect, the present application further provides a terminal device, including:
a file system for storing files;
a processor for performing:
identifying a first partition in the file system in which an error occurred; acquiring a first file opened in the first partition; copying the first file into a second partition, and repairing the first partition.
In a third aspect, the present application further provides an electronic device, at least comprising a processor and a memory, the processor being configured to implement the steps of any of the file system repair methods described above when executing a computer program stored in the memory.
In a fourth aspect, the present application also provides a computer readable storage medium storing a computer program which when executed by a processor implements the steps of any of the file system repair methods described above.
In the embodiment of the application, the first partition with the error in the file system is identified, the first file opened in the first partition is acquired, the first file is copied to the second partition, and the first partition is repaired. In the embodiment of the application, the first file of the file system of the first partition opened by the target process is copied to the file system of the second partition, and then the target process is controlled to open the second file copied in the file system of the second partition, so that the file position opened by the target process is controlled to change, when the process of opening the file of the file system of the first partition does not exist, the first file system is repaired, specifically, when the first partition is not occupied any more, the file system of the first partition can be unloaded, and the file system is repaired when the file system is occupied in the running state of the file system, thereby improving the repairing efficiency of the file system and improving the use feeling of a user.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a usage scenario of a display device according to an embodiment;
fig. 2 shows a block diagram of a configuration of the control apparatus 100 in accordance with an exemplary embodiment;
fig. 3 shows a hardware configuration block diagram of the display device 200 in accordance with an exemplary embodiment;
fig. 4 shows a software configuration diagram in the display device 200 according to an exemplary embodiment;
FIG. 5 illustrates an icon control interface display diagram for an application in a display device 200 according to some embodiments;
FIG. 6 illustrates a network architecture diagram of some embodiments;
FIG. 7a is an exemplary diagram of a process 1 open file provided herein;
FIG. 7b is an exemplary diagram of a process 2 open file provided herein;
FIG. 8 is a schematic diagram illustrating a file system repair process provided herein;
fig. 9 is a schematic structural diagram of a terminal device provided in the present application;
Fig. 10 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings, wherein it is apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The terms "first," second, "" third and the like in the description and in the claims and in the above-described figures are used for distinguishing between similar or similar objects or entities and not necessarily for limiting a particular order or sequence, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements explicitly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware or/and software code that is capable of performing the function associated with that element.
Fig. 1 is a schematic diagram of a usage scenario of a display device according to an embodiment. As shown in fig. 1, the display device 200 is also in data communication with a server 400, and a user can operate the display device 200 through the smart device 300 or the control apparatus 100.
In some embodiments, the control apparatus 100 may be a remote controller, and the communication between the remote controller and the display device includes at least one of infrared protocol communication or bluetooth protocol communication, and other short-range communication modes, and the display device 200 is controlled by a wireless or wired mode. The user may control the display apparatus 200 by inputting a user instruction through at least one of a key on a remote controller, a voice input, a control panel input, and the like.
In some embodiments, the smart device 300 may include any one of a mobile terminal, tablet, computer, notebook, AR/VR device, etc.
In some embodiments, the smart device 300 may also be used to control the display device 200. For example, the display device 200 is controlled using an application running on a smart device.
In some embodiments, the smart device 300 and the display device may also be used for communication of data.
In some embodiments, the display device 200 may also perform control in a manner other than the control apparatus 100 and the smart device 300, for example, the voice command control of the user may be directly received through a module configured inside the display device 200 device for acquiring voice commands, or the voice command control of the user may be received through a voice control apparatus configured outside the display device 200 device.
In some embodiments, the display device 200 is also in data communication with a server 400. The display device 200 may be permitted to make communication connections via a Local Area Network (LAN), a Wireless Local Area Network (WLAN), and other networks. The server 400 may provide various contents and interactions to the display device 200. The server 400 may be a cluster, or may be multiple clusters, and may include one or more types of servers.
In some embodiments, software steps performed by one step execution body may migrate on demand to be performed on another step execution body in data communication therewith. For example, software steps executed by the server may migrate to be executed on demand on a display device in data communication therewith, and vice versa.
Fig. 2 shows a block diagram of a configuration of the control apparatus 100 in accordance with an exemplary embodiment. As shown in fig. 2, the control device 100 includes a controller 110, a communication interface 130, a user input/output interface 140, a memory, and a power supply. The control apparatus 100 may receive an input operation instruction of a user and convert the operation instruction into an instruction recognizable and responsive to the display device 200, and function as an interaction between the user and the display device 200.
In some embodiments, the communication interface 130 is configured to communicate with the outside, including at least one of a WIFI chip, a bluetooth module, NFC, or an alternative module.
In some embodiments, the user input/output interface 140 includes at least one of a microphone, a touchpad, a sensor, keys, or an alternative module.
Fig. 3 shows a hardware configuration block diagram of the display device 200 in accordance with an exemplary embodiment.
In some embodiments, display apparatus 200 includes at least one of a modem 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, memory, a power supply, a user interface.
In some embodiments the controller comprises a central processor, a video processor, an audio processor, a graphics processor, RAM, ROM, a first interface for input/output to an nth interface.
In some embodiments, the display 260 includes a display screen component for presenting a picture, and a driving component for driving an image display, for receiving an image signal from the controller output, for displaying video content, image content, and components of a menu manipulation interface, and a user manipulation UI interface, etc.
In some embodiments, the display 260 may be at least one of a liquid crystal display, an OLED display, and a projection display, and may also be a projection device and a projection screen.
In some embodiments, the modem 210 receives broadcast television signals via wired or wireless reception and demodulates audio-video signals, such as EPG data signals, from a plurality of wireless or wired broadcast television signals.
In some embodiments, communicator 220 is a component for communicating with external devices or servers according to various communication protocol types. For example: the communicator may include at least one of a Wifi module, a bluetooth module, a wired ethernet module, or other network communication protocol chip or a near field communication protocol chip, and an infrared receiver. The display apparatus 200 may establish transmission and reception of control signals and data signals with the control device 100 or the server 400 through the communicator 220.
In some embodiments, the detector 230 is used to collect signals of the external environment or interaction with the outside. For example, detector 230 includes a light receiver, a sensor for capturing the intensity of ambient light; alternatively, the detector 230 includes an image collector such as a camera, which may be used to collect external environmental scenes, user attributes, or user interaction gestures, or alternatively, the detector 230 includes a sound collector such as a microphone, or the like, which is used to receive external sounds.
In some embodiments, the external device interface 240 may include, but is not limited to, the following: high Definition Multimedia Interface (HDMI), analog or data high definition component input interface (component), composite video input interface (CVBS), USB input interface (USB), RGB port, or the like. The input/output interface may be a composite input/output interface formed by a plurality of interfaces.
In some embodiments, the controller 250 and the modem 210 may be located in separate devices, i.e., the modem 210 may also be located in an external device to the main device in which the controller 250 is located, such as an external set-top box or the like.
In some embodiments, the controller 250 controls the operation of the display device and responds to user operations through various software control programs stored on the memory. The controller 250 controls the overall operation of the display apparatus 200. For example: in response to receiving a user command to select a UI object to be displayed on the display 260, the controller 250 may perform an operation related to the object selected by the user command.
In some embodiments, the object may be any one of selectable objects, such as a hyperlink, an icon, or other operable control. The operations related to the selected object are: displaying an operation of connecting to a hyperlink page, a document, an image, or the like, or executing an operation of a program corresponding to the icon.
In some embodiments the controller includes at least one of a central processing unit (Central Processing Unit, CPU), video processor, audio processor, graphics processor (Graphics Processing Unit, GPU), RAM Random Access Memory, RAM), ROM (Read-Only Memory, ROM), first to nth interfaces for input/output, a communication Bus (Bus), and the like.
A CPU processor. For executing operating system and application program instructions stored in the memory, and executing various application programs, data and contents according to various interactive instructions received from the outside, so as to finally display and play various audio and video contents. The CPU processor may include a plurality of processors. Such as one main processor and one or more sub-processors.
In some embodiments, a graphics processor is used to generate various graphical objects, such as: at least one of icons, operation menus, and user input instruction display graphics. The graphic processor comprises an arithmetic unit, which is used for receiving various interactive instructions input by a user to operate and displaying various objects according to display attributes; the device also comprises a renderer for rendering various objects obtained based on the arithmetic unit, wherein the rendered objects are used for being displayed on a display.
In some embodiments, the video processor is configured to receive an external video signal, perform at least one of decompression, decoding, scaling, noise reduction, frame rate conversion, resolution conversion, image composition, and the like according to a standard codec protocol of an input signal, and obtain a signal that is displayed or played on the directly displayable device 200.
In some embodiments, the video processor includes at least one of a demultiplexing module, a video decoding module, an image compositing module, a frame rate conversion module, a display formatting module, and the like. The demultiplexing module is used for demultiplexing the input audio and video data stream. And the video decoding module is used for processing the demultiplexed video signal, including decoding, scaling and the like. And an image synthesis module, such as an image synthesizer, for performing superposition mixing processing on the graphic generator and the video image after the scaling processing according to the GUI signal input by the user or generated by the graphic generator, so as to generate an image signal for display. And the frame rate conversion module is used for converting the frame rate of the input video. And the display formatting module is used for converting the received frame rate into a video output signal and changing the video output signal to be in accordance with a display format, such as outputting RGB data signals.
In some embodiments, the audio processor is configured to receive an external audio signal, decompress and decode according to a standard codec protocol of an input signal, and at least one of noise reduction, digital-to-analog conversion, and amplification, to obtain a sound signal that can be played in the speaker.
In some embodiments, a user may input a user command through a Graphical User Interface (GUI) displayed on the display 260, and the user input interface receives the user input command through the Graphical User Interface (GUI). Alternatively, the user may input the user command by inputting a specific sound or gesture, and the user input interface recognizes the sound or gesture through the sensor to receive the user input command.
In some embodiments, a "user interface" is a media interface for interaction and exchange of information between an application or operating system and a user that enables conversion between an internal form of information and a form acceptable to the user. A commonly used presentation form of the user interface is a graphical user interface (Graphic User Interface, GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It may be an interface element such as an icon, a window, a control, etc. displayed in a display screen of the electronic device, where the control may include at least one of a visual interface element such as an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, a Widget, etc.
In some embodiments, the user interface 280 is an interface (e.g., physical keys on a display device body, or the like) that may be used to receive control inputs.
In some embodiments, a system of display devices may include a Kernel (Kernel), a command parser (shell), a file system, and an application program. The kernel, shell, and file system together form the basic operating system architecture that allows users to manage files, run programs, and use the system. After power-up, the kernel is started, the kernel space is activated, hardware is abstracted, hardware parameters are initialized, virtual memory, a scheduler, signal and inter-process communication (IPC) are operated and maintained. After the kernel is started, shell and user application programs are loaded again. The application program is compiled into machine code after being started to form a process.
Referring to FIG. 4, in some embodiments, the system is divided into four layers, from top to bottom, an application layer (referred to as an "application layer"), an application framework layer (Application Framework layer) (referred to as a "framework layer"), a An Zhuoyun row (Android run) and a system library layer (referred to as a "system runtime layer"), and a kernel layer, respectively.
In some embodiments, at least one application program is running in the application program layer, and these application programs may be a Window (Window) program of an operating system, a system setting program, a clock program, or the like; or may be an application developed by a third party developer. In particular implementations, the application packages in the application layer are not limited to the above examples.
The framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. The application framework layer corresponds to a processing center that decides to let the applications in the application layer act. Through the API interface, the application program can access the resources in the system and acquire the services of the system in the execution.
As shown in fig. 4, the application framework layer in the embodiment of the present application includes a manager (manager), a Content Provider (Content Provider), and the like, where the manager includes at least one of the following modules: an Activity Manager (Activity Manager) is used to interact with all activities that are running in the system; a Location Manager (Location Manager) is used to provide system services or applications with access to system Location services; a Package Manager (Package Manager) for retrieving various information about an application Package currently installed on the device; a notification manager (Notification Manager) for controlling the display and clearing of notification messages; a Window Manager (Window Manager) is used to manage bracketing icons, windows, toolbars, wallpaper, and desktop components on the user interface.
In some embodiments, the activity manager is used to manage the lifecycle of the individual applications as well as the usual navigation rollback functions, such as controlling the exit, opening, fallback, etc. of the applications. The window manager is used for managing all window programs, such as obtaining the size of the display screen, judging whether a status bar exists or not, locking the screen, intercepting the screen, controlling the change of the display window (for example, reducing the display window to display, dithering display, distorting display, etc.), etc.
In some embodiments, the system runtime layer provides support for the upper layer, the framework layer, and when the framework layer is in use, the android operating system runs the C/C++ libraries contained in the system runtime layer to implement the functions to be implemented by the framework layer.
In some embodiments, the kernel layer is a layer between hardware and software. As shown in fig. 4, the kernel layer contains at least one of the following drivers: audio drive, display drive, bluetooth drive, camera drive, WIFI drive, USB drive, HDMI drive, sensor drive (e.g., fingerprint sensor, temperature sensor, pressure sensor, etc.), and power supply drive, etc.
In this application, the file system is operating system based system software that manages and organizes data stored on disk drives, and is a bridge of interaction between the operating system and the disk devices. The method solves the problem of how to effectively store data through management in aspects of data storage layout, space management, file naming, safety control and the like, namely, the integrity of the data is realized through a file system, namely, the consistency of the data written into a disk and the data read out later is ensured, and meanwhile, the simplification and the safety of data reading and writing are also realized.
In addition to storing and managing data stored in a file manner, the file system also stores some important information of the file and the file system itself, such as authority, size, modification date, owner, storage location, etc. of the file, which is called metadata of the file system, on a disk.
FIG. 5 illustrates an icon control interface display of an application program in the display device 200 according to some embodiments, in some embodiments, the display device may directly access an interface of a preset video-on-demand program after being started, and the interface of the video-on-demand program may include at least a navigation bar 510 and a content display area located below the navigation bar 510, as shown in FIG. 5, where the content displayed in the content display area may change according to a change of a selected control in the navigation bar. The program in the application program layer can be integrated in the video-on-demand program and displayed through one control of the navigation bar, and can be further displayed after the application control in the navigation bar is selected.
In some embodiments, the display device may also be used to display files in a file system of the display device after the display device is booted.
In order to clearly illustrate the embodiments of the present application, a network architecture provided in the embodiments of the present application is described below with reference to fig. 6.
Fig. 6 is a schematic diagram of a network architecture provided in an embodiment of the present application, where in fig. 6, an intelligent device is configured to receive input information and output a processing result of the information; the voice recognition service equipment is electronic equipment deployed with voice recognition service, the semantic service equipment is electronic equipment deployed with semantic service, and the business service equipment is electronic equipment deployed with business service. In addition, in the application, the intelligent device is also used for displaying files in the file system.
It should be noted that the architecture shown in fig. 6 is only an example, and is not intended to limit the scope of the present application. In the embodiment of the present application, other architectures may be used to implement similar functions, which are not described herein.
In the present application, if any file in the file system is opened by a process in the electronic device mentioned in fig. 1 to 6, that is, if the file system of the electronic device is occupied, the file system fails, in order to repair the occupied file system when the operating system is running, and improve the use experience of the user, the present application provides a file system repair method and a terminal device.
In the present application, the file system repairing method is applied to an electronic device deployed on a file system, where the file system is a method and a data structure for an operating system to definitely store files on a device or a partition, that is, a method for organizing files on a storage device. The software mechanism responsible for managing and storing file information in an operating system is called a file management system, which is called a file system for short. In some embodiments, the electronic device may be a television, a cell phone, or the like.
In this application, the file system repair process of the electronic device may be: when an operating system in the electronic equipment detects that an error occurs in a file system, the file system is identified, a first partition with the error occurs in the file system is identified, a process is traversed, a first file opened in the first partition is determined, a target process for opening the first file is determined, the target process is frozen, the operating system cannot schedule the target process, the first file is copied into a second partition and used as a second file of the second partition, the target process is controlled to open the second file, and the target process is controlled to release the first file. And unloading the file system after the first opened file does not exist in the first partition, and repairing the file system of the first partition.
Specifically, in the present application, a storage device such as a disk, a solid state disk, an eMMC, and the like may be divided into one or more partitions, where each partition may select whether to use a file system, and the file systems used by different partitions may be the same or different. When the operating system is running or the file system is mounted, if the first partition with the error in the file system is identified, that is, when the file system of the first partition is identified to have the error, the file system of the first partition needs to be repaired, but because processes such as application software for opening files in the first partition exist in the electronic device, if the file system of the first partition is directly repaired, the files opened by the application software are closed, and the use experience of a user is affected, therefore, in the application, after the first partition with the error in the file system is identified, the first files opened in the first partition are acquired, wherein one or more files may be opened in the first partition, and any opened file, that is, the first files are described.
After the first file opened in the first partition is obtained, the first file is copied to the second partition, and the first partition is repaired. The second partition may be located in a different storage device than the first partition, and a file system of the second partition may be the same as or different from a file system of the first partition.
In this application, the first partition and the second partition mentioned in the above embodiments may use the same file system, or may use different file systems.
In the present application, if a first partition in which an error occurs in a file system is identified, when an opened first file in the first partition is acquired, the opened first file may not exist in the first partition. I.e. there is no process in the electronic device that opens files in the first partition, the file system of the first partition may be unloaded. At this time, if the first partition is directly repaired, no influence is brought to the working process in the electronic device, and at this time, the first partition can be directly repaired.
In this application, the repair process of the first partition is in the prior art, where the process of repairing the first partition may be reconstructing a structure of a file system of the first partition, or recovering a file index data block through a log to achieve file system repair, or repairing the first partition by using a repair tool provided by the file system itself.
In the embodiment of the application, when the file system of the first partition fails, the first file of the file system of the first partition opened by the target process is copied to the file system of the second partition, and then the target process is controlled to open the second file copied in the file system of the second partition.
In the embodiment of the invention, after the first partition is identified to have errors, a first file opened in the first partition is determined, a running process in the electronic equipment is traversed, a target process for opening the first file is identified, and the target process is frozen, so that the target process is not operated any more, namely the target process is controlled to not modify the first file any more. And modifying the process state of the target process to be frozen, so that an operating system of the electronic equipment does not schedule the target process any more, and the target process is prevented from continuing to use the first file. And then determining the storage position of the first file in the first partition according to the first index of the first file recorded in the target process. Specifically, in the present application, the storage location of the first file in the first partition, the current browsed address of the first file, and the authority of the first file are recorded in the first index, where the authority of the first file includes account information of an owner of the first file and account information that can edit the first file.
After identifying the target process of opening the first file, the storage position of the first file in the first partition may be determined according to the first index of the first file recorded in the target process, and then the first file is acquired from the first partition.
In this application, after identifying the target process of opening the first file in the first partition, in order to avoid modifying the first file during copying the first file to the second partition, the target process may be frozen first, so that the operating system of the electronic device does not schedule the target process any more.
In the present application, after the first file opened in the first partition is acquired, since the current location where the first file is browsed is also stored in the first index corresponding to the first file, the current target location where the first file is browsed may be determined according to the first index.
In addition, after the first file is copied into the second partition, the file copied into the second partition is used as a second file, a second index corresponding to the second file is generated, the second index also carries the browsed target position identical to the first index, and the second index is stored in the target process.
In this application, in the application process of the electronic device, a situation that one or more processes open the same file may occur, and in particular, a situation that one or more processes open a first file may occur. And when the electronic device freezes the processes, all the processes cannot be frozen at the same time, but each process is frozen in turn, which also results in that when a first file is opened by a plurality of processes including a target process, after the target process is frozen, other processes which open the first file and are not frozen except the target process may exist to modify the content of the first file, so that the content of the first file is changed. At this time, in the present application, the operating system of the electronic device may replace the second file of the second partition with the changed first file.
In the application, after the first file is copied to the second partition, the file in the second partition is used as the second file, and meanwhile, a second index corresponding to the second file is generated, and the second index carries the storage position of the second file in the second partition. The file that allows the target process to open is no longer the first file in the first partition, but rather the second file of the second partition.
In addition, in the application, the second index also carries a target position to which the second file is browsed, wherein the target position to which the second file is browsed is the same as the browsed position of the first file recorded in the first index of the first file. The target process can be controlled to open the second file, and the target browsing position of the opened second file is the same as the browsing position of the first file, so that the target process does not need to manually adjust the browsing position after replacing the file, and the use experience of the user is improved.
Specifically, in this application, the target process may be controlled to open the second file according to the storage position of the second file in the second partition carried in the second index, and the browsing position of the second file opened by the target process may be located to the target position according to the target browsing position to which the second file carried in the second index is browsed.
In the application, after the file system repair of the first partition is completed, the target process for opening the second file is controlled to not open the second file any more, but to reopen the first file.
In order to accurately and quickly find the target process for opening the second file, in the application, after the target process is controlled to open the second file, the target process is marked. When the first partition repair is identified to be completed, the operating system of the electronic device can determine the target process for opening the second file by identifying the target process carrying the mark.
After identifying the target process with the tag, in the present application, after the target process opens the second file, the target process may not be frozen, and thus, after identifying the target process with the tag, the target process may be frozen. Specifically, in the present application, after the target process with the mark is identified, the target process with the mark is frozen, if the target process with the mark is already frozen, the operation of freezing the target process with the mark is regarded as invalid, and the target process with the mark is still in a frozen state; if the target process carrying the tag has not been successfully frozen before, it is frozen.
In the application, after the target process is frozen, the second file of the second partition is adopted to replace the first file of the first partition, and the target process with the mark is controlled to open the replaced first file in the first partition. Specifically, in this application, when repairing the file system of the first partition, the content of the first file in the first partition may be changed, for example, the first file in the first partition may be formatted, etc. Therefore, after the repair to the first partition is completed, the second file of the second partition is used to replace the first file in the first partition, and the target process carrying the mark is controlled to open the replaced first file in the first partition.
In the present application, after the target process with the flag is controlled to open the replaced first file in the first partition. Because the file system of the first partition has been repaired, and the file opened by the target process with the mark is no longer the second file of the second partition, but is the first file replaced in the first partition, at this time, the target process with the mark can be thawed, that is, the target process with the mark is awakened, so that the operation of the electronic device can continue to schedule the target process with the mark.
Among them, there are many methods for freezing a target process, and the technical means commonly used at present are generally: and the control operating system adds the target process into a frozen list, freezes the target process, and releases the target process from the frozen list if the target process needs to be thawed, namely wakes the target process. In addition, the operating system also records the state of the target process, such as running, ready, sleep capable of being interrupted, sleep incapable of being interrupted, and the like, and when the target process is frozen, the target process is not scheduled by the operating system to enter the running state.
In this application, the most common file system is a magnetic disk, and also a solid state disk. The software mechanism responsible for managing and storing file information in an operating system is called a file management system, which is called a file system for short. The file system is responsible for creating files for users, storing, reading out, modifying, dumping files, controlling access to files, withdrawing files when users are no longer using, etc. In an electronic device, one or more file systems may exist, and at the same time, a file system may be partitioned into one or more partitions. The partition of the file system can be set by a user according to the requirements of the user.
FIG. 7a is a diagram illustrating an example of a process 1 opening a file provided in the present application, in FIG. 7a, the process 1 calls a file 1 and a file 2 in an A partition, when an error is identified in the A partition of the file system, copies the file 1 and the file 2 of the A partition to a B partition, and uses the files 1 and the file 2 of the B partition as the files 1 and 2 of the B partition, and then controls the process 1 to open the files 1 and the files 2 of the B partition. In addition, in fig. 7a, the current state of the process 1 is recorded in the process state of the process 1, after the occurrence of an error in the a partition is identified, the process 1 is frozen, that is, the current state of the process 1 is adjusted to be a waiting state until the repair of the a partition is completed, and the process 1 reopens the file 1 and the file 2 in the a partition, so that the process 1 is thawed, that is, the process state of the process is adjusted to be an executing state.
FIG. 7B is an exemplary diagram of a process 2 opening a file provided in the present application, in FIG. 7B, process 2 invokes file 1 in partition B, copies file 1 of partition B to partition A as file 1 of partition A when it is identified that an error occurs in partition B of the file system, and then controls process 1 to open file 1 in partition A. In addition, in fig. 7B, the current state of the process 2 is recorded in the process state of the process 2, after recognizing that the B partition has an error, the process 2 is frozen, that is, the current state of the process 2 is adjusted to be a waiting state until the B partition repair is completed, and the process 2 reopens the file 1 in the B partition, then the process 2 is subjected to a defrosting process, that is, the process state of the process is adjusted to be an executing state.
The process of repairing a file system is described below in connection with one particular embodiment.
FIG. 8 is a schematic diagram illustrating a file system repair process provided in the present application, where, as shown in FIG. 8, the process includes:
s801: the file system is checked to identify if there is a first partition in the file system in which an error occurred.
In the application, the operating system of the electronic device checks the file system at preset time intervals to check whether there is a wrong partition in the file system.
S802: traversing the process, obtaining the opened first file in the first partition, opening the target process of the first file, and marking the target process.
S803: copying the first file into a second partition, taking the file copied into the second partition as a second file, and generating a second index corresponding to the second file according to the first index corresponding to the first file.
S804: repairing the first partition.
S805: and if the first partition repair is identified to be completed, identifying the target process carrying the mark.
S806: and replacing the first file in the first partition by adopting the second file, and controlling the target process to open the first file after the first partition is replaced.
Based on the same technical concept, the present application also provides a display device, which can implement the procedure executed by the electronic device in the foregoing embodiment. Fig. 9 is a schematic structural diagram of a terminal device provided in the present application, as shown in fig. 9, where the terminal device includes:
a file system 901 for storing files;
a processor 902 for performing:
identifying a first partition in the file system in which an error occurred; acquiring a first file opened in the first partition; copying the first file into a second partition, and repairing the first partition.
In one possible implementation, the processor 902 is configured to perform:
identifying a target process for opening the first file;
determining a storage position of the first file in the first partition according to a first index of the first file recorded in the target process;
and reading the first file according to the storage address.
In one possible implementation, the processor 902 is further configured to perform:
the target process is frozen such that the target process is no longer scheduled.
In one possible implementation, the processor 902 is further configured to perform:
determining a target position of the first file, which is currently browsed, according to the first index;
the processor 902 is further configured to perform:
and taking the file copied into the second partition as a second file, and generating a second index corresponding to the second file, wherein the second index carries the target position to which the second file is browsed.
In one possible implementation, the processor 902 is further configured to perform:
and if the content in the first file is identified to be changed, replacing the second file in the second partition by the changed first file.
In one possible implementation, the processor 902 is further configured to perform:
and controlling the target process to open the second file, and positioning the browsing position of the second file to the target position according to the second index.
In one possible implementation, the processor 902 is further configured to perform:
marking a target process for opening the second file;
the processor 902 is further configured to perform:
if the first partition is identified to be repaired, identifying a target process carrying a mark;
freezing the target process carrying the mark, and replacing a first file in the first partition by adopting the second file;
and controlling the target process carrying the mark to open the replaced first file in the first partition.
In one possible implementation, the first partition and the second partition use the same file system or use different file systems.
In one possible implementation, if the first file opened in the first partition is not obtained, the processor 902 is further configured to perform:
repairing the first partition.
Fig. 10 is a schematic structural diagram of an electronic device provided in the present application, and on the basis of the foregoing embodiments, the present application further provides an electronic device, as shown in fig. 10, including: processor 1001, communication interface 1002, memory 1003 and communication bus 1004, wherein processor 1001, communication interface 1002, memory 1003 accomplish the mutual communication through communication bus 1004;
The memory 1003 stores a computer program which, when executed by the processor 1001, causes the processor 1001 to perform the steps of:
identifying a first partition in the file system in which an error occurred;
acquiring a first file opened in the first partition;
copying the first file into a second partition, and repairing the first partition.
In one possible implementation manner, the obtaining the first file opened in the first partition includes:
identifying a target process for opening the first file;
determining a storage position of the first file in the first partition according to a first index of the first file recorded in the target process;
and reading the first file according to the storage address.
In one possible implementation manner, after the identifying the target process of opening the first file, the method further includes:
the target process is frozen such that the target process is no longer scheduled.
In one possible implementation manner, after the obtaining the first file opened in the first partition, the method further includes:
determining a target position of the first file, which is currently browsed, according to the first index;
After the copying the first file into the second partition, the method further comprises:
and taking the file copied into the second partition as a second file, and generating a second index corresponding to the second file, wherein the second index carries the target position to which the second file is browsed.
In one possible implementation, after the copying the first file into the second partition, the method further includes:
and if the content in the first file is identified to be changed, replacing the second file in the second partition by the changed first file.
In one possible embodiment, the method further comprises:
and controlling the target process to open the second file, and positioning the browsing position of the second file to the target position according to the second index.
In one possible implementation manner, after the controlling the target process to open the second file, the method further includes:
marking a target process for opening the second file;
the method further comprises the steps of:
if the first partition is identified to be repaired, identifying a target process carrying a mark;
Freezing the target process carrying the mark, and replacing a first file in the first partition by adopting the second file;
and controlling the target process carrying the mark to open the replaced first file in the first partition.
In one possible implementation, the first partition and the second partition use the same file system or use different file systems.
In one possible implementation manner, if the first file opened in the first partition is not acquired, the method further includes:
repairing the first partition.
Since the principle of solving the problem of the electronic device is similar to that of the file system repairing method, the implementation of the electronic device can be referred to the implementation of the method, and the repetition is omitted.
The communication bus mentioned above for the electronic devices may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 1002 is used for communication between the above-described electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (Digital Signal Processing, DSP), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
On the basis of the above embodiments, the present application further provides a computer readable storage medium having stored therein a computer program executable by a processor, which when run on the processor, causes the processor to perform the steps of:
identifying a first partition in the file system in which an error occurred;
acquiring a first file opened in the first partition;
Copying the first file into a second partition, and repairing the first partition.
In one possible implementation manner, the obtaining the first file opened in the first partition includes:
identifying a target process for opening the first file;
determining a storage position of the first file in the first partition according to a first index of the first file recorded in the target process;
and reading the first file according to the storage address.
In one possible implementation manner, after the identifying the target process of opening the first file, the method further includes:
the target process is frozen such that the target process is no longer scheduled.
In one possible implementation manner, after the obtaining the first file opened in the first partition, the method further includes:
determining a target position of the first file, which is currently browsed, according to the first index;
after the copying the first file into the second partition, the method further comprises:
and taking the file copied into the second partition as a second file, and generating a second index corresponding to the second file, wherein the second index carries the target position to which the second file is browsed.
In one possible implementation, after the copying the first file into the second partition, the method further includes:
and if the content in the first file is identified to be changed, replacing the second file in the second partition by the changed first file.
In one possible embodiment, the method further comprises:
and controlling the target process to open the second file, and positioning the browsing position of the second file to the target position according to the second index.
In one possible implementation manner, after the controlling the target process to open the second file, the method further includes:
marking a target process for opening the second file;
the method further comprises the steps of:
if the first partition is identified to be repaired, identifying a target process carrying a mark;
freezing the target process carrying the mark, and replacing a first file in the first partition by adopting the second file;
and controlling the target process carrying the mark to open the replaced first file in the first partition.
In one possible implementation, the first partition and the second partition use the same file system or use different file systems.
In one possible implementation manner, if the first file opened in the first partition is not acquired, the method further includes:
repairing the first partition.
Since the principle of solving the problem with the above-mentioned computer readable medium is similar to that of the file system repairing method, the steps implemented after the processor executes the computer program in the above-mentioned computer readable medium can be referred to the above-mentioned other embodiments, and the repetition is omitted.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (6)

1. A method of file system repair, the method comprising:
identifying a first partition in the file system in which an error occurred;
acquiring a first file opened in the first partition;
copying the first file into a second partition, and repairing the first partition;
wherein after copying the first file into the second partition, the method further comprises:
if the content in the first file is identified to be changed, replacing a second file in the second partition by the changed first file;
the obtaining the first file opened in the first partition includes:
identifying a target process for opening the first file;
determining a storage position of the first file in the first partition according to a first index of the first file recorded in the target process;
reading the first file according to the storage address;
after the first file opened in the first partition is obtained, the method further includes:
determining a target position of the first file, which is currently browsed, according to the first index;
after the copying the first file into the second partition, the method further comprises:
Taking the file copied to the second partition as a second file, and generating a second index corresponding to the second file, wherein the second index carries the target position to which the second file is browsed;
and controlling the target process to open the second file, and positioning the browsing position of the second file to the target position according to the second index.
2. The method of claim 1, wherein after the identifying the target process to open the first file, the method further comprises:
the target process is frozen such that the target process is no longer scheduled.
3. The method of claim 1, wherein after the controlling the target process opens the second file, the method further comprises:
marking a target process for opening the second file;
the method further comprises the steps of:
if the first partition is identified to be repaired, identifying a target process carrying a mark;
freezing the target process carrying the mark, and replacing a first file in the first partition by adopting the second file;
and controlling the target process carrying the mark to open the replaced first file in the first partition.
4. The method of claim 1, wherein the first partition and the second partition use the same file system or use different file systems.
5. The method of claim 1, wherein if the opened first file in the first partition is not obtained, the method further comprises:
repairing the first partition.
6. A terminal device, characterized in that the terminal device comprises:
a file system for storing files;
a processor for performing:
identifying a first partition in the file system in which an error occurred; acquiring a first file opened in the first partition; copying the first file into a second partition, and repairing the first partition;
wherein the processor is further configured to perform:
if the content in the first file is identified to be changed, replacing a second file in the second partition by the changed first file;
when the processor obtains the first file opened in the first partition, the processor is specifically configured to execute:
identifying a target process for opening the first file;
Determining a storage position of the first file in the first partition according to a first index of the first file recorded in the target process;
reading the first file according to the storage address;
after the processor obtains the first file opened in the first partition, the processor is further configured to perform:
determining a target position of the first file, which is currently browsed, according to the first index;
the processor, after copying the first file into the second partition, is further configured to perform:
taking the file copied to the second partition as a second file, and generating a second index corresponding to the second file, wherein the second index carries the target position to which the second file is browsed;
the processor is further configured to perform:
and controlling the target process to open the second file, and positioning the browsing position of the second file to the target position according to the second index.
CN202110178834.1A 2021-02-09 2021-02-09 File system repairing method and terminal equipment Active CN112817911B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110178834.1A CN112817911B (en) 2021-02-09 2021-02-09 File system repairing method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110178834.1A CN112817911B (en) 2021-02-09 2021-02-09 File system repairing method and terminal equipment

Publications (2)

Publication Number Publication Date
CN112817911A CN112817911A (en) 2021-05-18
CN112817911B true CN112817911B (en) 2023-07-11

Family

ID=75864758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110178834.1A Active CN112817911B (en) 2021-02-09 2021-02-09 File system repairing method and terminal equipment

Country Status (1)

Country Link
CN (1) CN112817911B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932249A (en) * 2017-05-24 2018-12-04 华为技术有限公司 A kind of method and device managing file system
CN112040340A (en) * 2020-08-25 2020-12-04 海信电子科技(深圳)有限公司 Resource file acquisition method and display device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100637932B1 (en) * 2005-05-17 2006-10-24 한국전자통신연구원 Method for unmounting of filesystem
US8712968B1 (en) * 2009-07-15 2014-04-29 Symantec Corporation Systems and methods for restoring images

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108932249A (en) * 2017-05-24 2018-12-04 华为技术有限公司 A kind of method and device managing file system
CN112040340A (en) * 2020-08-25 2020-12-04 海信电子科技(深圳)有限公司 Resource file acquisition method and display device

Also Published As

Publication number Publication date
CN112817911A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
WO2018130085A1 (en) Method and apparatus for page presentation
CN112764627B (en) Upgrade package installation progress display method and display device
CN113507646B (en) Display equipment and browser multi-label page media resource playing method
CN112612525A (en) Display device and display device starting method
CN112597110B (en) Display equipment and file display method
CN113342415B (en) Timed task execution method and display device
CN112860331B (en) Display equipment and voice interaction prompting method
CN114077584A (en) File transmission method and display device
CN112601109A (en) Audio playing method and display device
CN112817911B (en) File system repairing method and terminal equipment
CN112616090B (en) Display equipment system upgrading method and display equipment
CN113556609B (en) Display device and startup picture display method
CN113741820B (en) Method for refreshing data from memory to eMMC memory and display device
CN112749033B (en) Display device and system notification calling method
CN116340680A (en) Display equipment and control method for managing life cycle of plug-in object
CN112911381B (en) Display device, mode adjustment method, device and medium
CN112926420B (en) Display device and menu character recognition method
CN114999514A (en) Training method, device and equipment of speech enhancement model
CN112631796A (en) Display device and file copying progress display method
CN114173179A (en) Compatible execution method of system upgrading task and video recording task and display equipment
CN112668546A (en) Video thumbnail display method and display equipment
CN113286185A (en) Display device and homepage display method
CN114942902A (en) Display device and multiplexing method of memory module thereof
CN112492393A (en) Method for realizing MIC switch associated energy-saving mode and display equipment
CN112637683A (en) Display equipment system optimization method and display equipment

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
GR01 Patent grant
GR01 Patent grant