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

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

Info

Publication number
CN113412480B
CN113412480B CN201980091202.2A CN201980091202A CN113412480B CN 113412480 B CN113412480 B CN 113412480B CN 201980091202 A CN201980091202 A CN 201980091202A CN 113412480 B CN113412480 B CN 113412480B
Authority
CN
China
Prior art keywords
storage device
external storage
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.)
Active
Application number
CN201980091202.2A
Other languages
Chinese (zh)
Other versions
CN113412480A (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, a mounting processing 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 the external storage equipment management module; the external storage device management module responds to the first call instruction, performs detection operation, sets a detection state identifier of the external storage device as an in-detection identifier, and returns a detection state identifier; when the detection operation is finished, the external storage device management module sends a detection finishing instruction to the storage management service module; the storage management service module notifies the external storage device management module to mount the external storage device based on the detection completion instruction. According to the method and the device, the detection state identification is returned before the detection operation is finished, and the mounting is carried out after the detection operation is finished, so that the system is prevented from being blocked or fixed due to the insertion of the abnormal external storage device, and the system stability is improved.

Description

Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a mounting processing method, a mounting processing device, an electronic device, and a computer readable storage medium.
Background
External storage devices such as SD cards or U discs can be inserted into terminal devices in a card slot or OTG mode, such as mobile phones, digital cameras, portable computers and other terminal devices, and provide additional storage services for users.
When the external storage device is inserted into the terminal device, the terminal device realizes the mounting of the external storage device based on the interaction of the external storage device management module (Volume Daemon, vold) and the storage management service module (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 abnormal conditions of the system such as unresponsiveness of the system or long-time blocking of a screen are easily caused.
Disclosure of Invention
The application provides a mounting processing method, a mounting processing device, electronic equipment and a computer readable storage medium, so as to improve the defects.
In a first aspect, an embodiment of the present application provides a mounting processing method, where the method includes: the storage management service module sends a first calling instruction to the external storage equipment management module; the external storage device management module responds to the first call instruction, executes detection operation, sets detection state identification of the external storage device as detection in-process identification and returns detection state identification, wherein the detection operation is to detect whether a file system of the external storage device is abnormal, and the detection identification 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; when the detection operation is finished, the external storage device management module sends a detection finishing instruction to the storage management service module; the storage management service module notifies 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 mounting processing device, where the device 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 return module is used for responding to the first call instruction, executing detection operation by the external storage device management module, setting the detection state identifier of the external storage device as the in-detection identifier, and returning the detection state identifier, wherein the detection operation is used for detecting whether the file system of the external storage device is abnormal or not, and the detection identifier is used for indicating that the external storage device management module of the storage 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 detection operation is completed by the external storage device management module; and the mounting notification module is used for notifying the external storage device management module to mount the external storage device based on the detection completion instruction by the storage management service module.
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 applications configured to perform the above-described method.
In a fourth aspect, embodiments of the present application also provide a computer readable storage medium having program code stored therein, the program code being callable by a processor to perform the above method.
According to the mounting processing method, the mounting processing device, the electronic equipment and the computer readable storage medium, a first calling instruction is sent to the external storage equipment management module through the storage management service module, then the external storage equipment management module responds to the first calling instruction, the detection operation is carried out, the detection state identification of the external storage equipment is set to be the detection identification, the detection state identification is returned, wherein the detection operation is used for detecting whether a file system of the external storage equipment is abnormal or not, the detection identification is used for indicating the storage management module that the external storage equipment management module is executing the detection operation and is not completed, then the external storage equipment management module sends a detection completion instruction to the storage management service module when the detection operation is completed, and finally the storage management service module informs the external storage equipment management module to mount the external storage equipment based on the detection completion instruction. Therefore, when the external storage device is required to be mounted, the external storage device management module returns the detection state identification before the detection operation is completed, and mounts the external storage device after the detection operation is completed, so that the system cannot be unresponsive due to the abnormality of the file system of the external storage device, the external storage device is prevented from being inserted to cause the system to be blocked or fixed, and the system stability is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a method flowchart of a mounting processing method according to an embodiment of the present application;
fig. 2 is a method flowchart of a mounting processing method according to another embodiment of the present application;
fig. 3 is a flowchart of a method of the mounting processing method according to still another embodiment of the present application;
fig. 4 shows a method flowchart of the mounting processing method provided in another embodiment of the present application;
fig. 5 shows a method flowchart of the mounting processing method provided in a further embodiment of the present application;
fig. 6 shows a method flowchart of a mounting processing method according to still another embodiment of the present application;
fig. 7 is a flowchart of a method for mounting processing according to still another embodiment of the present application;
fig. 8 is a flowchart of a method for mounting processing according to still another embodiment of the present application;
Fig. 9 shows a method flowchart of a mounting processing method provided in still another embodiment of the present application;
FIG. 10 is a flow chart of a method for triggering a first call instruction according to an embodiment of the present application.
Fig. 11 shows a block diagram of a mounting processing device according to an embodiment of the present application;
fig. 12 shows a block diagram of an electronic device according to an embodiment of the present application;
fig. 13 shows a storage unit for storing or carrying program codes implementing the mount processing method according to the embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to better understand the present application, the following description will make clear and complete descriptions of the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.
Socket communication is an Inter-process communication (IPC) mechanism, and in an operating system, a set of application program interfaces (Application ProgrammingI nterface, APIs) are typically provided for application programs, which are called Socket interfaces (Socket APIs). The application may use the web socket through the socket interface for data exchange. The operating system may decide, based on the socket address, that data should be sent to a particular run or thread. In Socket communications, HTTP provides a specific form of encapsulating or displaying data, and Socket provides the capability for network communications.
Binder communication is similar to Socket communication, is an efficient inter-process communication mechanism, and can achieve the purpose of sending data of a process A to a process B. Currently, more and more terminal devices also communicate based on a Binder communication mechanism, for example, the terminal device includes an external storage device management module (Volume Daemon, volume) and a storage management service module (Storage Manager Service), and when an external storage device such as a memory card, a usb disk, etc. is mounted, interaction between the external storage device management module and the storage management service module is required, where the interaction may be based on the Binder communication. Including but not limited to cell phones, digital cameras, laptop computers, and other terminal devices.
However, the inventor found in the study that, in the process of mounting the external storage device based on the Binder communication by the external storage device management module and the storage management service module, if the external storage device management module is jammed in the process of invoking the Binder, the watchdog program in the system may be triggered, so that the system does not respond, and abnormal conditions such as system jam or screen fixing occur.
Therefore, in order to solve the above-mentioned drawbacks, an embodiment of the present application provides a mounting processing method, as shown in fig. 1, specifically, the method includes: s101 to S104.
S101: the storage management service module sends a first call 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 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 of the device mainly comprise: detection of a plug event of an external storage device, mounting, dismounting, formatting and the like of the external storage device. The storage management service module is a module for communicating with the external storage device management module through a system framework layer of the operating system, and is also a module for providing an access interface of the storage device and a mounting message broadcast of the storage device for an application program. It should be noted that, based on the inter-process communication between the external storage device management module and the storage management service module, 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, an 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: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-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 in-detection identifier is used for indicating that the external storage device management module of the storage management module is executing detection operation and is not detected to be completed, so that when the external storage device management module returns to the detection state identifier, the storage management module can know that the external storage device is in detection and is not detected to be completed based on the detection state identifier as the in-detection identifier. Specifically, after detecting an insertion event of an 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 implementations, detecting the time period includes detecting a time period for whether the file system is abnormal and a time period for the external storage device management module to repair when the file system is abnormal. For example, excessive damage to the file system of the external storage device may cause the external storage device management module to attempt to repair the file system of the external storage device with excessive time, and excessive repair time may cause the system to become stuck.
In this embodiment, in response to the first call instruction, the external storage device management module performs the detection operation, sets the detection status identifier of the external storage device as the in-detection identifier, and returns the detection status identifier, so that the interaction process between the external storage device management module and the storage management service module based on the first call instruction can be ended without waiting for the detection operation to be completed, and the problem that the system is unresponsive due to the fact that the interaction process based on the first call instruction is blocked because the detection duration is too long is avoided, specifically, the system unresponsiveness includes system abnormal conditions such as system blocking or screen fixing (screen is blocked for a long time and can also be called as a frozen screen or a hang machine), and therefore abnormal insertion of the external storage device can be prevented from causing the system unresponsiveness, and the system stability is improved.
Specifically, for example, the external storage device management module may set the detection status identifier of the external storage device to be the in-detection identifier such as "checki ng" in response to the first call instruction, and after the external storage device management module returns "checki ng", the storage management service module may learn that the external storage device is in detection according to the storage status identifier of the external storage device as "checki ng".
S103: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
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, and notifies 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 the detection operation is completed at this time, the external storage device management module sends a detection completion instruction to the storage management service module. It should be noted that, when the file system of the external storage device is abnormal, the external storage device management module attempts to repair the file system, and if the repair time is too long and the detection time period consumed before the repair is successful exceeds the specified time, there is a case that the file system of the external storage device is still abnormal when the detection operation is completed. That is, the file system of the external storage device may or may not be abnormal when the detection operation has been completed. The non-abnormal condition includes a condition that the file system is normal before detection, and may also include a condition that the external storage device is abnormal when just inserted, but is repaired and completed by the external storage device management module within a specified time so as to restore the normal condition.
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 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 repair of the damaged file system within a specified time.
It should be noted that, because the external storage device management module responds to the first call instruction and completes one return, 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 the thread of inter-process communication with the storage management service module, but based on the thread in the internal process of the external storage device management module, even if the detection time is too long, the system process is not blocked, that is, the system is not responded, so that the system is prevented from being blocked or fixed due to the fact that the abnormal external storage device is inserted into the terminal device, and the stability of the system is improved.
S104: the storage management service module notifies 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 then notifies the external storage device management module to mount the external storage device.
Therefore, compared with the prior art that the external storage device management module needs to return after the detection operation and the mounting operation are completed, the external storage device management module returns the detection state identification before the detection operation is completed by separating the detection operation from the mounting operation, so that the threads of the inter-process communication with the storage management service module are finished, and the mounting is performed after the detection operation is completed.
Referring to fig. 2, a mounting processing method provided in an embodiment of the present application is shown, and specifically, the method includes: s201 to S207.
S201: the storage management service module sends a first call instruction to the external storage device management module.
As an implementation manner, 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, 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 identification 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 the Binder communication so that the external storage device management module can execute the function Check. Thus, cross-process calling functions can be conveniently implemented based on Binder communications.
As another implementation manner, the detection instruction may be preloaded, that is, the first call instruction does not include the detection instruction, and 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 may respond to the first call instruction and may execute the preloaded detection instruction, thereby reducing the communication data volume between processes, reducing the function loading time, improving the communication efficiency, and improving the detection efficiency, and further being beneficial to improving the mounting efficiency of the external storage device.
S202: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier.
The detection status identifier may be a flag bit corresponding to the external storage device and used for reflecting the current detection status, through which the current detection status can be known, for example, if the flag bit is a detection identifier such as "Checking", it may indicate that the external storage device management module is executing a detection operation on the external storage device and is not detected, and the storage management service module may learn that the current detection status is executing a detection operation and is not detected by receiving the detection status identifier returned by the external storage device management module.
In this embodiment, the external storage device management module may execute the detection operation and set the detection status identifier of the external storage device based on two different threads and return the detection status identifier in response to the first call instruction. Specifically, the external storage device management module sets a detection state identifier of the external storage device as an in-detection 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 to perform immediately after receiving the first call instruction to end, and the external storage device management module performs a detection operation based on the second thread in response to the first call instruction.
The first thread is a cross-process thread based on the Binder call, namely a main thread, and the second thread is a thread in an external storage device management module process, so that the embodiment immediately returns to the execution end after receiving the first call instruction through the first thread, so that the thread of the Binder call can be ended in time, the second thread is started to execute actual detection operation, the actual detection duration is not influenced, namely the detection operation which possibly causes the Binder call to be blocked is executed based on the second thread, the first thread based on the Binder call can be responded timely and even quickly, the system unresponsiveness caused by the detection duration is well avoided, the abnormal conditions such as system blocking or screen fixing caused by abnormal external storage device insertion are prevented, and the stability of the system is greatly improved.
As one implementation, the first process is performed before the second process, specifically, the external storage device management module sets the detection status identifier as the in-detection identifier based on the first thread in response to the first call instruction, returns the detection status identifier, and starts the second thread at this time to execute the detection operation based on the second thread.
As another implementation mode, the first process and the second process are performed simultaneously, specifically, the external storage device management module responds to the first call instruction, simultaneously sets the detection state identifier, starts the second thread and executes the detection operation based on the second thread, the detection state identifier can be returned immediately before the detection operation is completed, and because the second thread and the first thread are performed simultaneously, the external storage device management module responds to the first call instruction, on the basis that the Binder call can be completed in time, the detection operation can be executed faster, the detection efficiency is improved, and meanwhile, the higher detection efficiency is beneficial to improving the mounting efficiency of the external storage device.
The detection operation is to detect whether the file system of the external storage device is abnormal or not, and repair the abnormal file system. It should be noted that, the detecting operation includes an operation of repairing the abnormal file system when the abnormality is detected, so in this embodiment, the detecting duration includes a repairing duration. Specifically, if there is a failure in the file system, it is abnormal, if there is no failure, it is normal, and when there is an abnormality, the external storage device management module will attempt to repair the abnormal file system. Further, if the repair is complete, the file system is not damaged at this time, and can be considered normal without exception.
In some embodiments, if the file system is normal or the file system is abnormal and repair is complete, the external storage device management module determines that the detection operation is complete, and if the file system is abnormal and 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 one way, 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 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 completed. Thus, the duration is not limited to the detection operation, and when the file system is abnormal, it is determined that the detection operation is not completed. Therefore, when the repair is completed, the completion of the detection operation can be timely judged so as to carry out the next operation.
In another way, the detection operation of the external storage device management module is correspondingly set with a preset time length, and when the file system is abnormal and is not repaired within the preset time length, namely, the detection time length exceeds the preset time length, the detection operation is judged to be incomplete. Specifically, if the file system is detected to be normal, no repair is needed at the moment, and the external storage device management module judges that the detection operation is finished; if the abnormality of the file system is detected but the repair is completed within the preset time, the external storage device management module judges that the detection operation is completed; if the detection duration exceeds the preset duration and is not repaired, 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 judged to be incomplete. Therefore, the execution time of the detection operation can be controlled, and the response can be timely made so as to carry out the next operation, so that the detection efficiency is ensured, the detection overtime non-response is avoided, and the availability of the system is improved.
In other embodiments, the detection operation of the external storage device management module is correspondingly set with a preset time period, and when the file system is abnormal and is not repaired within the preset time period, that is, the detection time period exceeds the preset time period, the detection operation is still judged to be completed. Specifically, 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 detection operation is completed, and if the file system is abnormal and not repair is 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 period at most, and when the preset period is reached, it is determined that the detection operation is completed, and 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 completed, and the next operation can be performed by responding in time, so that the detection efficiency is ensured, the detection overtime is avoided, and the usability of the system 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 the detection operation, and the specific implementation manner is as follows:
In one embodiment, when the detection duration exceeds the preset duration, the external storage device management module may terminate the detection operation, thereby saving resources and improving the availability of the system.
In another embodiment, the external storage device management module may not terminate the detection operation when the detection duration exceeds the preset duration, so that the detection operation continues, specifically, when the file system is damaged too much, the external storage device management module needs to complete 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, and therefore, before the mounting operation is performed, there is a possibility that repair is completed, and at this time, the external storage device with the incomplete detection operation still has a possibility that the external storage device can be successfully mounted. For specific embodiments, reference may be made to the following examples, which are not described in detail.
Further, in the present embodiment, when the detection duration exceeds the preset duration, S204 may be executed; when the detection period does not exceed the preset period, S203 may be performed.
S203: when the detection duration exceeds the preset duration, the external storage device management module sets the detection state identifier as the detection abnormality identifier.
The detection state identifier further comprises a detection abnormality identifier, and the detection abnormality identifier can be used for indicating that the storage management service module is currently detecting abnormality, namely that the detection duration exceeds a preset duration 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 identifier as the detection anomaly identifier. Specifically, in one embodiment, the detected abnormality identifier may be a character string such as a number, a letter, a word, etc., for example, "0", "unclicked" or the like, which is used to indicate that the file system is still abnormal after the detected operation, and may be preset in the system or may be custom, so that the abnormality of the file system may be known through the detected abnormality identifier, and in addition, the naming form of the detected abnormality identifier is not limited in this embodiment.
Because the external storage equipment is difficult to mount successfully when the file system is abnormal, when the file system is abnormal and is not repaired within a preset time period, the detection abnormal identifier is set, and the external storage equipment can not be mounted when the detection abnormal identifier is detected, so that unnecessary resource consumption is reduced, and the response efficiency is improved. The specific embodiments can be seen in the examples described below, and are not described in detail herein.
S204: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
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 of normal itself, and a case of abnormal but repair completion.
In one embodiment, if the file system is abnormal and is not repaired within the preset time, that is, the detection time length exceeds the preset time length, it is still determined that the detection operation is completed, and at this time, the external storage device management module sends a detection completion instruction to the storage management service module, so that the storage management service module can learn that the current external storage device has completed the detection operation by receiving the detection completion instruction, and can mount the file system. At this time, the file system of the external storage device may be abnormal or non-abnormal.
As another embodiment, if the file system is abnormal and is not repaired within the preset time, that is, the detection time exceeds the preset time, it is determined that the detection operation is not completed, and at this time, the external storage device management module sends a detection completion instruction to the storage management service module, so that the storage management service module can learn that the current external storage device is normal and can mount the external storage device 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 transmitted.
S205: the storage management service module notifies 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 notify the external storage device management module to mount the external storage device at this time. Therefore, the detection operation and the mounting operation are executed in different threads, and mounting is performed only when the file system of the external storage device is judged to be normal through the detection operation, so that the mounting success rate and the mounting efficiency can be improved.
S206: when the external storage device is mounted by the external storage device management module, whether the detection abnormal identifier can be found or not is determined.
In some embodiments, if the file system is abnormal and is not repaired within the preset time period, that is, the detection time period exceeds the preset time period, still determining that the detection operation is completed, and when the external storage device is mounted by the external storage device management module, determining whether the detection abnormal identifier can be found, specifically, for example, based on a flag bit representing the detection state, determining whether the detection state identifier on the flag bit is in the detection abnormal identifier; for another example, it may be directly searched whether the detected abnormality identifier is stored in correspondence with the external storage device.
In other embodiments, if the file system is abnormal and is not repaired within the preset duration, that is, the detection duration exceeds the preset duration, it is determined that the detection operation is not completed, and S206 to S207 are not executed after S205, where the file system of the external storage device is non-abnormal, that is, the detection abnormality identifier is not required to be searched.
Further, if the detection abnormality identification can be found, S207 may be executed; if not, the mounting operation may continue.
S207: if so, stopping mounting the external storage device.
If the abnormal detection mark 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 operation resources can be reduced, the system operation efficiency is improved, and the mounting efficiency is improved.
It should be noted that, for the parts of the steps that are not described in detail, reference may be made to the foregoing embodiments, and details are not repeated here.
According to the mounting processing method, the detection operation and the mounting operation are executed in different threads, after the external storage device management module receives the first calling instruction, the external storage device management module immediately returns to enable the thread called by the Binder to be finished in time, and starts the second thread to execute the actual detection operation, so that the actual detection duration is ensured, the repair duration contained in the second thread does not influence the main thread, namely, the detection operation which possibly causes the Binder to call and be blocked is executed based on the second thread, the system unresponsiveness caused by overlong detection duration is avoided, abnormal conditions such as system blocking or screen fixing caused by abnormal external storage device insertion are prevented, and the stability of the system is greatly improved. In addition, by determining whether the detection abnormality identification can be found, the external storage device management device can continue to mount when the file system of the external storage device is non-abnormal, the mounting success rate and efficiency can also be improved, in addition, because the external storage device management module does not mount when the file system is abnormal, unnecessary resource consumption can also be reduced, and the system operation efficiency is improved.
In addition, when the detection duration exceeds the preset duration, the method can also be ended without performing the next operation. Specifically, referring to fig. 3, the method includes: s301 to S303.
S301: the storage management service module sends a first call instruction to the external storage device management module.
S302: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier.
S303: when the detection duration exceeds the preset duration, the external storage device management module sets the detection state identifier as the detection abnormality 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 is not repaired within the preset duration, the storage management service module is not notified to end the method, consumption of operation resources can be greatly reduced, and system operation efficiency is improved.
Further, as a way, 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 abnormality identifier, so that when the storage management service module obtains the detection state identifier of the external storage device, the file system of the external storage device can be known to be in an abnormal state, and thus a user can try to re-mount in time.
Alternatively, when the detection duration exceeds the preset duration, S303 may not be executed, and the present method may be ended. At this time, the storage management service module considers that the external storage device is still under detection, and still performs detection operation, specifically, the detection state of the external storage device is "Checking" correspondingly.
S304: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
S305: the storage management service module notifies the external storage device management module to mount the external storage device based on the detection completion instruction.
It should be noted that, in the above steps, for the parts described in detail, reference may be made to the foregoing embodiments, and the details are not repeated here.
According to the mounting processing method provided by the embodiment, on the basis of the embodiment, when the detection duration exceeds the preset duration, the method is ended, so that the consumption of operation resources can be greatly reduced, the operation efficiency is improved, a user can re-try mounting through reinserting external storage equipment or other measures, and the user mounting experience is improved.
Referring to fig. 4, a mounting processing method provided in an embodiment of the present application is shown, and specifically, the method includes: s401 to S404.
S401: the storage management service module sends a first call instruction to the external storage device management module.
S402: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier.
S403: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
The specific implementation of S401 to S403 may refer to the foregoing embodiments, and are not repeated here.
S404: 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 calling instruction is used for notifying the external storage device management module to mount the external storage device.
In one embodiment, the storage management service module sends the Mount instruction to the external storage device management module through the Binder call in response to the detection completion instruction, where the second call instruction includes a 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 the function Mount to the external storage device management module based on the Binder communication, so that the external storage device management module can execute the function Mount to execute the Mount operation.
As another implementation manner, the mounting instruction may be preloaded, that is, the second calling instruction does not include the mounting instruction, and at this time, the storage management service module sends the second calling instruction to the external storage device management module, so that the external storage device management module may respond to the second calling instruction and may execute the preloaded mounting instruction, thereby reducing the communication data volume between processes, reducing the function loading time, and improving the mounting efficiency while improving the communication efficiency.
Referring to fig. 5, a mounting processing method provided in an embodiment of the present application is shown, and specifically, the method includes: s501 to S507.
S501: the storage management service module sends a first call instruction to the external storage device management module.
S502: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier.
S503: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
S504: 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: 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 according to the detection state identification.
In this embodiment, 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 corresponding to the external storage device. Specifically, if the current detection state identifier is the detection abnormality identifier, the file system of the external storage device is abnormal, otherwise, the file system is not abnormal, namely the file system is normal.
In this embodiment, after S505, if it is not abnormal, S506 may be performed; if so, S508 may be performed.
S506: and the external storage device management module acquires the mounting result.
If the file system of the external storage device 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 the Mount operation on the external storage device by executing a function Mount for Mount based on a Mount instruction, such as the function Mount, to obtain a Mount result. The mounting result comprises mounting success and mounting failure.
S507: and the external storage device management module sets a mounting state identifier according to the mounting result.
Specifically, the mounting state identifier may be a flag bit for indicating the mounting state, for example, if the mounting state identifier is "unmountable", it indicates that the external storage device cannot be mounted, and if the mounting state identifier is "mount", it indicates that the external storage device is mounted. It should be noted that, as long as the mounting state identifier can be used to characterize the mounting state, the naming form of the mounting state identifier is not limited in this embodiment.
As an implementation manner, if the mounting is successful, the mounting state identifier is set as a mounted identifier, such as "mounted"; if the mounting fails, the mounting state identifier is set as an incapable of mounting identifier, such as "unmountable", or is set as an unmountable identifier, such as "unmounted". 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 an identifier incapable of being mounted.
If the external storage device is abnormal, the external storage device management module detects that the file system of the external storage device is abnormal, and the mounting state identifier of the external storage device is set as an identifier incapable of being mounted, so that the external storage device management module cannot mount the external storage device. Because the probability of successful mounting of the external storage device is low when the file system is abnormal, the probability of successful mounting can be judged by judging whether the file system of the external storage device is abnormal or not, so that prejudgment is made before the mounting operation is actually executed, and the mounting is stopped when the file system is abnormal, resources can be saved, and the mounting efficiency is improved.
As an implementation manner, S508 may end the method after the mounting state identifier is set, that is, the method is ended after the mounting state identifier is set, so that the storage management service module may obtain the mounting state identifier, thereby knowing that the external storage device which is currently inserted cannot be mounted, so that a user may take measures to mount the external storage device again, such as reinsertion, and improving user experience of the user to mount the external storage device.
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 executing S508. Further, the operation resources required for mounting are saved, and because it is difficult to Mount the external storage device successfully when the file system is abnormal, the present embodiment can reduce unnecessary operation resources by not executing actual mounting operations, for example, executing no function Mount and the like, but ending the present method when the file system is abnormal.
As yet another embodiment, S508 may further send the no-mount identifier to the storage management service module, so that the storage management service module may learn the current mount state of the external storage device. For specific embodiments, reference may be made to the following examples, which are not described herein.
It should be noted that, for the parts of the steps that are not described in detail, reference may be made to the foregoing embodiments, and details are not repeated here.
According to the mounting processing method provided by the embodiment, because the probability of successful mounting of the external storage device is low when the file system is abnormal, on the basis of the embodiment, the probability of successful mounting can be judged by judging whether the file system of the external storage device is abnormal, so that the pre-judgment is made before the mounting operation is actually executed, the mounting operation is not performed when the file system is abnormal, resources can be saved, and the mounting efficiency 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 mounting state identifier of the external storage device as an identifier incapable of being mounted, the mounting operation is not required, but the identifier incapable of being mounted is sent to the storage management service module, so that the storage management service module can broadcast a corresponding mounting result. Specifically, referring to fig. 6, a mounting processing method provided in an embodiment of the present application is shown, and specifically, the method includes: s601 to S610.
S601: the storage management service module sends a first call instruction to the external storage device management module.
S602: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier.
S603: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
S604: 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: 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 according to the detection state identification.
In this embodiment, if not abnormal, S606 may be performed; if so, S608 may be performed.
S606: and the external storage device management module acquires the mounting result.
S607: and the external storage device 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 an identifier incapable of being mounted.
In this embodiment, if the external storage device management module determines that the file system of the external storage device is abnormal, the mount status identifier of the external storage device is set as an identifier that cannot be mounted.
S609: and the external storage device management module sends a mounting completion instruction to the storage management service module when the current mounting is completed.
In this embodiment, when the current mounting is completed, a mounting completion instruction is sent to the storage management service module, where the mounting completion instruction includes a mounting status identifier, so that when the storage management service module receives the mounting completion instruction, the mounting status identifier of the external storage device may be obtained.
After the external storage device management module performs the mounting operation to mount the external storage device, a mounting result may be obtained, in this embodiment, if the external storage device management module determines that the file system of the external storage device is abnormal, the mounting state identifier of the external storage device is set to be an identifier that cannot be mounted, and at this time, the current mounting is completed; if the current mounting is not abnormal, a mounting result is obtained, a mounting state identifier is set according to the mounting result, and the current mounting is completed. Because the external storage device management module still can not mount the identification to the storage management service module when the file system is abnormal, the storage management service module can broadcast the corresponding mounting result when the external storage device is mounted each time, even if the mounting operation is not executed when the file system is abnormal, the corresponding mounting failure is broadcast, and 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 mounting state identifier is an identifier incapable of being mounted, the storage management service module broadcasts that mounting fails; if the mounting state identifier is the mounted identifier, the storage management service module broadcasts that the mounting is successful, so that an application program on the system can access the external storage equipment which is successfully mounted. Specifically, the storage management service module broadcasts the mounting result to the system, and the application program can correspondingly operate after monitoring the broadcast, for example, when the application program for file management monitors the broadcast with successful mounting, the external storage device is displayed on the interface of the application program, and when the application program monitors the broadcast with failed mounting, the external storage device is displayed on the interface of the application program.
It should be noted that, for the parts of the steps that are not described in detail, reference may be made to the foregoing embodiments, and details are not repeated here.
According to the mounting processing method provided by the embodiment, on the basis of the embodiment, after the external storage device management module detects that the file system of the external storage device is abnormal, mounting operation is not executed, unnecessary resource consumption is reduced, meanwhile, through sending the mounting incapable identifier to the storage management service module, the storage management service module still broadcasts the mounting result corresponding to the abnormal identifier, other application programs can timely learn the current mounting result, response efficiency is improved, and a user can conveniently take measures in time when mounting fails, so that 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 mounting state identifier of the external storage device as an identifier that cannot be mounted, the mounting operation may still be performed, specifically, please refer to fig. 7, which shows a mounting processing method provided in an embodiment of the present application, and specifically, the method includes: s701 to S710.
S701: the storage management service module sends a first call instruction to the external storage device management module.
S702: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier.
In one embodiment, when the detection duration exceeds the preset duration, the external storage device management module may 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 repairing all abnormal file systems, the required time is long, and the required time may exceed a preset time, at this time, by not interrupting the detection operation when the detection time exceeds the preset time, the external storage device management module can continue repairing the damaged file system in the external storage device, so that before the mounting operation is performed, the possibility of repairing is provided, and at this time, the external storage device with incomplete detection operation still has the possibility of being mounted successfully.
S703: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
S704: the storage management service module responds to the detection completion instruction and sends a second calling instruction to the external storage equipment management module
S705: 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 according to the detection state identification.
S706: and setting the mounting state identifier of the external storage device as an identifier incapable of being mounted.
If the external storage device management module determines that the file system of the external storage device is abnormal, the mount status identifier of the external storage device is set to be an identifier that cannot be mounted, and the mount operation can still be performed, and S707 is continuously executed.
As an implementation manner, before S707, the external storage device management module repairs the file system of the external storage device, so that the file system is restored to be normal, at this time, by executing S707, the external storage device whose detection status identifier is set to be the detection abnormality identifier may be set because the file system is not repaired to be complete within the preset period of time, and when the file system is restored to be normal, the mounting may be performed in time, without reinsertion, 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 device management module updates the mounting state identifier according to the mounting result.
S709: and the external storage device management module sends a mounting completion instruction to the storage management service module when the current mounting is completed.
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 of the steps that are not described in detail, reference may be made to the foregoing embodiments, and details are not repeated here.
According to the mounting processing method provided by the embodiment, when the detection duration exceeds the preset duration, the detection operation is not interrupted, the damaged file system is repaired continuously, and the repairing is completed in the period of time before the mounting operation is executed, so that the file system of the external storage device is recovered to be normal, and therefore the mounting operation can be executed still after the mounting state identifier is set to be incapable of being mounted according to the detection abnormal identifier through the external storage device management module, the external storage device can be mounted in time when the file system is recovered to be normal, and the mounting efficiency 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 mounting state identifier of the external storage device as an identifier that cannot be mounted, the external storage device management module may end the method without performing the mounting operation, and referring to fig. 8, a mounting processing method provided in the embodiment of the present application is shown, and specifically, the method includes: s801 to S810.
S801: the storage management service module sends a first call instruction to the external storage device management module.
S802: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier.
S803: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
S804: 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: 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 according to the detection state identification.
S806: and setting the mounting state identifier of the external storage device as an identifier incapable of being mounted.
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 incapable identifier, the method is ended, so that the external storage device management module does not execute mounting operation or 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 device management module updates the mounting state identifier according to the mounting result.
S809: and the external storage device management module sends a mounting completion instruction to the storage management service module when the current mounting is completed.
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 of the steps that are not described in detail, reference may be made to the foregoing embodiments, and details are not repeated here.
According to the mounting processing method provided by the embodiment, the mounting state identifier of the external storage device is set to be the identifier incapable of being mounted after the external storage device management module judges that the file system of the external storage device is abnormal, so that the external storage device management module does not execute mounting operation or broadcast mounting results when detecting that the file system of the external storage device is abnormal, resources are saved on the basis of the embodiment, 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 mounting 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 call instruction to the external storage device management module.
S902: the external storage device management module responds to the first call instruction, performs detection operation, sets the detection state identifier of the external storage device as the in-detection identifier, and returns the detection state identifier.
S903: and the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed.
S904: 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 the external storage device management module sends a mounting completion instruction to the storage management service module when the current mounting is completed.
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 of the steps that are not described in detail, reference may be made to the foregoing embodiments, and details are not repeated here.
According to the hanging processing method, the detection operation and the mounting operation are respectively executed based on different calling instructions, so that the main process is prevented from being blocked by the long-time-consuming detection operation in the execution process, the system does not respond, abnormal conditions of the system such as blocking or screen fixing occur, and the system stability is improved. After the mounting operation is executed on the external storage device, the mounting result is broadcasted, so that an application program on the system can acquire 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, referring to fig. 10, a flowchart of a method for triggering a first call instruction provided in an embodiment of the present application is shown, 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 transmits device information of the external storage device to the storage management service module when detecting an insertion event of the external storage device.
When the external storage device is inserted into the terminal device, the system bottom layer 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 knows 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, among other things, device ID, storage capacity size, file system type, etc. Specifically, in some implementations, the external storage device management module may send device information to the storage management service module based on the Binder call.
S1002: the storage management service module creates a storage access interface of the external storage device according to the device information so that the external storage device is accessed.
As one 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 layer application program can access the corresponding external storage device through the storage access interface.
S1003: the storage management service module adds external storage equipment on the current storage equipment list and sends a first calling instruction to the external storage equipment management module.
As one embodiment, the storage management service module adds the external storage device to a preconfigured current storage device list after creating a storage access interface for the external storage device. At the moment, the storage management service module sends a first calling instruction to the external storage device management module based on the Binder call.
Referring to fig. 11, which is a block diagram illustrating a mounting processing apparatus according to an embodiment of the present application, a mounting processing apparatus 1100 may include: a first call module 1110, a first return module 1120, a detection completion module 1130, and a mount notification module 1140.
The first invoking module 1110 is configured to send a first invoking instruction to the external storage device management module by using the storage management service module.
The first return module 1120 is configured to execute a detection operation by the external storage device management module in response to the first call instruction, set a detection status identifier of the external storage device as an 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 detects that the operation has been completed.
The mounting notification module 1140 is 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 call instruction by the external storage device management module, setting the detection state identifier of the external storage device as the 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 call instruction by the external storage device management module and executing detection operation based on the second thread.
In one embodiment, the first thread is concurrent with the second thread.
In one embodiment, the detecting operation is to detect whether the 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.
Further, after the external storage device management module performs the detection operation in response to the first call instruction, the mount processing apparatus 1100 further includes: the device comprises a detection timeout abnormal module, a detection abnormality determining module, a detection timeout ending module and a mounting stopping module, wherein:
the detection timeout abnormal module is used for setting the detection state identifier as the detection abnormal identifier when the detection duration exceeds the preset duration.
The detection abnormality determining module is used for determining whether the detection abnormality identification can be found when the external storage device is mounted by the external storage device management module.
And the mounting stopping module is used for stopping mounting the external storage device if the mounting stopping module is capable of stopping mounting the external storage device.
Further, after the external storage device management module responds to the first call instruction and performs the detection operation, the external storage device management module further includes: a detection timeout ending unit, wherein:
And the detection timeout ending unit is used for ending the method when the detection duration exceeds the preset duration.
Further, in some embodiments, the first call instruction is a detection instruction, where the first call module 1110 includes: a first calling unit, wherein:
the first calling unit is used for sending the detection instruction to the external storage device management module through the Binder call by the storage management service module.
Further, the 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, sending a second calling instruction to the external storage device management module, and notifying the external storage device management module of mounting the external storage device by the second calling instruction.
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: the device comprises an abnormality judging module and an abnormality mounting identification setting module.
The abnormality judging unit is used for responding to the second calling instruction by the external storage device management module and judging whether the file system of the external storage device is abnormal according to the detection state identification.
The abnormal mounting identifier setting module is used for setting the mounting state identifier of the external storage device as an incapable mounting identifier if abnormal, so that the storage management service module cannot mount the external storage device.
In some embodiments, after the external storage device management module determines whether the file system of the external storage device is abnormal according to the detection status identifier in response to the second call instruction, 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 state 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: the device comprises a mounting result acquisition module and a mounting identifier setting module, wherein:
and the mounting result acquisition module is used for acquiring the mounting result by the external storage device management module if the mounting result is not abnormal.
And the mounting identifier setting module is used for setting a mounting state identifier according to the mounting result by the external storage device management module.
Further, the mounting identifier setting module includes: 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.
The failure setting unit is used for setting the mounting state identifier as an identifier incapable of being mounted if 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: the system comprises a second calling module, a mounting completion module and a mounting broadcasting module, wherein:
the second calling module is used for the external storage device management module to respond to the second calling instruction and mount the external storage device.
And the mounting completion module is used for sending a mounting completion instruction to the storage management service module when the current mounting is completed by the external storage device management module, wherein the mounting completion instruction comprises a mounting state identifier of the external storage device.
And the mounting broadcast module is used for storing and managing the mounting result corresponding to the mounting state identifier according to the mounting state identifier by the service module.
Further, the second calling module includes: the device comprises a mounting result acquisition unit and a mounting identifier setting unit, wherein:
the mounting result acquisition unit is used for acquiring the mounting result by the external storage device management module.
The mounting identifier setting unit is used for setting the mounting state identifier of the external storage device according to the mounting result by the external storage device management module.
Further, the mounting identifier setting unit includes a success setting subunit and a failure setting subunit, where:
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 an identifier incapable of being mounted if mounting fails.
Further, the mounting broadcast module includes: and mounting the failed broadcasting unit and mounting the successful broadcasting unit.
The mounting failure broadcasting unit is used for broadcasting mounting failure of the storage management service module if the mounting state identifier is an identifier incapable of being mounted;
and the successful mounting broadcasting unit is used for broadcasting successful mounting by the storage management service module if the mounting state identifier is the mounted identifier.
Further, the mounting 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:
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 creation module is used for creating a storage access interface of the external storage device according to the device information by the storage management service module so as to enable the external storage device to be accessed.
The storage device adding module is used for adding the external storage device to the current storage device list by the storage management service module and sending a first calling instruction to the external storage device management module.
The mounting processing device provided in the embodiment of the present application is used to implement the corresponding mounting processing method in the foregoing method embodiment, and has the beneficial effects of the corresponding method embodiment, which is not described herein again.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus and modules described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
In several embodiments provided herein, the coupling of the modules to each other may be electrical, mechanical, or other.
In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
Referring to fig. 12, a block diagram of an electronic device according to an embodiment of the present application is shown. The electronic device 1200 may be a smart phone, tablet, electronic book, etc. capable of running applications. The electronic device 1200 in this application may include one or more of the following components: processor 1210, memory 1220, and one or more application programs, wherein the one or more application programs may be stored in memory 1220 and configured to be executed by the one or more processors 1210, the one or more program configured to perform the methods as described in the foregoing method embodiments.
Processor 1210 may include one or more processing cores. The processor 1210 uses various interfaces and lines to connect various portions of the overall electronic device 1200, perform various functions of the electronic device 1200, and process data 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 in at least one of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 1210 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 1210 and may be implemented solely by a single communication chip.
Further, the processor 1210 further includes: the external storage device management module 1211 and the 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 external storage devices of the Android platform. The functions of the device mainly comprise: detecting a plugging event of the external storage device, mounting, unloading, 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 by the Android system framework layer, and meanwhile, the storage management service module 1212 is also a module for providing a storage access interface and a storage mount message broadcast for 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.
Memory 1220 may include random access Memory (Random Access Memory, RAM) or Read-Only Memory (rom). 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 the various method embodiments described below, etc. The storage data area may also store data created by the electronic device 1200 in use (e.g., phonebook, audiovisual data, chat log data), and the like.
If each unit in the mounted processing device shown in fig. 11 is used as a function module such as a program package, each unit in the mounted processing device is stored in the memory 1220, and can be called by the processor and perform 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 invoked by a processor to perform the methods described in the method embodiments described above.
The computer readable storage medium 1300 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, computer readable storage medium 1300 includes non-volatile computer readable media (non-transitory computer-readable storage medium). The computer readable storage medium 1300 has storage space for program code 1310 that performs any of the method steps described above. The program code can be read from or written to one or more computer program products. Program code 1310 may be compressed, for example, in a suitable form.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, one of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not drive the essence of the corresponding technical solutions to depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (19)

1. A mounting processing method, the method comprising:
the storage management service module sends a first calling instruction to the external storage equipment 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 an in-detection identifier, and returns the detection state identifier, wherein the detection operation is to detect whether a file system of the external storage device is abnormal or not, and the in-detection identifier is used for indicating 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 responds to the first call instruction, executes detection operation, sets detection state identification of the external storage device as detection in-process identification, returns the detection state identification, and comprises:
the external storage device management module responds to the first call instruction, sets a detection state identifier of the external storage device as an in-detection identifier based on a first thread, and returns the detection state identifier, wherein the first thread is a cross-process thread based on Binder call;
the external storage device management module responds to the first call instruction and executes detection operation based on a second thread, wherein the second thread is a thread in the external storage device management module process;
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 of claim 1, wherein the first thread is concurrent with the second thread.
3. The method of claim 1, 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.
4. The method of claim 1, wherein the external storage device management module, in response to the first call instruction, after performing the detecting operation, further comprises:
when the detection duration exceeds the preset duration, the external storage device management module sets the detection state identifier as a detection abnormality identifier;
when the external storage device is mounted by the external storage device management module, determining whether the detection abnormal identifier can be found;
and if so, stopping mounting the external storage device.
5. The method of claim 1, wherein the external storage device management module, in response to the first call instruction, after performing the detecting operation, further comprises:
and when the detection duration exceeds the preset duration, ending the method.
6. The method of claim 1, wherein the first call instruction comprises a detection instruction, and wherein the storage management service module sends the first call instruction to an external storage device management module, comprising:
and the storage management service module sends the detection instruction to the external storage equipment management module through a Binder call.
7. The method of claim 1, wherein the storage management service module notifying the external storage device management module to mount the external storage device based on the detection completion instruction 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 notifying the external storage device management module to mount the external storage device.
8. The method of claim 7, wherein the storage management service module, in response to the detection completion instruction, after sending a second call instruction to the external storage device management module, 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 according to the detection state identification;
If the external storage device is abnormal, the mounting state identifier of the external storage device is set to be an identifier incapable of being mounted, so that the external storage device management module cannot mount the external storage device.
9. The method of claim 8, wherein the external storage device management module, in response to the second call instruction, after determining whether the file system of the external storage device is abnormal according to the detection status identifier, further comprises:
if abnormal, the method is ended.
10. The method of claim 8, wherein the external storage device management module, in response to the second call instruction, after determining whether the file system of the external storage device is abnormal according to the detection status identifier, further comprises:
if not, the external storage device management module acquires a mounting result;
and the external storage device management module sets the mounting state identifier according to the mounting result.
11. The method of claim 10, wherein the external storage device management module sets the mount status identifier according to the mount result, comprising:
If the mounting is successful, setting the mounting state identifier as a mounted identifier;
if the mounting fails, setting the mounting state identifier as an identifier incapable of being mounted.
12. The method of claim 7, wherein the storage management service module, in response to the detection completion instruction, after sending a second call instruction to the external storage device management module, further comprises:
the external storage device management module responds to the second calling instruction to mount 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.
13. The method of claim 12, wherein the external storage device management module, in response to the second call instruction, mounts the external storage device, comprising:
the external storage device management module obtains a mounting result;
And the external storage device management module sets the mounting state identifier of the external storage device according to the mounting result.
14. The method of claim 13, wherein the external storage device management module sets a mount status flag according to the mount result, comprising:
if the mounting is successful, setting the mounting state identifier as a mounted identifier;
if the mounting fails, setting the mounting state identifier as an identifier incapable of being mounted.
15. The method of claim 12, wherein the storage management service module broadcasts a mounting result corresponding to the mounting status identifier according to the mounting status identifier, comprising:
if the mounting state identifier is an identifier incapable of being mounted, the storage management service module broadcasts a mounting failure;
and if the mounting state identifier is the mounted identifier, the storage management service module broadcasts that the mounting is successful.
16. The method as recited in claim 1, further comprising:
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;
The storage management service module creates a storage access interface of the external storage device according to the device information so that the external storage device is accessed;
and the storage management service module adds the external storage device on the current storage device list and sends the first calling instruction to the external storage device management module.
17. A mounting processing apparatus, the apparatus comprising:
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 return module is used for responding to the first call instruction, executing detection operation by the external storage device management module, setting a detection state identifier of the external storage device as an in-detection 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 or not, and the in-detection identifier is used for indicating that the external storage device management module is executing the detection operation and is not completed; the external storage device management module responds to the first call instruction, executes detection operation, sets detection state identification of the external storage device as detection in-process identification, returns the detection state identification, and comprises: the external storage device management module responds to the first call instruction, sets a detection state identifier of the external storage device as an in-detection identifier based on a first thread, and returns the detection state identifier, wherein the first thread is a cross-process thread based on Binder call; the external storage device management module responds to the first call instruction and executes detection operation based on a second thread, wherein the second thread is a thread in the external storage device management module process;
The detection completion module is used for sending a detection completion instruction to the storage management service module when the detection operation is completed by the external storage device management module;
and the mounting notification module is used for notifying the external storage device management module to mount the external storage device based on the detection completion instruction by the storage management service module.
18. 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 applications configured to perform the method of any of claims 1-16.
19. A computer readable storage medium having stored therein program code which is callable by a processor to perform the method of any one of claims 1-16.
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 CN113412480A (en) 2021-09-17
CN113412480B true 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

Family Cites Families (5)

* 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
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
CN109086079B (en) * 2018-06-11 2021-05-11 青岛海信移动通信技术股份有限公司 Mounting management method and device for storage equipment

Also Published As

Publication number Publication date
WO2020223862A1 (en) 2020-11-12
CN113412480A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
US10552263B2 (en) System running method and intelligent terminal
CN103838648A (en) Terminal and data backup method
US11144416B2 (en) Device fault processing method, apparatus, and system
WO2020211791A1 (en) Method and device for anonymous page management, terminal device, and readable storage medium
CN109376053B (en) Data processing method and device and mobile terminal
CN107423064B (en) Message processing method and device, terminal equipment and storage medium
CN113412480B (en) Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium
WO2024078218A1 (en) System booting method and electronic device
CN116107922A (en) Application management method and electronic device
CN102855149B (en) A kind of chip operating system upgrade method, device and system
CN114064234B (en) Method and device for repairing WMI service
CN109639827B (en) Client upgrading method and device
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN103425539B (en) Information processing method and device
CN112965799A (en) Task state prompting method and device, electronic equipment and medium
CN108845772B (en) Hard disk fault processing method, system, equipment and computer storage medium
CN115587049A (en) Memory recovery method and device, electronic equipment and storage medium
CN112241338B (en) Restarting method and device
US12008396B2 (en) Application state control method apparatus, and terminal and computer-readable storage medium
CN109189562B (en) Method and device for controlling process operation
CN109460291B (en) Electronic device, method for elastically controlling server cluster and storage medium
CN108881623B (en) Mobile terminal control method, mobile terminal and storage medium thereof
CN107480004B (en) Fault recovery method and device and computer equipment
CN111813574A (en) Picture compression method and device, storage medium and electronic equipment
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