CN113412480A - Mounting processing method and device, electronic equipment and computer readable storage medium - Google Patents

Mounting processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN113412480A
CN113412480A CN201980091202.2A CN201980091202A CN113412480A CN 113412480 A CN113412480 A CN 113412480A CN 201980091202 A CN201980091202 A CN 201980091202A CN 113412480 A CN113412480 A CN 113412480A
Authority
CN
China
Prior art keywords
external storage
storage device
detection
management module
mounting
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.)
Granted
Application number
CN201980091202.2A
Other languages
Chinese (zh)
Other versions
CN113412480B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai 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 Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN113412480A publication Critical patent/CN113412480A/en
Application granted granted Critical
Publication of CN113412480B publication Critical patent/CN113412480B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the application discloses a mounting processing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of video processing. The method comprises the following steps: the storage management service module sends a first calling instruction to an external storage device management module; the external storage equipment management module responds to the first calling instruction, executes detection operation, sets a detection state identifier of the external storage equipment as a detection identifier, and returns the detection state identifier; when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module; and the storage management service module informs the external storage device management module to mount the external storage device based on the detection completion instruction. This application returns earlier before the detection operation is accomplished and detects the state sign to carry out the mount after the detection operation is accomplished, prevent that unusual external storage equipment from inserting and lead to the system card to die or decide the screen, thereby promote system stability.

Description

Mounting processing method and device, electronic equipment and computer readable storage medium Technical Field
The present application relates to the field of storage technologies, and in particular, to a mount processing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
External storage devices such as an SD card or a usb disk may be inserted into a terminal device in a card slot or an OTG manner, for example, into a mobile phone, a digital camera, a portable computer, and other terminal devices, so as to provide additional storage services to a user.
When the external Storage device is inserted into the terminal device, the terminal device may mount the external Storage device based on interaction between a Volume Daemon (Vold) and a Storage management Service (Storage Manager Service). In the interaction process, if one link is blocked, the following command cannot be processed, so that the interaction takes too long, and system abnormal conditions such as no response of the system or long-time blocking of the screen and the like easily occur.
Disclosure of Invention
The application provides a mounting processing method, a mounting processing device, an electronic device and a computer readable storage medium, so as to overcome the defects.
In a first aspect, an embodiment of the present application provides a mount processing method, where the method includes: the storage management service module sends a first calling instruction to an external storage device management module; the external storage device management module responds to the first call instruction, executes detection operation, sets a detection state identifier of the external storage device as a detection state identifier, and returns the detection state identifier, wherein the detection operation is used for detecting whether a file system of the external storage device is abnormal, and the detection state identifier is used for indicating the storage management module that the external storage device management module is executing the detection operation and is not detected; when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module; and the storage management service module informs the external storage device management module to mount the external storage device based on the detection completion instruction.
In a second aspect, an embodiment of the present application further provides a mount processing apparatus, where the apparatus includes: the first calling module is used for sending a first calling instruction to the external storage equipment management module by the storage management service module; the first returning module is used for responding to the first calling instruction by the external storage device management module, executing detection operation, setting a detection state identifier of the external storage device as a detection state identifier and returning the detection state identifier, wherein the detection operation is used for detecting whether a file system of the external storage device is abnormal, and the detection state identifier is used for indicating the storage management module that the external storage device management module is executing the detection operation and is not detected to be completed; the detection completion module is used for sending a detection completion instruction to the storage management service module when the external storage device management module finishes the detection operation; and the mounting notification module is used for notifying the external storage device management module to mount the external storage device by the storage management service module based on the detection completion instruction.
In a third aspect, an embodiment of the present application further provides an electronic device, including: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the above-described methods.
In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a program code is stored in the computer-readable storage medium, and the program code can be called by a processor to execute the method.
The mounting processing method, the mounting processing device, the electronic equipment and the computer readable storage medium provided by the application, sending a first call instruction to an external storage device management module through a storage management service module, then the external storage device management module responds to the first call instruction, executes the detection operation, sets the detection state identifier of the external storage device as the detection identifier, and returns the detection state identifier, wherein the detection operation is to detect whether the file system of the external storage device is abnormal, the flag in the detection is used to indicate the storage management module that the external storage device management module is executing the detection operation and the detection is not completed, and then, when the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module, and finally, the storage management service module informs the external storage device management module to mount the external storage device based on the detection completion instruction. Therefore, when the external storage device needs to be mounted, the external storage device management module returns the detection state identifier before the detection operation is completed, and mounting is performed after the detection operation is completed, so that the system does not have a response due to the fact that the file system of the external storage device is abnormal, the system is prevented from being blocked or fixed due to the fact that the external storage device is inserted, and the stability of the system is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart illustrating a method of a mount processing method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating a method of a mount processing method according to another embodiment of the present application;
FIG. 3 is a flowchart of a method for providing a mount processing method according to yet another embodiment of the present application;
FIG. 4 is a flowchart illustrating a method of a mount processing method according to another embodiment of the present application;
fig. 5 is a flowchart illustrating a method of a mount processing method according to still another embodiment of the present application;
fig. 6 is a flowchart illustrating a method of a mount processing method according to yet another embodiment of the present application;
FIG. 7 is a flowchart illustrating a method of a mount processing method according to yet another embodiment of the present application;
fig. 8 is a flowchart illustrating a method of a mount processing method according to still another embodiment of the present application;
fig. 9 is a flowchart illustrating a method of a mount processing method according to yet another embodiment of the present application;
fig. 10 is a flowchart illustrating a method for triggering a first call instruction according to an embodiment of the present application.
Fig. 11 shows a block diagram of a mount processing apparatus provided in an embodiment of the present application;
fig. 12 shows a block diagram of an electronic device provided in an embodiment of the present application;
fig. 13 illustrates a storage unit for storing or carrying a program code implementing a mount processing method according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Socket Communication is an Inter-Process Communication (IPC) mechanism, and in an operating system, an Application Programming Interface (API) is usually provided for an Application program, which is called a Socket API. Applications may use network sockets through a socket interface for data exchange. The operating system may decide, based on the socket address, that data should be delivered to a particular thread or thread. In Socket communication, HTTP provides a specific form of encapsulating or displaying data, and Socket provides a capability of network communication.
Binder communication is similar to Socket communication, is an efficient inter-process communication mechanism, and can realize sending data of a process A to a process B. At present, more and more terminal devices communicate based on a Binder communication mechanism, for example, a terminal device includes a Volume Daemon module (Vold) and a Storage management Service module (Storage Manager Service), and when an external Storage device, such as a memory card, a usb disk, or the like, is mounted, an interaction between the external Storage device management module and the Storage management Service module is required, where the interaction may be based on Binder communication. The terminal devices include, but are not limited to, mobile phones, digital cameras, portable computers, and other terminal devices.
However, the inventor finds that, in the process of mounting the external storage device based on Binder communication by the external storage device management module and the storage management service module, if the external storage device management module and the storage management service module are blocked in the Binder calling process, a watchdog program in the system may be triggered, so that the system does not respond, and abnormal situations such as system deadlock or screen fixation occur.
Therefore, in order to solve the above-mentioned defect, an embodiment of the present application provides a mount processing method, as shown in fig. 1, specifically, the method includes: s101 to S104.
S101: the storage management service module sends a first calling instruction to the external storage device management module.
In this embodiment, the terminal device includes an external storage device module and a storage management service module, where the external storage device management module is a management and control center of an external storage system in the operating system platform and is a background process for managing and controlling the external storage device of the operating system platform. The functions mainly comprise: the method comprises the steps of plug-in and pull-out event detection of the external storage device, mounting, uninstalling and formatting of the external storage device and the like. The storage management service module is a module for communicating a system framework layer of the operating system with an external storage device management module, and simultaneously provides an access interface of the storage device and a mounting message broadcast of the storage device for the application program. It should be noted that, the external storage device management module and the storage management service module are based on inter-process communication, and if the communication process between the external storage device management module and the storage management service module is blocked, the system may not respond.
After the external storage device is inserted into the terminal device, the terminal device needs to mount the external storage device, and after the external storage device is successfully mounted, the application program on the terminal device can access the external storage device.
In one embodiment, when the terminal device needs to mount the external storage device, the storage management service module sends a first call instruction to the external storage device management module.
S102: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
Wherein the detecting operation is to detect whether a file system of the external storage device is abnormal.
The detection-in-detection identifier is used for indicating the storage management module that the external storage device management module is executing the detection operation and is not detected completely, so that when the external storage device management module returns the detection state identifier, the storage management module is the detection-in-detection identifier based on the detection state identifier, and can know that the external storage device is detecting and is not detected completely. Specifically, after the terminal device detects an insertion event of the external storage device, the external storage device management module creates the external storage device and correspondingly stores device information of the external storage device, where the device information includes a detection status identifier.
In some embodiments, the detecting the duration includes detecting whether the file system is abnormal and detecting when the external storage device management module repairs the file system when the file system is abnormal. For example, the file system of the external storage device is damaged too much, which may cause that the time taken for the external storage device management module to attempt to repair the file system of the external storage device is too long, and the too long repair time will cause the system to be stuck.
In this embodiment, in response to the first call instruction, the external storage device management module executes the detection operation respectively, and sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier, so that the external storage device management module and the storage management service module can end without waiting for the completion of the detection operation based on the interaction process of the first call instruction, thereby avoiding system non-response due to the interaction process jam based on the first call instruction caused by an excessively long detection time, and specifically, system non-response includes system blocking or screen fixing (screen is blocked for a long time and is still, which may also be referred to as a frozen screen or a hang machine) and other system abnormal conditions, thereby preventing the system non-response caused by the insertion of an abnormal external storage device, and improving the system stability.
Specifically, for example, in response to the first call instruction, the external storage device management module may set a detection state identifier of the external storage device to be a detection identifier such as "checking", and after the external storage device management module returns "checking", the storage management service module may learn that the external storage device is detecting according to the storage state identifier of the external storage device being "checking".
S103: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
In this embodiment, when the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module to notify the storage management service module that the detection operation on the external storage device is completed, so that the storage management service module can perform the next operation.
In one embodiment, if the detection duration of the detection operation exceeds the specified time, the detection operation is ended, and at this time, the detection operation is completed, and the external storage device management module sends a detection completion instruction to the storage management service module. It should be noted that, since the external storage device management module attempts to repair the file system when the file system of the external storage device is abnormal, if the repair time is too long and the detection time consumed before the repair is successful exceeds a specified time, there is a case where the file system of the external storage device is still abnormal when the detection operation is completed. That is, when the detection operation is completed, the file system of the external storage device may be abnormal or non-abnormal. The non-abnormal condition includes that the file system is normal before detection, and may also include that the external storage device is abnormal when just inserted, but is repaired by the external storage device management module within a specified time to recover to normal.
As another embodiment, if the detection duration of the detection operation exceeds the specified time, the detection operation is not considered to be completed, that is, if the detection duration is too long and the detection operation is not completed within the specified time, the detection operation is considered to be not completed and a detection completion instruction is not sent to the storage management service module, so that the storage management service module cannot perform the next operation on the external storage device. Specifically, since the file system of the external storage device is damaged too much, the external storage device management module cannot complete the repair of the damaged file system within a specified time.
It should be noted that, because the external storage device management module completes one return in response to the first call instruction, that is, when the call thread is finished, the detection operation performed by the external storage device management module on the external storage device is not based on a thread of cross-process communication with the storage management service module, but based on a thread in an internal process of the external storage device management module, even if the detection duration is too long, the system process cannot be blocked, and no response of the system can be caused, so that system blocking or screen fixing caused by inserting an abnormal external storage device into the terminal device can be prevented, and the system stability is improved.
S104: and the storage management service module informs the external storage device management module to mount the external storage device based on the detection completion instruction.
The storage management service module can know that the detection operation is completed based on the detection completion instruction, and at the moment, informs the external storage device management module to mount the external storage device.
Therefore, compared with the prior art in which the external storage device management module returns after completing the detection operation and the mounting operation, the embodiment separates the execution of the detection operation and the mounting operation, so that the external storage device management module returns the detection state identifier before completing the detection operation to end the thread of cross-process communication with the storage management service module, and then mounts the external storage device management module after completing the detection operation.
Referring to fig. 2, a mount processing method provided in the embodiment of the present application is shown, specifically, the method includes: s201 to S207.
S201: the storage management service module sends a first calling instruction to the external storage device management module.
As an embodiment, the first call instruction includes a detection instruction, and specifically, the detection instruction may be a function Check for detecting whether the file system is abnormal or not and whether there is an error or may be another interface function for detecting whether the file system is abnormal or not, which is not limited in this embodiment. Based on the detection instruction, the detection state identifier can be set or updated. In this embodiment, the storage management service module sends the detection instruction to the external storage device management module through a Binder call. Specifically, the storage management service module calls a function Check to the external storage device management module based on Binder communication, so that the external storage device management module can execute the function Check. Therefore, cross-process calling functions can be conveniently realized based on the Binder communication.
As another embodiment, the detection instruction may be preloaded, that is, the first call instruction does not include the detection instruction, at this time, the storage management service module sends the first call instruction to the external storage device management module, so that the external storage device management module can respond to the first call instruction and execute the preloaded detection instruction, thereby reducing inter-process communication data amount, reducing function loading time, improving communication efficiency, improving detection efficiency, and further facilitating improvement of mounting efficiency on the external storage device.
S202: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
For example, if the flag bit is a detection flag such as "Checking" indicating that the external storage device management module is performing a detection operation on the external storage device and is not detecting, the storage management service module may obtain that the current detection state is performing a detection operation and is not detecting.
In this embodiment, in response to the first call instruction, the external storage device management module may perform a detection operation and set a detection status flag of the external storage device based on two different threads, respectively, and return the detection status flag. Specifically, the external storage device management module sets a detection state identifier of the external storage device as a detection-in-process identifier based on the first thread in response to the first call instruction, and returns the detection state identifier so that the first thread returns that execution is finished immediately after receiving the first call instruction, and the external storage device management module executes a detection operation based on the second thread in response to the first call instruction.
Wherein the first thread is a cross-process thread based on a Binder call, namely a main thread, and the second thread is a thread within the external storage device management module process, and thus, after receiving the first call instruction through the first thread, immediately returning to the end of execution, so that the thread called by the Binder can be timely ended, and the second thread is started to execute the actual detection operation, so that the actual detection time length and the repair time length contained in the actual detection time length do not influence the main thread, the detection operation which possibly causes the Binder calling to be blocked is executed based on the second thread, so that the first thread based on the Binder calling can be responded timely and even quickly, the system non-response caused by overlong detection time is well avoided, the abnormal conditions such as system blocking or screen fixing caused by abnormal external storage equipment insertion are prevented, and the stability of the system is greatly improved.
As an embodiment, the first process is performed before the second process, and specifically, in response to the first call instruction, the external storage device management module sets the detection state identifier as the in-detection identifier based on the first thread, returns the detection state identifier, then starts the second thread, and executes the detection operation based on the second thread.
As another embodiment, the first process and the second process are performed simultaneously, specifically, the external storage device management module responds to the first call instruction, sets the detection state identifier, starts the second thread, and executes the detection operation based on the second thread, and the detection state identifier can be immediately returned before the detection operation is completed.
The detecting operation is to detect whether the file system of the external storage device is abnormal, and to repair the abnormal file system. It should be noted that the detection operation includes an operation of repairing the abnormal file system when the abnormality is detected, so in this embodiment, the detection duration includes a repair duration. Specifically, if the file system is damaged, the file system is abnormal, and if the file system is not damaged, the file system is normal, and the external storage device management module tries to repair the abnormal file system when the file system is abnormal. Further, if the repair is completed, the file system is not damaged, and it can be considered as normal without exception.
In some embodiments, if the file system is normal or the file system is abnormal and the repair is complete, the external storage device management module determines that the detection operation is complete, and if the file system is abnormal and the repair is not complete, the file system is still in an abnormal state and the external storage device management module determines that the detection operation is not complete. Wherein:
as a way, if the file system is normal or the file system is abnormal and the repair is completed, the external storage device management module determines that the detection operation is completed; if the file system is abnormal and cannot be repaired, the external storage device management module judges that the detection operation is not finished. Thus, the detection operation is not limited in length, and when the file system is abnormal, it is determined that the detection operation is not completed. Thus, when the repair is completed, it can be determined in time that the inspection operation has been completed, so that the next operation can be performed.
As another mode, a preset time length is correspondingly set for the detection operation of the external storage device management module, and when the file system is abnormal and the repair is not completed within the preset time length, that is, the detection time length exceeds the preset time length, it is determined that the detection operation is not completed. Specifically, if the file system is detected to be normal, repair is not needed at this time, and the external storage device management module determines that the detection operation is completed; if the file system is detected to be abnormal and the repair is completed within the preset time length, the external storage device management module judges that the detection operation is completed; if the detection duration exceeds the preset duration but the repair is not completed, the external storage device management module detects that the file system is abnormal, but the damaged file system is not repaired within the preset duration, and the detection operation is determined to be not completed. Therefore, the execution time of the detection operation can be controlled, and the response can be made in time so as to carry out the next operation, thereby ensuring the detection efficiency, avoiding no response caused by overtime detection and improving the usability of the system.
In other embodiments, a preset time length is set for the detection operation of the external storage device management module, and when the file system is abnormal and the repair is not completed within the preset time length, that is, the detection time length exceeds the preset time length, it is still determined that the detection operation is completed. Specifically, if the file system is normal or the file system is abnormal and the repair is completed, the external storage device management module determines that the detection operation is completed, and if the file system is abnormal and the repair is not completed within a preset time period, the file system is still in an abnormal state, and at this time, the external storage device management module still determines that the detection operation is completed. That is, the detection operation may be performed for a preset duration at most, and when the preset duration is reached, it is determined that the detection operation is completed, where the file system may be normal or abnormal. Therefore, the execution time of the detection operation can be controlled, the detection operation is still judged to be completed when the file system is not repaired, and the response can be made in time so as to carry out the next operation, so that the detection efficiency is ensured, the detection overtime and no response are avoided, and the system usability is improved.
Further, when the detection duration exceeds the preset duration, the external storage device management module may terminate the detection operation, or may not terminate, and the specific implementation manner is as follows:
in an embodiment, when the detection duration exceeds the preset duration, the external storage device management module may terminate the detection operation, save resources, and improve system availability.
In another embodiment, when the detection duration exceeds the preset duration, the external storage device management module may not terminate the detection operation, so that the detection operation continues, specifically, when the file system is damaged too much, the external storage device management module needs to complete the repair of all abnormal file systems, the required duration is long, and the required duration may exceed the preset duration, at this time, the detection operation is not interrupted when the detection duration exceeds the preset duration, so that the external storage device management module may continue to repair, therefore, there is a possibility that the repair is completed before the mount operation is performed, and at this time, the external storage device whose detection operation is not completed still has a possibility that it can be successfully mounted. For specific implementation, reference may be made to the following embodiments, which are not described in detail herein.
Further, in this embodiment, when the detection time exceeds the preset time, S204 may be executed; when the detection time length does not exceed the preset time length, S203 may be performed.
S203: and when the detection duration exceeds the preset duration, the external storage equipment management module sets the detection state identifier as a detection abnormal identifier.
The detection state identifier further comprises a detection abnormity identifier, and the detection abnormity identifier can be used for indicating that the storage management service module detects abnormity currently, namely the detection time length exceeds the preset time length and is not repaired, and at the moment, the file system of the external storage device is still abnormal.
In this embodiment, when the detection duration exceeds the preset duration, the external storage device management module sets the detection status flag as the detection abnormality flag. Specifically, in an implementation, the detection exception identifier may be a character string such as a number, a letter, a word, and the like, and the character string is used to represent that the file system is still abnormal after the detection operation, and may be preset by the system or may be self-defined, so that the file system abnormality may be known through the detection exception identifier.
When the file system is abnormal and the repair is not completed within the preset time, the external storage device is not mounted by setting the abnormal detection identifier when the abnormal detection identifier is detected, so that unnecessary resource consumption is reduced, and the response efficiency is improved. Specific implementation manners can be seen in the following embodiments, which are not described herein again.
S204: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
In this embodiment, when the detection operation is completed, the file system of the external storage device may be normal or abnormal, where normal includes a case where the file system is normal, and a case where the file system is abnormal but the repair is completed.
As an implementation manner, if the file system is abnormal and is not repaired within the preset time length, that is, the detection time length exceeds the preset time length, it is still determined that the detection operation is completed, at this time, the detection completion instruction is sent to the storage management service module through the external storage device management module, so that the storage management service module can know that the current external storage device completes the detection operation by receiving the detection completion instruction, and can mount the file system. In this case, the file system of the external storage device may be abnormal or non-abnormal.
As another embodiment, if the file system is abnormal and the repair is not completed within the preset time length, that is, the detection time length exceeds the preset time length, it is determined that the detection operation is not completed, and at this time, the detection completion instruction is sent to the storage management service module through the external storage device management module, so that the storage management service module can know that the current external storage device is normal and mount the file system by receiving the detection completion instruction. At this time, the file system of the external storage device is non-abnormal, that is, when the file system of the external storage device is still abnormal, the detection completion instruction is not sent.
S205: and the storage management service module informs the external storage device management module to mount the external storage device based on the detection completion instruction.
In this embodiment, the storage management service module may determine that the current external storage device has completed the detection operation based on the detection completion instruction, and may mount the external storage device, and at this time, notify the external storage device management module to mount the external storage device. Therefore, the detection operation and the mounting operation are executed in different threads, and mounting is carried out only when the condition that the file system of the external storage device is normal is judged through the detection operation, so that the mounting success rate and efficiency can be improved.
S206: and when the external storage device management module mounts the external storage device, determining whether the detected abnormal identifier can be found.
In some embodiments, if the file system is abnormal and is not repaired within a preset time length, that is, the detection time length exceeds the preset time length, it is still determined that the detection operation is completed, and when the external storage device management module mounts the external storage device, it is determined whether the detection abnormal identifier can be found, specifically, for example, based on a flag bit representing a detection state, it is determined whether the detection state identifier on the flag bit is a detection abnormal identifier; for another example, it can directly search whether the corresponding external storage device stores the detection exception identifier.
In other embodiments, if the file system is abnormal and the repair is not completed within the preset time period, that is, the detection time period exceeds the preset time period, it is determined that the detection operation is not completed, then S206 to S207 are not performed after S205, at this time, the file system of the external storage device is non-abnormal, and it is not necessary to search for a detection abnormality identifier.
Further, if the detection abnormal identifier can be found, S207 may be executed; if not, the mounting operation can be continuously executed.
S207: if so, the mounting of the external storage device is stopped.
If the detected abnormal identifier can be found, the external storage device management module judges that the file system of the external storage device is abnormal, and the external storage device is stopped to be mounted, so that the consumption of running resources can be reduced, the running efficiency of the system is improved, and the mounting efficiency is improved.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
According to the mount processing method provided by the embodiment, the detection operation and the mount operation are executed in different threads, after the external storage device management module receives the first call instruction, the external storage device management module immediately returns to enable the thread called by the Binder to be timely ended, and the second thread is started to execute the actual detection operation, so that the actual detection time is long, the repair time also included in the external storage device management module does not influence the main thread, namely the detection operation possibly causing the Binder call to be blocked is executed based on the second thread, the system unresponsiveness caused by overlong detection time is avoided, the abnormal conditions such as system blocking or screen fixing and the like caused by abnormal external storage device insertion are prevented, and the stability of the system is greatly improved. In addition, whether the detection abnormal identification can be found or not is determined, so that the external storage device management device continues mounting when the file system of the external storage device is abnormal, the mounting success rate and efficiency can be improved, in addition, the external storage device management module does not mount when the file system is abnormal, unnecessary resource consumption can be reduced, and the system operation efficiency is improved.
In addition, when the detection time exceeds the preset time, the method can be ended without carrying out the next operation. Specifically, referring to fig. 3, the method includes: s301 to S303.
S301: the storage management service module sends a first calling instruction to the external storage device management module.
S302: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
S303: and when the detection duration exceeds the preset duration, the external storage equipment management module sets the detection state identifier as a detection abnormal identifier.
In this embodiment, when the detection duration exceeds the preset duration, the method is ended, so that when the file system is abnormal and the repair is not completed within the preset duration, the storage management service module is not notified to end the method, which can greatly reduce the consumption of the operation resources and improve the operation efficiency of the system.
Further, as a mode, when the detection duration exceeds the preset duration, S303 may be executed first, and then the method is ended. At this time, the external storage device management module sets the detection state identifier as the detection abnormal identifier, so that when the storage management service module obtains the detection state identifier of the external storage device, it can be known that the file system of the external storage device is in an abnormal state, and thus, a user can try to mount the file system again in time.
Alternatively, when the detection duration exceeds the preset duration, S303 may not be executed, and the method may be ended. At this time, the storage management service module considers that the external storage device is always in detection and still performs detection operation, and specifically, the detection state of the external storage device is always "Checking".
S304: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
S305: and the storage management service module informs the external storage device management module to mount the external storage device based on the detection completion instruction.
It should be noted that, the above steps are parts of detailed description, and reference may be made to the foregoing embodiments, which are not repeated herein.
On the basis of the foregoing embodiment, by ending the method when the detection duration exceeds the preset duration, the mount processing method provided in this embodiment can greatly reduce consumption of operating resources, improve operating efficiency, and enable the user to retry mounting by reinserting the external storage device or by other measures, thereby improving user mount experience.
Referring to fig. 4, a mount processing method provided in the embodiment of the present application is shown, specifically, the method includes: s401 to S404.
S401: the storage management service module sends a first calling instruction to the external storage device management module.
S402: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
S403: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
The above embodiments of S401 to S403 refer to the foregoing embodiments, and are not described herein again.
S404: and the storage management service module responds to the detection completion instruction and sends a second calling instruction to the external storage device management module.
The second call instruction is used for informing the external storage device management module to mount the external storage device.
As an embodiment, in response to the detection completion instruction, the storage management service module sends a Mount instruction to the external storage device management module through a Binder call, where the second call instruction includes the Mount instruction, for example, the Mount instruction may be a function Mount for mounting the external storage device, or may be another interface function for mounting the external storage device, which is not limited in this embodiment. Specifically, the storage management service module calls a function Mount to the external storage device management module based on Binder communication, so that the external storage device management module can execute the function Mount and perform Mount operation.
As another embodiment, the mount instruction may be preloaded, that is, the second call instruction does not include the mount instruction, at this time, the storage management service module sends the second call instruction to the external storage device management module, so that the external storage device management module may execute the preloaded mount instruction in response to the second call instruction, reduce the amount of inter-process communication data, reduce function loading time, and improve communication efficiency and mount efficiency at the same time.
Referring to fig. 5, a mount processing method provided in the embodiment of the present application is shown, specifically, the method includes: s501 to S507.
S501: the storage management service module sends a first calling instruction to the external storage device management module.
S502: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
S503: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
S504: and the storage management service module responds to the detection completion instruction and sends a second calling instruction to the external storage device management module.
S505: and the external storage device management module responds to the second call instruction and judges whether the file system of the external storage device is abnormal or not according to the detection state identifier.
In this embodiment, the external storage device management module, in response to the second call instruction, determines whether the file system of the external storage device is abnormal according to the detection status identifier corresponding to the external storage device. Specifically, if the current detection status flag is a detection abnormality flag, the file system of the external storage device is abnormal, otherwise, the file system is normal.
In this embodiment, after S505, if not abnormal, S506 may be executed; if so, S508 may be performed.
S506: and the external storage device management module acquires the mounting result.
If the external storage device management module is not abnormal, the external storage device management module detects that the file system of the external storage device is not abnormal, and the external storage device management module executes mounting operation on the external storage device to obtain a mounting result. Specifically, the external storage device management module executes Mount operation on the external storage device by executing a Mount function Mount based on a Mount instruction, such as a Mount function Mount, to obtain a Mount result. Wherein the mounting result comprises mounting success and mounting failure.
S507: and the external storage equipment management module sets a mounting state identifier according to the mounting result.
Specifically, the mount state identifier may be a flag bit used for representing the mount state, for example, if the mount state identifier is "unmount table", it represents that the external storage device cannot be mounted, and if the mount state identifier is "mounted", it represents that the external storage device is mounted. It should be noted that, as long as the mount state identifier can be used to represent the mount state, the naming form of the mount state identifier is not limited otherwise in this embodiment.
As an embodiment, if the mount is successful, the mount status flag is set as a mounted flag, such as "mounted"; if the mount fails, the mount state identifier is set as an unmounted identifier, such as an unmount table, or is set as an unmounted identifier, such as an unmounted identifier. Therefore, the storage management service module can acquire the corresponding mounting result by acquiring the mounting state identifier.
S508: and setting the mounting state identifier of the external storage device as a mounting-unavailable identifier.
If the external storage device management module is abnormal, the external storage device management module detects that the file system of the external storage device is abnormal, and the mount state identifier of the external storage device is set to be the mount-unavailable identifier, so that the external storage device management module cannot mount the external storage device. When the file system is abnormal, the probability of successful mounting of the external storage device is low, so that the probability of successful mounting can be judged by judging whether the file system of the external storage device is abnormal or not, the prejudgment is made before the mounting operation is actually executed, and the mounting is stopped when the file system is abnormal, so that the resource can be saved, and the mounting efficiency is improved.
As an implementation manner, after S508, the method may be ended, that is, the method may be ended after the mount state identifier is set, so that the storage management service module may obtain the mount state identifier, and thus it is known that the currently inserted external storage device cannot be mounted, so that a user may take measures to mount the external storage device again, for example, reinsertion, and user experience of the user in mounting the external storage device is improved.
As another embodiment, the method may be ended before S508, that is, if the external storage device management module determines that the file system of the external storage device is abnormal, the method may be ended without performing S508. Further saving the running resources required for mounting, because it is difficult to Mount the external storage device successfully when the file system is abnormal, the present embodiment may end the method by not performing the actual mounting operation, for example, not performing the function Mount and the like, when the file system is abnormal, thereby reducing the unnecessary running resources.
As another embodiment, the mount disabled flag may be sent to the storage management service module after S508, so that the storage management service module may know the current mount state of the external storage device. For specific implementation, reference may be made to the following embodiments, which are not described herein again.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
In the mount processing method provided in this embodiment, because the probability of successful mount of the external storage device is low when the file system is abnormal, on the basis of the foregoing embodiment, the present embodiment can determine the probability of successful mount by determining whether the file system of the external storage device is abnormal, so as to make a pre-determination before actually performing mount operation, and do not perform mount operation when the file system is abnormal, thereby saving resources and improving mount efficiency.
In addition, when the external storage device management module determines that the file system of the external storage device is abnormal and sets the mount state identifier of the external storage device as the mount-impossible identifier, the mount operation may not be executed, but the mount-impossible identifier is sent to the storage management service module, so that the storage management service module may broadcast the corresponding mount result. Specifically, please refer to fig. 6, which illustrates a mount processing method provided in an embodiment of the present application, and specifically, the method includes: s601 to S610.
S601: the storage management service module sends a first calling instruction to the external storage device management module.
S602: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
S603: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
S604: and the storage management service module responds to the detection completion instruction and sends a second calling instruction to the external storage device management module.
S605: and the external storage device management module responds to the second call instruction and judges whether the file system of the external storage device is abnormal or not according to the detection state identifier.
In this embodiment, if not abnormal, S606 may be executed; if abnormal, S608 may be performed.
S606: and the external storage device management module acquires the mounting result.
S607: and the external storage equipment management module sets a mounting state identifier according to the mounting result.
S608: and setting the mounting state identifier of the external storage device as a mounting-unavailable identifier.
In this embodiment, if the external storage device management module determines that the file system of the external storage device is abnormal, the mount state identifier of the external storage device is set as the mount disabled identifier.
S609: and when the current mounting is completed, the external storage equipment management module sends a mounting completion instruction to the storage management service module.
In this embodiment, when the current mount is completed, a mount completion instruction is sent to the storage management service module, where the mount completion instruction includes the mount state identifier, so that the storage management service module can obtain the mount state identifier of the external storage device when receiving the mount completion instruction.
In this embodiment, if the external storage device management module determines that the file system of the external storage device is abnormal, the mount state identifier of the external storage device is set as the mount-disabled identifier, and the current mount is completed at this time; if the mounting result is not abnormal, the mounting result is obtained, the mounting state identification is set according to the mounting result, and the current mounting is also completed. When the file system is abnormal, the external storage device management module still sends the mounting-incapable identifier to the storage management service module, so that the storage management service module can broadcast the corresponding mounting result when the external storage device is mounted every time, and even if the mounting operation is not executed when the file system is abnormal, the corresponding mounting failure is broadcast, so that other application programs can timely know the mounting state of the inserted external storage device.
S610: and the storage management service module broadcasts a mounting result corresponding to the mounting state identifier according to the mounting state identifier.
As an implementation manner, if the mount state identifier is the mount-impossible identifier, the storage management service module broadcasts that the mount fails; if the mounting state identifier is the mounted identifier, the storage management service module broadcasts that the mounting is successful, so that the application program on the system can access the external storage device which is successfully mounted. Specifically, the storage management service module broadcasts the mount result to the system, and the application program may perform a corresponding operation after monitoring the broadcast, for example, the application program for file management may display the external storage device on an interface of the application program when monitoring a broadcast that the mount is successful, and display the external storage device as an exception on the interface of the application program when monitoring a broadcast that the mount is failed.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
According to the mount processing method provided by the embodiment, on the basis of the foregoing embodiment, after the external storage device management module detects that the file system of the external storage device is abnormal, mount operation is not executed, unnecessary resource consumption is reduced, and meanwhile, the mount result corresponding to the detected abnormal identifier is still broadcast by the storage management service module by sending the mounting-disabled identifier to the storage management service module, so that other application programs can timely acquire the current mount result, response efficiency is improved, a user can conveniently and timely take measures when mount failure occurs, and user experience is improved.
In addition, when the external storage device management module determines that the file system of the external storage device is abnormal and sets the mount state identifier of the external storage device as the mount-impossible identifier, the external storage device management module may still perform mount operation, and specifically, refer to fig. 7, which shows a mount processing method provided in an embodiment of the present application, specifically, the method includes: s701 to S710.
S701: the storage management service module sends a first calling instruction to the external storage device management module.
S702: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
As an implementation manner, when the detection duration exceeds the preset duration, the external storage device management module may also not interrupt the detection operation, so that the detection operation continues to repair the damaged file system. Specifically, when the file system is damaged too much, the external storage device management module needs to complete the repair of all abnormal file systems, the required time is long and may exceed the preset time, and at this time, the detection operation is not interrupted when the detection time exceeds the preset time, so that the external storage device management module can continue to repair the damaged file system in the external storage device.
S703: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
S704: the storage management service module responds to the detection completion instruction and sends a second calling instruction to the external storage device management module
S705: and the external storage device management module responds to the second call instruction and judges whether the file system of the external storage device is abnormal or not according to the detection state identifier.
S706: and setting the mounting state identifier of the external storage device as a mounting-unavailable identifier.
If the external storage device management module determines that the file system of the external storage device is abnormal, the mount state identifier of the external storage device is set to be the mount-disabled identifier, the mount operation can still be performed, and S707 is continuously executed.
As an embodiment, before S707, the external storage device management module completes repairing the file system of the external storage device, so that the file system returns to normal, at this time, by executing S707, the external storage device whose detection state identifier is set as the detection abnormal identifier due to incomplete repairing within the preset time period may be mounted in time when the file system returns to normal, without reinserting, re-executing the detection and mounting operations, so that the mounting efficiency of the external storage device is improved.
S707: and the external storage device management module acquires the mounting result.
S708: and the external storage equipment management module updates the mounting state identifier according to the mounting result.
S709: and when the current mounting is completed, the external storage equipment management module sends a mounting completion instruction to the storage management service module.
S710: and the storage management service module broadcasts a mounting result corresponding to the mounting state identifier according to the mounting state identifier.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
According to the mount processing method provided by the embodiment, the detection operation is not interrupted when the detection time length exceeds the preset time length, the damaged file system is continuously repaired, the mount operation is executed, and the repair is completed before the mount result is obtained, so that the file system of the external storage device is recovered to be normal.
In addition, when the external storage device management module determines that the file system of the external storage device is abnormal and sets the mount state identifier of the external storage device as the mount-impossible identifier, the external storage device management module may also end the method without performing a mount operation, please refer to fig. 8, which shows a mount processing method provided in an embodiment of the present application, and specifically, the method includes: s801 to S810.
S801: the storage management service module sends a first calling instruction to the external storage device management module.
S802: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
S803: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
S804: and the storage management service module responds to the detection completion instruction and sends a second calling instruction to the external storage device management module.
S805: and the external storage device management module responds to the second call instruction and judges whether the file system of the external storage device is abnormal or not according to the detection state identifier.
S806: and setting the mounting state identifier of the external storage device as a mounting-unavailable identifier.
If the external storage device management module judges that the file system of the external storage device is abnormal, after the mounting state identifier of the external storage device is set as the mounting-unavailable identifier, the method is ended, so that the external storage device management module does not execute mounting operation and does not broadcast mounting results when detecting that the file system of the external storage device is abnormal, and resources are saved.
S807: and the external storage device management module acquires the mounting result.
S808: and the external storage equipment management module updates the mounting state identifier according to the mounting result.
S809: and when the current mounting is completed, the external storage equipment management module sends a mounting completion instruction to the storage management service module.
S810: and the storage management service module broadcasts a mounting result corresponding to the mounting state identifier according to the mounting state identifier.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
According to the mount processing method provided by the embodiment, the external storage device management module judges that the file system of the external storage device is abnormal, and after the mount state identifier of the external storage device is set as the mount-impossible identifier, the method is ended, so that the mount operation is not executed and the mount result is not broadcasted when the external storage device management module detects that the file system of the external storage device is abnormal, therefore, on the basis of the embodiment, resources are saved, and the system operation efficiency is improved.
In addition, when the external storage device management module determines that the file system of the external storage device is abnormal, the mount state identifier may not be set, and the external storage device is mounted in response to the second call instruction, specifically, referring to fig. 9, a mount processing method provided in an embodiment of the present application is shown, and specifically, the method includes: s901 to S908.
S901: the storage management service module sends a first calling instruction to the external storage device management module.
S902: and the external storage equipment management module responds to the first calling instruction, executes detection operation, sets the detection state identifier of the external storage equipment as the detection identifier, and returns the detection state identifier.
S903: and when the detection operation is completed, the external storage equipment management module sends a detection completion instruction to the storage management service module.
S904: and the storage management service module responds to the detection completion instruction and sends a second calling instruction to the external storage device management module.
In this embodiment, the external storage device management module mounts the external storage device in response to the second call instruction, and specifically, may include S905 to S906.
S905: and the external storage device management module acquires the mounting result.
S906: the external storage device management module sets a mounting state identifier according to the mounting result
S907: and when the current mounting is completed, the external storage equipment management module sends a mounting completion instruction to the storage management service module.
The mounting completion instruction comprises a mounting state identifier of the external storage device.
S908: and the storage management service module broadcasts a mounting result corresponding to the mounting state identifier according to the mounting state identifier.
It should be noted that, for the parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not described herein again.
According to the hang-on processing method provided by the embodiment, the detection operation and the hang-on operation are executed based on different calling instructions respectively, so that the detection operation consuming long time is prevented from blocking a main process in the execution process, the system has no response, system abnormal conditions such as blocking or screen fixing occur, and the system stability is improved. After the external storage device is mounted, the mounting result is broadcasted, so that the application program on the system can know the mounting result of the external storage device and access the external storage device when the mounting is successful, the response efficiency of the system is improved, and the user experience is improved.
Further, please refer to fig. 10, which shows a flowchart of a method for triggering a first call instruction provided in an embodiment of the present application, where the method describes a process before an external storage device is inserted into a terminal device and a storage management service module sends the first call instruction to an external storage device management module, and specifically, the method includes: s1001 to S1003.
S1001: the external storage device management module sends device information of the external storage device to the storage management service module when detecting an insertion event of the external storage device.
As an implementation manner, when the external storage device is inserted into the terminal device, the system bottom driver reports the insertion time of the external storage device to the external storage device management module, so that the external storage device management module learns the insertion event of the external storage device, creates a storage path and device information of the external storage device, and forwards the device information of the inserted external storage device to the storage management service module. The device information may include device ID, storage capacity size, file system type, and the like. In particular, in some embodiments, the external storage device management module may send the device information to the storage management service module based on a Binder call.
S1002: and the storage management service module creates a storage access interface of the external storage device according to the device information so as to enable the external storage device to be accessed.
As an embodiment, the storage management service module creates a storage access interface of the external storage device according to the received device information of the external storage device, so that the upper application program can access the corresponding external storage device through the storage access interface.
S1003: and the storage management service module adds the external storage equipment to the current storage equipment list and sends a first calling instruction to the external storage equipment management module.
In one embodiment, after creating the storage access interface of the external storage device, the storage management service module adds the external storage device to a pre-configured current storage device list. At the moment, the storage management service module sends a first calling instruction to the external storage device management module based on the Binder calling.
Referring to fig. 11, which shows a block diagram of a mount processing apparatus according to an embodiment of the present application, the mount processing apparatus 1100 may include: a first calling module 1110, a first returning module 1120, a detection completion module 1130, and a mount notification module 1140.
The first calling module 1110 is configured to send a first calling instruction to the external storage device management module by the storage management service module.
The first returning module 1120 is configured to, in response to the first call instruction, execute the detection operation by the external storage device management module, set the detection status identifier of the external storage device as the in-detection identifier, and return the detection status identifier.
The detection completion module 1130 is configured to send a detection completion instruction to the storage management service module when the external storage device management module completes the detection operation.
And a mount notification module 1140, configured to notify the external storage device management module to mount the external storage device based on the detection completion instruction by the storage management service module.
Further, the first return module 1120 includes: a first thread unit and a second thread unit, wherein:
the first thread unit is used for responding to the first calling instruction by the external storage equipment management module, setting a detection state identifier of the external storage equipment as a detection identifier based on the first thread, and returning the detection state identifier;
and the second thread unit is used for responding to the first calling instruction by the external storage device management module and executing the detection operation based on the second thread.
In one embodiment, the first thread is concurrently executing with the second thread.
In one embodiment, the detecting operation is to detect whether a file system of the external storage device is abnormal, and repair the abnormal file system, and if the file system is normal or the file system is abnormal and the repair is completed, the external storage device management module determines that the detecting operation is completed.
Further, after the external storage device management module executes the detection operation in response to the first call instruction, the mount processing apparatus 1100 further includes: detect overtime unusual module, detect unusual confirm module, detect overtime end module and mount and stop the module, wherein:
and the detection overtime exception module is used for setting the detection state identifier as the detection exception identifier by the external storage equipment management module when the detection duration exceeds the preset duration.
And the detection abnormity determining module is used for determining whether the detection abnormity identifier can be found when the external storage device management module mounts the external storage device.
And the mounting stopping module is used for stopping mounting the external storage equipment if the external storage equipment can be mounted.
Further, after the external storage device management module executes the detection operation in response to the first call instruction, the method further includes: a detection timeout ending unit, wherein:
and the detection overtime ending unit is used for ending the method when the detection duration exceeds the preset duration.
Further, in some embodiments, the first calling instruction is a detection instruction, and the first calling module 1110 includes: a first calling unit, wherein:
and the first calling unit is used for sending the detection instruction to the external storage equipment management module by the storage management service module through Binder calling.
Further, mount notification module 1140 includes: and the mounting notification unit is used for responding to the detection completion instruction by the storage management service module and sending a second call instruction to the external storage device management module, wherein the second call instruction is used for notifying the external storage device management module to mount the external storage device.
Further, after the storage management service module sends the second call instruction to the external storage device management module in response to the detection completion instruction, the mount processing apparatus 1100 further includes: an abnormity judgment module and an abnormity mounting identification setting module.
And the abnormality judgment unit is used for responding to the second call instruction by the external storage device management module and judging whether the file system of the external storage device is abnormal or not according to the detection state identifier.
And the abnormal mounting identifier setting module is used for setting the mounting state identifier of the external storage equipment as the mounting-unavailable identifier if the external storage equipment is abnormal, so that the storage management service module cannot mount the external storage equipment.
In some embodiments, after the external storage device management module, in response to the second call instruction, determines whether the file system of the external storage device is abnormal according to the detection status identifier, the mount processing apparatus 1100 further includes: an abort module, wherein:
and the abnormal ending module is used for ending the method if the abnormal condition exists.
Further, after the external storage device management module responds to the second call instruction and determines whether the file system of the external storage device is abnormal according to the detection status identifier, the mount processing apparatus 1100 further includes: mounting result acquisition module and mounting sign set up the module, wherein:
and the mounting result acquisition module is used for acquiring the mounting result by the external storage device management module if the external storage device management module is not abnormal.
And the mounting identifier setting module is used for setting a mounting state identifier by the external storage device management module according to the mounting result.
Further, mount the sign and set up the module, include: a success setting unit and a failure setting unit, wherein:
and the successful setting unit is used for setting the mounting state identifier as the mounted identifier if the mounting is successful.
And the failure setting unit is used for setting the mounting state identifier as the mounting-incapable identifier if the mounting fails.
Further, after the storage management service module sends the second call instruction to the external storage device management module in response to the detection completion instruction, the mount processing apparatus 1100 further includes: second call module, mount and accomplish module and mount broadcast module, wherein:
and the second calling module is used for responding to the second calling instruction by the external storage equipment management module and mounting the external storage equipment.
And the mounting completion module is used for sending a mounting completion instruction to the storage management service module when the external storage device management module finishes the current mounting, wherein the mounting completion instruction comprises a mounting state identifier of the external storage device.
And the mounting broadcast module is used for broadcasting the mounting result corresponding to the mounting state identifier by the storage management service module according to the mounting state identifier.
Further, the second calling module comprises: mount result acquisition unit and mount sign setting unit, wherein:
and the mounting result acquisition unit is used for acquiring the mounting result by the external storage device management module.
And the mounting identifier setting unit is used for setting the mounting state identifier of the external storage equipment by the external storage equipment management module according to the mounting result.
Further, the mount identifier setting unit includes a success setting subunit and a failure setting subunit, wherein:
and the successful setting subunit is used for setting the mounting state identifier as the mounted identifier if the mounting is successful.
And the failure setting subunit is used for setting the mounting state identifier as the mounting-unavailable identifier if the mounting fails.
Further, the mount broadcasting module includes: a mounting failure broadcast unit and a mounting success broadcast unit.
The mounting failure broadcasting unit is used for broadcasting mounting failure by the storage management service module if the mounting state identifier is the mounting failure identifier;
and the mounting success broadcasting unit is used for broadcasting the mounting success by the storage management service module if the mounting state identifier is the mounted identifier.
Further, the mount processing apparatus 1100 further includes: the device comprises a device information sending module, an access interface creating module and a storage device adding module, wherein:
and the device information sending module is used for sending the device information of the external storage device to the storage management service module when the external storage device management module detects the insertion event of the external storage device.
And the access interface creating module is used for creating a storage access interface of the external storage device by the storage management service module according to the device information so as to enable the external storage device to be accessed.
And the storage equipment adding module is used for adding the external storage equipment on the current storage equipment list by the storage management service module and sending a first calling instruction to the external storage equipment management module.
The mount processing apparatus provided in the embodiment of the present application is used to implement the mount processing method corresponding to the foregoing method embodiment, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other type of coupling.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Referring to fig. 12, a block diagram of an electronic device according to an embodiment of the present disclosure is shown. The electronic device 1200 may be a smart phone, a tablet computer, an electronic book, or other electronic devices capable of running an application. The electronic device 1200 in the present application may include one or more of the following components: a processor 1210, a memory 1220, and one or more applications, wherein the one or more applications may be stored in the memory 1220 and configured to be executed by the one or more processors 1210, the one or more programs configured to perform methods as described in the aforementioned method embodiments.
Processor 1210 may include one or more processing cores. The processor 1210, using various interfaces and connections throughout the electronic device 1200, performs various functions and processes data of the electronic device 1200 by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1220, and invoking data stored in the memory 1220. Alternatively, the processor 1210 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1210 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 1210, but may be implemented by a communication chip.
Further, the processor 1210 further includes: an external storage device management module 1211 and a storage management service module 1212. The external storage device management module 1211 may be a management and control center of an external storage system in an Android (Android) platform, and is a background process for managing and controlling an external storage device of the Android platform. The functions mainly comprise: plug-pull event detection of the external storage device, mounting, uninstalling, formatting and the like of the external storage device; the storage management service module 1212 is a module for communicating with the external storage device management module 1211 through the Android system framework layer, and the storage management service module 1212 is also a module for providing a storage access interface and a storage mount message broadcast to an application. Further, in one embodiment, the external storage device management module 1211 and the storage management service module 1212 may communicate based on a Binder communication mechanism.
The Memory 1220 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 1220 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 1220 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The data storage area may also store data created by the electronic device 1200 during use (e.g., phone book, audio-video data, chat log data), etc.
Then, if each unit in the mount processing device shown in fig. 11 is a function module such as a package, each unit in the mount processing device is stored in the memory 1220, can be called by the processor, and executes a corresponding function.
Referring to fig. 13, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable storage medium 1300 has stored therein program code that can be called by a processor to execute the methods described in the above-described method embodiments.
The computer-readable storage medium 1300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable and programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 1300 includes a non-volatile computer-readable storage medium. The computer-readable storage medium 1300 has storage space for program code 1310 for performing any of the method steps described above. The program code can be read from or written to one or more computer program products. The program code 1310 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (20)

  1. A mount processing method, characterized in that the method comprises:
    the storage management service module sends a first calling instruction to an external storage device management module;
    the external storage device management module responds to the first call instruction, executes detection operation, sets a detection state identifier of the external storage device as a detection identifier, and returns the detection state identifier, wherein the detection operation is used for detecting whether a file system of the external storage device is abnormal, and the detection identifier is used for indicating the storage management module that the external storage device management module is executing the detection operation and is not detected to be completed;
    the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed;
    and the storage management service module informs the external storage device management module to mount the external storage device based on the detection completion instruction.
  2. The method according to claim 1, wherein the external storage device management module, in response to the first call instruction, performs a detection operation, sets a detection status flag of the external storage device as an in-detection flag, and returns the detection status flag, including:
    the external storage equipment management module responds to the first calling instruction, sets a detection state identifier of the external storage equipment as a detection identifier based on a first thread, and returns the detection state identifier;
    the external storage device management module performs a detection operation based on a second thread in response to the first call instruction.
  3. The method of claim 2, wherein the first thread is concurrently running with the second thread.
  4. The method according to any one of claims 1 to 3, wherein the detecting operation is to detect whether a file system of the external storage device is abnormal and repair the abnormal file system, and if the file system is normal or the file system is abnormal and repair is completed, the external storage device management module determines that the detecting operation is completed.
  5. The method according to any one of claims 2 to 4, wherein after the external storage device management module performs the detection operation in response to the first call instruction, the method further comprises:
    when the detection duration exceeds the preset duration, the external storage equipment management module sets the detection state identifier as a detection abnormal identifier;
    when the external storage device management module mounts the external storage device, determining whether the detected abnormal identifier can be found;
    and if yes, stopping mounting the external storage equipment.
  6. The method according to any one of claims 2 to 4, wherein after the external storage device management module performs the detection operation in response to the first call instruction, the method further comprises:
    and when the detection time length exceeds the preset time length, ending the method.
  7. The method according to any one of claims 1 to 4, wherein the first call instruction comprises a detection instruction, and the sending, by the storage management service module, the first call instruction to the external storage device management module comprises:
    and the storage management service module sends the detection instruction to the external storage equipment management module through Binder calling.
  8. The method according to claim 1, wherein the storage management service module notifies the external storage device management module to mount the external storage device based on the detection completion instruction, and the method comprises:
    and the storage management service module responds to the detection completion instruction and sends a second calling instruction to the external storage device management module, wherein the second calling instruction is used for informing the external storage device management module to mount the external storage device.
  9. The method of claim 8, wherein after the storage management service module sends a second call instruction to the external storage device management module in response to the detection completion instruction, the method further comprises:
    the external storage device management module responds to the second calling instruction and judges whether the file system of the external storage device is abnormal or not according to the detection state identification;
    if the external storage device is abnormal, the mounting state identification of the external storage device is set to be a mounting-unavailable identification, so that the external storage device management module cannot mount the external storage device.
  10. The method according to claim 9, wherein after the external storage device management module, in response to the second call instruction, determines whether the file system of the external storage device is abnormal according to the detection status identifier, the method further comprises:
    if the abnormal condition exists, the method is ended.
  11. The method according to claim 9, wherein if the external storage device management module is not abnormal, after the external storage device management module responds to the second call instruction and determines whether the file system of the external storage device is abnormal according to the detection status identifier, the method further comprises:
    if the external storage equipment is not abnormal, the external storage equipment management module acquires a mounting result;
    and the external storage equipment management module sets the mounting state identifier according to the mounting result.
  12. The method according to claim 11, wherein the setting, by the external storage device management module, the mount status flag according to the mount result includes:
    if the mounting is successful, setting the mounting state identifier as a mounted identifier;
    and if the mounting fails, setting the mounting state identifier as an unavailable mounting identifier.
  13. The method according to claims 8-12, wherein the storage management service module, after sending a second call instruction to the external storage device management module in response to the detection completion instruction, further comprises:
    the external storage device management module responds to the second calling instruction and mounts the external storage device;
    when the current mounting is completed, the external storage device management module sends a mounting completion instruction to the storage management service module, wherein the mounting completion instruction comprises a mounting state identifier of the external storage device;
    and the storage management service module broadcasts a mounting result corresponding to the mounting state identifier according to the mounting state identifier.
  14. The method of claim 13, wherein the mounting of the external storage device by the external storage device management module in response to the second call instruction comprises:
    the external storage device management module acquires a mounting result;
    and the external storage equipment management module sets the mounting state identifier of the external storage equipment according to the mounting result.
  15. The method according to claim 14, wherein the setting, by the external storage device management module, the mount status identifier according to the mount result includes:
    if the mounting is successful, setting the mounting state identifier as a mounted identifier;
    and if the mounting fails, setting the mounting state identifier as an unavailable mounting identifier.
  16. The method according to any one of claims 13 to 15, wherein the broadcasting, by the storage management service module, the mount result corresponding to the mount state identifier according to the mount state identifier comprises:
    if the mounting state identifier is a mounting-unavailable identifier, the storage management service module broadcasts that mounting is failed;
    and if the mounting state identifier is the mounted identifier, the storage management service module broadcasts that the mounting is successful.
  17. The method of any one of claims 1-16, further comprising:
    when the external storage device management module detects an insertion event of the external storage device, the external storage device management module sends device information of the external storage device to the storage management service module;
    the storage management service module creates a storage access interface of the external storage device according to the device information so as to enable the external storage device to be accessed;
    and the storage management service module adds the external storage equipment to a current storage equipment list and sends the first calling instruction to the external storage equipment management module.
  18. A mount processing apparatus, characterized in that the apparatus comprises:
    the first calling module is used for sending a first calling instruction to the external storage equipment management module by the storage management service module;
    a first returning module, configured to, in response to the first call instruction, execute a detection operation by the external storage device management module, set a detection state identifier of the external storage device as a detection identifier, and return the detection state identifier, where the detection operation is to detect whether a file system of the external storage device is abnormal, and the detection identifier is used to indicate, to the storage management module, that the external storage device management module is executing the detection operation and does not complete detection;
    the detection completion module is used for sending a detection completion instruction to the storage management service module by the external storage device management module when the detection operation is completed;
    and the mounting notification module is used for notifying the external storage device management module to mount the external storage device by the storage management service module based on the detection completion instruction.
  19. An electronic device, comprising:
    one or more processors;
    a memory;
    one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-17.
  20. A computer-readable storage medium having program code stored therein, the program code being invoked by a processor to perform the method of any one of claims 1 to 17.
CN201980091202.2A 2019-05-05 2019-05-05 Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium Active CN113412480B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/085568 WO2020223862A1 (en) 2019-05-05 2019-05-05 Mounting processing method and apparatus, electronic device, and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113412480A true CN113412480A (en) 2021-09-17
CN113412480B CN113412480B (en) 2023-05-16

Family

ID=73050671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980091202.2A Active CN113412480B (en) 2019-05-05 2019-05-05 Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN113412480B (en)
WO (1) WO2020223862A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113377627B (en) * 2021-06-10 2023-12-05 广州朗国电子科技股份有限公司 Business server abnormality detection method, system, equipment and storage medium
CN115086828B (en) * 2022-08-23 2022-12-27 荣耀终端有限公司 Earphone control method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743283B1 (en) * 2007-04-27 2010-06-22 Netapp, Inc. Dynamically modifying parameters for servicing of storage devices
CN102664929A (en) * 2012-04-05 2012-09-12 福兴达科技实业(深圳)有限公司 Mobile terminal and method for managing mass storage device
CN107423157A (en) * 2017-07-31 2017-12-01 北京雷石天地电子技术有限公司 A kind of hard disk hanging method, module and operating system
CN109086079A (en) * 2018-06-11 2018-12-25 青岛海信移动通信技术股份有限公司 A kind of storage equipment carry management method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001232069A (en) * 2000-02-21 2001-08-28 Namco Ltd Game device, data communication method and computer readable recording medium having program for game recorded thereon

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743283B1 (en) * 2007-04-27 2010-06-22 Netapp, Inc. Dynamically modifying parameters for servicing of storage devices
CN102664929A (en) * 2012-04-05 2012-09-12 福兴达科技实业(深圳)有限公司 Mobile terminal and method for managing mass storage device
CN107423157A (en) * 2017-07-31 2017-12-01 北京雷石天地电子技术有限公司 A kind of hard disk hanging method, module and operating system
CN109086079A (en) * 2018-06-11 2018-12-25 青岛海信移动通信技术股份有限公司 A kind of storage equipment carry management method and device

Also Published As

Publication number Publication date
WO2020223862A1 (en) 2020-11-12
CN113412480B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN110825563B (en) System recovery method and device and electronic equipment
CN109086079B (en) Mounting management method and device for storage equipment
CN103838648A (en) Terminal and data backup method
US9215271B2 (en) Method and apparatus for executing application of mobile device
CN113412480B (en) Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium
WO2024078218A1 (en) System booting method and electronic device
CN104809013A (en) Embedded system starting method and device
CN102855149B (en) A kind of chip operating system upgrade method, device and system
CN110445932B (en) Abnormal card dropping processing method and device, storage medium and terminal
CN114064234B (en) Method and device for repairing WMI service
CN109032767B (en) Asynchronous multi-process business processing system, method, device and storage medium
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN113396391B (en) Application program starting method and device, electronic equipment and storage medium
EP3876101B1 (en) Abnormality processing method, terminal device and storage medium
CN108958989B (en) System fault recovery method and device
CN115344289A (en) Client upgrading method and device, terminal equipment and storage medium
CN111176693B (en) Upgrading method of digital television system
CN114328341A (en) SD card hot plug identification method, identification module and electronic equipment
CN115587049A (en) Memory recovery method and device, electronic equipment and storage medium
CN109189562B (en) Method and device for controlling process operation
EP3929737A1 (en) Application state control method apparatus, and terminal and computer-readable storage medium
CN110365839B (en) Shutdown method, shutdown device, shutdown medium and electronic equipment
CN108881623B (en) Mobile terminal control method, mobile terminal and storage medium thereof
CN112989323A (en) Process detection method, device, terminal and storage medium
CN111782515A (en) Web application state detection method and device, server and storage 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
GR01 Patent grant
GR01 Patent grant