Movatterモバイル変換


[0]ホーム

URL:


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
CN113412480BCN201980091202.2ACN201980091202ACN113412480BCN 113412480 BCN113412480 BCN 113412480BCN 201980091202 ACN201980091202 ACN 201980091202ACN 113412480 BCN113412480 BCN 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 LtdfiledCriticalGuangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN113412480ApublicationCriticalpatent/CN113412480A/en
Application grantedgrantedCritical
Publication of CN113412480BpublicationCriticalpatent/CN113412480B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请实施例公开了一种挂载处理方法、装置、电子设备及计算机可读取存储介质,涉及视频处理技术领域。该方法包括:存储管理服务模块向外部存储设备管理模块发送第一调用指令;外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识;外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令;存储管理服务模块基于检测完成指令通知外部存储设备管理模块对外部存储设备进行挂载。本申请在检测操作完成前先返回检测状态标识,并在检测操作完成后进行挂载,防止异常外部存储设备插入导致系统卡死或定屏,从而提升系统稳定性。

Figure 201980091202

The embodiment of the present application discloses a mounting processing method, device, electronic equipment, and computer-readable storage medium, and relates to the technical field of video processing. The method includes: the storage management service module sends a first call instruction to the external storage device management module; the external storage device management module executes a detection operation in response to the first call instruction, and sets the detection status flag of the external storage device as a detection flag, And return the detection status identifier; the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed; the storage management service module notifies the external storage device management module to mount the external storage device based on the detection completion instruction. This application returns the detection status indicator before the detection operation is completed, and mounts it after the detection operation is completed, so as to prevent the system from being stuck or freeze due to the insertion of an abnormal external storage device, thereby improving system stability.

Figure 201980091202

Description

Translated fromChinese
挂载处理方法、装置、电子设备及计算机可读取存储介质Mounting processing method, device, electronic device, and computer-readable storage medium

技术领域technical field

本申请涉及存储技术领域,更具体地,涉及一种挂载处理方法、装置、电子设备及计算机可读取存储介质。The present application relates to the field of storage technology, and more specifically, to a mounting processing method, device, electronic equipment, and computer-readable storage medium.

背景技术Background technique

SD卡或U盘等外部存储设备可以通过卡槽或OTG方式插入终端设备,例如插入手机、数码相机、便携式电脑和其他终端设备上,给用户提供额外的存储服务。External storage devices such as SD cards or U disks can be inserted into terminal devices through card slots or OTG, such as mobile phones, digital cameras, laptops and other terminal devices, to provide users with additional storage services.

在外部存储设备插入终端设备时,终端设备会基于外部存储设备管理模块(Volume Daemon,Vold)和存储管理服务模块(Storage Manager Service)的交互来实现外部存储设备的挂载。在交互过程中,如果有一个环节卡住,就会导致后面的命令无法处理,使得交互耗时过久,容易导致系统无响应或屏幕长时间卡住不动等系统异常情况出现。When an external storage device is inserted into the terminal device, the terminal device will mount the external storage device based on the interaction between the external storage device management module (Volume Daemon, Vold) and the storage management service module (Storage Manager Service). During the interaction process, if a link is stuck, subsequent commands cannot be processed, making the interaction take too long, and it is easy to cause system abnormalities such as the system not responding or the screen being stuck for a long time.

发明内容Contents of the invention

本申请提出了一种挂载处理方法、装置、电子设备及计算机可读取存储介质,以改善上述缺陷。The present application proposes a mounting processing method, device, electronic equipment, and computer-readable storage medium to improve the above defects.

第一方面,本申请实施例提供了一种挂载处理方法,所述方法包括:存储管理服务模块向外部存储设备管理模块发送第一调用指令;外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识,其中,检测操作为检测外部存储设备的文件系统是否异常,检测中标识用于指示存储管理模块外部存储设备管理模块正在执行检测操作且未检测完成;外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令;存储管理服务模块基于检测完成指令通知外部存储设备管理模块对外部存储设备进行挂载。In the first aspect, the embodiment of the present application provides a mount processing method, the method includes: the storage management service module sends a first call instruction to the external storage device management module; the external storage device management module responds to the first call instruction, Execute the detection operation, and set the detection status flag of the external storage device to the detection status flag, and return the detection status flag, wherein, the detection operation is to detect whether the file system of the external storage device is abnormal, and the detection flag is used to indicate that the storage management module external storage The device management module is performing the detection operation and the detection has not been completed; the external storage device management module sends a detection completion instruction to the storage management service module when the detection operation is completed; the storage management service module notifies the external storage device management module based on the detection completion instruction. Mount the storage device.

第二方面,本申请实施例还提供了一种挂载处理装置,所述装置包括:第一调用模块,用于存储管理服务模块向外部存储设备管理模块发送第一调用指令;第一返回模块,用于外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识,其中,检测操作为检测外部存储设备的文件系统是否异常,检测中标识用于指示存储管理模块外部存储设备管理模块正在执行检测操作且未检测完成;检测完成模块,用于外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令;挂载通知模块,用于存储管理服务模块基于检测完成指令通知外部存储设备管理模块对外部存储设备进行挂载。In the second aspect, the embodiment of the present application also provides a mounting processing device, the device includes: a first calling module, used for the storage management service module to send a first calling instruction to the external storage device management module; a first returning module , used for the external storage device management module to perform a detection operation in response to the first call instruction, and set the detection state flag of the external storage device to the detection state flag, and return the detection state flag, wherein the detection operation is to detect the file of the external storage device Whether the system is abnormal, the detecting mark is used to indicate that the storage management module and the external storage device management module are performing the detection operation and the detection has not been completed; the detection completion module is used for the external storage device management module to report to the storage management service module when the detection operation has been completed Sending the detection completion instruction; the mount notification module is used for the storage management service module to notify the external storage device management module to mount the external storage device based on the detection completion instruction.

第三方面,本申请实施例还提供了一种电子设备,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述方法。In a third aspect, the embodiment of the present application also provides an electronic device, including: one or more processors; memory; one or more application programs, wherein the one or more application programs are stored in the memory And configured to be executed by the one or more processors, the one or more programs are configured to execute the above method.

第四方面,本申请实施例还提供了一种计算机可读取存储介质,计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述方法。In a fourth aspect, the embodiment of the present application further provides a computer-readable storage medium, in which program code is stored, and the program code can be invoked by a processor to execute the above method.

本申请提供的挂载处理方法、装置、电子设备及计算机可读取存储介质,通过存储管理服务模块向外部存储设备管理模块发送第一调用指令,接着外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识,其中,检测操作为检测外部存储设备的文件系统是否异常,检测中标识用于指示存储管理模块外部存储设备管理模块正在执行检测操作且未检测完成,然后,外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令,最后存储管理服务模块基于检测完成指令通知外部存储设备管理模块对外部存储设备进行挂载。因此,在需要挂载外部存储设备时,外部存储设备管理模块将在检测操作完成前先返回检测状态标识,并在检测操作完成后进行挂载,使得系统不会因为外部存储设备的文件系统异常导致系统无响应,防止外部存储设备插入导致系统卡死或定屏,从而提升系统稳定性。The mounting processing method, device, electronic equipment, and computer-readable storage medium provided by the present application send the first calling instruction to the external storage device management module through the storage management service module, and then the external storage device management module responds to the first calling instruction , execute the detection operation, and set the detection status flag of the external storage device to the detection status flag, and return the detection status flag, where the detection operation is to detect whether the file system of the external storage device is abnormal, and the detection flag is used to indicate that the storage management module external The storage device management module is performing the detection operation and the detection is not completed. Then, when the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module, and finally the storage management service module notifies the external storage device based on the detection completion instruction The management module mounts the external storage device. Therefore, when an external storage device needs to be mounted, the external storage device management module will return the detection status flag before the detection operation is completed, and mount it after the detection operation is completed, so that the system will not be abnormal due to the file system of the external storage device. Cause the system to become unresponsive, prevent the system from being stuck or freeze when an external storage device is inserted, thereby improving system stability.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1示出了本申请一实施例提供的挂载处理方法的方法流程图;FIG. 1 shows a method flowchart of a mounting processing method provided by an embodiment of the present application;

图2示出了本申请另一实施例提供的挂载处理方法的方法流程图;FIG. 2 shows a method flowchart of a mounting processing method provided by another embodiment of the present application;

图3示出了本申请再一实施例提供的提供的挂载处理方法的方法流程图;Fig. 3 shows a method flow chart of a mounting processing method provided by another embodiment of the present application;

图4示出了本申请又一实施例提供的提供的挂载处理方法的方法流程图;FIG. 4 shows a method flowchart of a mounting processing method provided by another embodiment of the present application;

图5示出了本申请还一实施例提供的提供的挂载处理方法的方法流程图;Fig. 5 shows a method flow chart of a mounting processing method provided by another embodiment of the present application;

图6示出了本申请再另一实施例提供的挂载处理方法的方法流程图;FIG. 6 shows a method flow chart of a mounting processing method provided in another embodiment of the present application;

图7示出了本申请再又一实施例提供的挂载处理方法的方法流程图;FIG. 7 shows a method flow chart of a mounting processing method provided in yet another embodiment of the present application;

图8示出了本申请再还一实施例提供的挂载处理方法的方法流程图;FIG. 8 shows a method flow chart of a mounting processing method provided in yet another embodiment of the present application;

图9示出了本申请又另一实施例提供的挂载处理方法的方法流程图;FIG. 9 shows a method flow chart of a mounting processing method provided in yet another embodiment of the present application;

图10示出了本申请一实施例提供的触发第一调用指令的方法流程图。Fig. 10 shows a flow chart of a method for triggering a first calling instruction provided by an embodiment of the present application.

图11示出了本申请实施例提供的挂载处理装置的模块框图;FIG. 11 shows a block diagram of a mount processing device provided by an embodiment of the present application;

图12示出了本申请实施例提供的电子设备的结构框图;FIG. 12 shows a structural block diagram of an electronic device provided by an embodiment of the present application;

图13示出了本申请实施例的用于保存或者携带实现根据本申请实施例的挂载处理方法的程序代码的存储单元。Fig. 13 shows a storage unit for storing or carrying program codes for implementing the mounting processing method according to the embodiment of the present application according to the embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

套接字(Socket)通信是一种进程间通信(Inter-Process Communication,IPC)机制,在操作系统中,通常会为应用程序提供一组应用程序接口(Application ProgrammingInterface,API),称为套接字接口(Socket API)。应用程序可以通过套接字接口,来使用网络套接字,以进行数据交换。操作系统根据套接字地址,可以决定应该将数据送达特定的行程或线程。Socket通信中,HTTP提供了封装或者显示数据的具体形式,Socket提供了网络通信的能力。Socket (Socket) communication is an inter-process communication (Inter-Process Communication, IPC) mechanism. In the operating system, a set of application programming interfaces (Application Programming Interface, API), called sockets, are usually provided for applications. Word interface (Socket API). Applications can use network sockets for data exchange through the socket interface. Based on the socket address, the operating system can decide that the data should be sent to a specific process or thread. In Socket communication, HTTP provides a specific form of encapsulating or displaying data, and Socket provides the capability of network communication.

Binder通信类似于Socket通信,是一种高效的进程间通信机制,可以实现将进程A的数据发送到进程B。目前,越来越多的终端设备也基于Binder通信机制进行通信,例如,终端设备包含外部存储设备管理模块(Volume Daemon,Vold)以及存储管理服务模块(Storage Manager Service),在对外部存储设备如存储卡、U盘等进行挂载时,需要外部存储设备管理模块与存储管理服务模块之间的交互,其中,该交互则可以基于Binder通信。其中,终端设备包括但不限于手机、数码相机、便携式电脑和其他终端设备。Binder communication is similar to Socket communication. It is an efficient inter-process communication mechanism that can send data from process A to process B. At present, more and more terminal devices also communicate based on the Binder communication mechanism. For example, the terminal device includes an external storage device management module (Volume Daemon, Vold) and a storage management service module (Storage Manager Service). When the memory card, U disk, etc. are mounted, the interaction between the external storage device management module and the storage management service module is required, and the interaction can be based on Binder communication. Among them, terminal equipment includes but not limited to mobile phones, digital cameras, portable computers and other terminal equipment.

但是,发明人在研究中发现,外部存储设备管理模块与存储管理服务模块基于Binder通信挂载外部存储设备的过程中,如果在Binder调用的过程中被卡住可能会触发系统中的看门狗程序,导致系统无响应,出现如系统卡死或定屏等异常情况。However, the inventor found in the research that during the process of mounting the external storage device based on the Binder communication between the external storage device management module and the storage management service module, if it is stuck in the process of Binder calling, the watchdog in the system may be triggered program, causing the system to become unresponsive, and abnormal situations such as system freezing or freezing of the screen appear.

因此,为了解决上述缺陷,本申请实施例提供了一种挂载处理方法,如图1所示,具体地,该方法包括:S101至S104。Therefore, in order to solve the above defects, an embodiment of the present application provides a mounting processing method, as shown in FIG. 1 , specifically, the method includes: S101 to S104.

S101:存储管理服务模块向外部存储设备管理模块发送第一调用指令。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, wherein the external storage device management module is the management and control center of the external storage system in the operating system platform, and is the background for managing and controlling the external storage device of the operating system platform process. Its functions mainly include: detection of plugging and unplugging events of external storage devices, mounting, unmounting and formatting of external storage devices, etc. The storage management service module is a module for the system framework layer of the operating system to communicate with the external storage device management module, and the storage management service module is also a module that provides the access interface of the storage device and broadcasts the mount message of the storage device to the application program. It should be noted that the external storage device management module and the storage management service module are based on inter-process communication. If the communication process between the two is stuck, the system may not respond.

其中,外部存储设备插入终端设备后,终端设备需对该外部存储设备进行挂载,并在挂载成功后,终端设备上的应用程序可以访问该外部存储设备。Wherein, after the external storage device is inserted into the terminal device, the terminal device needs to mount the external storage device, and after the mounting is successful, the application program on the terminal device can access the external storage device.

在一种实施方式中,在终端设备需对外部存储设备进行挂载时,存储管理服务模块向外部存储设备管理模块发送第一调用指令。In one embodiment, when the terminal device needs to mount the external storage device, the storage management service module sends a first call instruction to the external storage device management module.

S102:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S102: The external storage device management module executes a detection operation in response to the first calling instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

其中,检测操作为检测外部存储设备的文件系统是否异常。Wherein, the detection operation is to detect whether the file system of the external storage device is abnormal.

其中,检测中标识用于指示存储管理模块外部存储设备管理模块正在执行检测操作且未检测完成,使得在外部存储设备管理模块返回检测状态标识时,存储管理模块基于该检测状态标识为检测中标识,可以获知外部存储设备正在检测中且未检测完成。具体地,终端设备在检测到外部存储设备的插入事件后,外部存储设备管理模块会创建该外部存储设备,并对应存储有该外部存储设备的设备信息,其中设备信息包括检测状态标识。Wherein, the detecting flag is used to indicate that the storage management module and the external storage device management module are performing the detection operation and the detection has not been completed, so that when the external storage device management module returns the detection state flag, the storage management module is marked as the detection state flag based on the detection state , you can know that the external storage device is being detected and the detection has not been completed. Specifically, after the terminal device detects the insertion event of the external storage device, the external storage device management module will create the external storage device and correspondingly store the device information of the external storage device, wherein the device information includes the detection status identifier.

在一些实施方式中,检测时长包括检测文件系统是否异常的耗时以及外部存储设备管理模块在文件系统异常时进行修复的耗时。例如外部存储设备的文件系统损坏过多,可能引发外部存储设备管理模块对外部存储设备的文件系统尝试修复的耗时过长,而过长的修复时长将导致系统卡住。In some implementations, the detection time includes the time spent in detecting whether the file system is abnormal and the time spent in repairing the file system by the external storage device management module when the file system is abnormal. For example, the file system of the external storage device is damaged too much, which may cause the external storage device management module to take too long to repair the file system of the external storage device, and the too long repair time will cause the system to be stuck.

于本实施例中,响应于第一调用指令,外部存储设备管理模块分别执行检测操作,以及设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识,使得外部存储设备管理模块与存储管理服务模块基于第一调用指令的交互进程无需等待检测操作完成,即可结束,避免了由于检测时长过长导致基于第一调用指令的交互进程卡住,导致系统无响应,具体地,系统无响应包括系统卡死或定屏(屏幕长时间卡住不动,也可称为冻屏或hang机)等系统异常情况,从而可以防止异常外部存储设备插入导致系统不响应,提升系统稳定性。In this embodiment, in response to the first call instruction, the external storage device management module performs detection operations respectively, and sets the detection status flag of the external storage device as the detection status flag, and returns the detection status flag, so that the external storage device management module and The interaction process of the storage management service module based on the first call instruction can end without waiting for the completion of the detection operation, which avoids the interaction process based on the first call instruction being stuck due to too long detection time, causing the system to be unresponsive. Specifically, the system Unresponsiveness includes system abnormalities such as system stuck or fixed screen (the screen is stuck for a long time, also known as frozen screen or hang), so as to prevent the system from not responding due to the insertion of abnormal external storage devices and improve system stability. .

具体地,例如,外部存储设备管理模块响应于第一调用指令,可以将外部存储设备的检测状态标识设置为检测中标识如“checki ng”,在外部存储设备管理模块返回“checking”后,存储管理服务模块可以根据外部存储设备的存储状态标识为“checki ng”,获知外部存储设备正在检测中。Specifically, for example, in response to the first calling instruction, the external storage device management module may set the detection status flag of the external storage device to a detection flag such as "checking", and after the external storage device management module returns "checking", the storage The management service module can learn that the external storage device is being checked according to the storage status of the external storage device as "checking".

S103:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S103: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

于本实施例中,外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令,通知存储管理服务模块对外部存储设备的检测操作已完成,使得存储管理服务模块可以进行下一步操作。In this embodiment, when the detection operation has been completed, the external storage device management module sends a detection completion instruction to the storage management service module, notifying the storage management service module that the detection operation of the external storage device has been completed, so that the storage management service module can perform Next step.

作为一种实施方式,若检测操作的检测时长超过指定时间,结束检测操作,此时检测操作已完成,外部存储设备管理模块向存储管理服务模块发送检测完成指令。需要说明的是,由于在外部存储设备的文件系统是异常时,外部存储设备管理模块尝试对该文件系统进行修复,若修复时间过长且在修复成功之前所耗的检测时长已超过指定时间,则存在当检测操作已完成时,外部存储设备的文件系统仍是异常的情况。即在检测操作已完成时,外部存储设备的文件系统可以是异常的,也可以是非异常的。其中,非异常的情况包括文件系统在检测前即是正常的情况,还可以包括外部存储设备在刚插入时是异常的,但在指定时间内经外部存储设备管理模块修复完成从而恢复正常的情况。As an implementation manner, if the detection duration of the detection operation exceeds a specified time, the detection operation is ended, and the detection operation has been completed at this time, and 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 tries to repair the file system. If the repair time is too long and the detection time before the repair succeeds exceeds the specified time, Then there is a situation that the file system of the external storage device is still abnormal when the detection operation is completed. That is, when the detection operation is completed, the file system of the external storage device may be abnormal or non-abnormal. Among them, the non-abnormal situation includes the situation that the file system is normal before the detection, and it can also include the situation that the external storage device is abnormal when it is just inserted, but it is restored to normal by the external storage device management module within a specified time.

作为另一种实施方式,若检测操作的检测时长超过指定时间,不认为检测操作已完成,即若检测时长过长,在指定时间内未完成检测操作,则认为检测操作未完成,不向存储管理服务模块发送检测完成指令,由此,使得存储管理服务模块无法对外部存储设备进行下一步操作。具体地,由于外部存储设备的文件系统损坏过多,外部存储设备管理模块无法在指定时间内完成对损坏的文件系统的修复。As another implementation, if the detection duration of the detection operation exceeds the specified time, the detection operation is not considered to be completed. The management service module sends a detection completion instruction, thereby preventing the storage management service module from performing the next operation on the external storage device. Specifically, because the file system of the external storage device is damaged too much, the management module of the external storage device cannot finish repairing the damaged file system within a specified time.

需要说明的是,由于外部存储设备管理模块响应于第一调用指令,已完成一次返回,即当次调用线程已结束,而外部存储设备管理模块对外部存储设备执行的检测操作,并不基于与存储管理服务模块之间跨进程通信的线程,而是基于外部存储设备管理模块内部进程内的线程,因此,即便检测时长过长也不会卡住系统进程,也就不会导致系统无响应,从而可以防止由于异常外部存储设备插入终端设备导致的系统卡死或定屏,提升系统稳定性。It should be noted that since the external storage device management module has completed a return in response to the first call instruction, that is, the current calling thread has ended, and the detection operation performed by the external storage device management module on the external storage device is not based on the same The thread of cross-process communication between the storage management service modules is based on the thread in the internal process of the external storage device management module. Therefore, even if the detection time is too long, the system process will not be stuck, and the system will not be unresponsive. In this way, it can prevent the system from freezing or freezing the screen due to the abnormal external storage device being inserted into the terminal device, and improve the system stability.

S104:存储管理服务模块基于检测完成指令通知外部存储设备管理模块对外部存储设备进行挂载。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.

其中,存储管理服务模块基于检测完成指令,可以获知检测操作已完成,此时通知外部存储设备管理模块对外部存储设备进行挂载。Wherein, based on the detection completion instruction, the storage management service module can know that the detection operation has been completed, and at this time, notify the external storage device management module to mount the external storage device.

由此,相较于现有技术中外部存储设备管理模块需在完成检测操作与挂载操作之后才作返回,本实施例通过将检测操作与挂载操作的执行分开,使得外部存储设备管理模块在检测操作完成前,先返回检测状态标识,以结束与存储管理服务模块之间跨进程通信的线程,并在检测操作完成后再进行挂载,因此,可以防止由于对外部存储设备的检测时长过长,导致线程卡住,使得系统无响应,从而可以防止异常外部存储设备插入导致系统卡死或定屏等异常情况,提升系统稳定性。Therefore, compared with the external storage device management module in the prior art, which needs to complete the detection operation and the mounting operation before returning, this embodiment separates the execution of the detection operation from the mounting operation, so that the external storage device management module Before the detection operation is completed, return the detection status flag first to end the thread of cross-process communication with the storage management service module, and mount after the detection operation is completed, so it can prevent the external storage device from being detected for a long time If it is too long, the thread will be stuck, making the system unresponsive, which can prevent abnormal situations such as system freezing or fixed screen caused by abnormal external storage device insertion, and improve system stability.

请参阅图2,示出了本申请实施例提供的一种挂载处理方法,具体地,该方法包括:S201至S207。Please refer to FIG. 2 , which shows a mounting processing method provided by the embodiment of the present application. Specifically, the method includes: S201 to S207.

S201:存储管理服务模块向外部存储设备管理模块发送第一调用指令。S201: The storage management service module sends a first call instruction to the external storage device management module.

作为一种实施方式,第一调用指令包括检测指令,具体地,检测指令可以是用于检测文件系统是否异常、是否有错误的函数Check,也可以是其他在用于检测文件系统是否异常的接口函数,本实施例对此不做限定。基于检测指令,还可以对检测状态标识进行设置或更新等操作。在此实施方式中,存储管理服务模块通过Binder调用将检测指令发送至外部存储设备管理模块。具体地,存储管理服务模块基于Binder通信调用函数Check至外部存储设备管理模块,使得外部存储设备管理模块可以执行函数Check。由此,基于Binder通信可以方便地实现跨进程调用函数。As an implementation, the first call instruction includes a detection instruction, specifically, the detection instruction may be a function Check for detecting whether the file system is abnormal or whether there is an error, or it may be other interfaces used for detecting whether the file system is abnormal. function, which is not limited in this embodiment. Based on the detection instruction, operations such as setting or updating the detection status flag may also be performed. In this implementation manner, 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 the 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. Therefore, based on Binder communication, it is convenient to implement cross-process calling functions.

作为另一种实施方式,检测指令可以是预先加载的,即第一调用指令不包含检测指令,此时,存储管理服务模块向外部存储设备管理模块发送第一调用指令,可以使得外部存储设备管理模块响应于第一调用指令,可以执行预先加载的检测指令,减少进程间的通信数据量,降低函数加载时间,提高通信效率,提高检测效率,进而有利于提高对外部存储设备的挂载效率。As another implementation, the detection instruction may be preloaded, that is, the first call instruction does not contain the detection instruction. At this time, the storage management service module sends the first call instruction to the external storage device management module, which can make the external storage device manage In response to the first call instruction, the module can execute preloaded detection instructions, reduce the amount of communication data between processes, reduce function loading time, improve communication efficiency, improve detection efficiency, and then help improve the mounting efficiency of external storage devices.

S202:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S202: The external storage device management module executes a detection operation in response to the first call instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

其中,检测状态标识可以是对应外部存储设备的用于反映当前检测状态的标志位,通过该标识位,可以获知当前检测的状态,例如,若该标志位为检测中标识如“Checking”,可以表示外部存储设备管理模块正在对外部存储设备执行检测操作且未检测完成,存储管理服务模块通过接收外部存储设备管理模块返回的检测状态标识,可以获知当前检测的状态为正在执行检测操作且未检测完成。Wherein, the detection state flag can be a flag bit corresponding to the external storage device used to reflect the current detection state, through which the state of the current detection can be known, for example, if the flag bit is a flag in detection such as "Checking", you can Indicates that the external storage device management module is performing a detection operation on the external storage device and the detection has not been completed. The storage management service module can know that the current detection status is performing the detection operation and not detected by receiving the detection status identifier returned by the external storage device management module. Finish.

于本实施例中,外部存储设备管理模块响应于第一调用指令,可以基于两个不同的线程分别执行检测操作和设置外部存储设备的检测状态标识并返回检测状态标识。具体地,外部存储设备管理模块响应于第一调用指令,基于第一线程设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识,使得第一线程在接收到第一调用指令后立刻返回执行结束了,并且外部存储设备管理模块响应于第一调用指令,基于第二线程执行检测操作。In this embodiment, in response to the first calling instruction, the external storage device management module may respectively perform the detection operation and set the detection state flag of the external storage device based on two different threads, and return the detection state flag. Specifically, in response to the first call instruction, the external storage device management module sets the detection state flag of the external storage device as a detection flag based on the first thread, and returns the detection state flag, so that the first thread receives the first call instruction Immediately returning execution ends, and the external storage device management module performs a detection operation based on the second thread in response to the first calling instruction.

其中,第一线程是基于Binder调用的跨进程的线程,即主线程,而第二线程是外部存储设备管理模块进程内的线程,由此,本实施例通过第一线程在接收到第一调用指令之后,立刻返回执行结束了,使得本次Binder调用的线程可以及时结束,并且开启第二线程执行实际的检测操作,使得实际的检测时长,并且其中还包含的修复时长不影响主线程,即基于第二线程执行可能导致Binder调用卡住的检测操作,使得基于Binder调用的第一线程可以得到及时甚至快速的响应,很好地避免了由于检测时长过长导致的系统无响应,防止了异常外部存储设备插入导致的系统卡死或定屏等异常情况发生,大大提升了系统的稳定性。Wherein, the first thread is a cross-process thread based on the Binder call, that is, the main thread, and the second thread is a thread in the process of the external storage device management module. Therefore, in this embodiment, the first thread receives the first call through the first thread. After the instruction, the execution is returned immediately, so that the thread called by Binder can end in time, and the second thread is started to perform the actual detection operation, so that the actual detection duration and the repair duration included in it will not affect the main thread, that is Based on the detection operation that may cause the Binder call to be stuck based on the second thread, the first thread based on the Binder call can get a timely or even fast response, which well avoids the system being unresponsive due to the long detection time and prevents exceptions. Abnormal situations such as system freezing or fixed screen caused by the insertion of external storage devices have greatly improved the stability of the system.

作为一种实施方式,第一进程先于第二进程进行,具体地,外部存储设备管理模块响应于第一调用指令,先基于第一线程设置检测状态标识为检测中标识,并返回检测状态标识,此时再开启第二线程,基于第二线程执行检测操作。As an implementation, the first process is performed before the second process. Specifically, the external storage device management module responds to the first call instruction, first sets the detection status flag as the detection flag based on the first thread, and returns the detection status flag , and then start the second thread at this time, and perform the detection operation based on the second thread.

作为另一种实施方式,第一进程与第二进程同时进行,具体地,外部存储设备管理模块响应于第一调用指令,同时设置检测状态标识以及开启第二线程并基于第二线程执行检测操作,在检测操作完成前即可立刻返回检测状态标识,并且由于第二线程与第一线程同时进行,使得外部存储设备管理模块响应于第一调用指令,在可以及时结束Binder调用的基础上,还可以更快执行检测操作,提高检测效率,同时更高的检测效率还有利于提高对外部存储设备的挂载效率。As another implementation, the first process and the second process are performed at the same time, specifically, the external storage device management module responds to the first call instruction, simultaneously sets the detection status flag and starts the second thread, and performs the detection operation based on the second thread , the detection status flag can be returned immediately before the detection operation is completed, and since the second thread and the first thread are carried out simultaneously, the external storage device management module can respond to the first call instruction and end the Binder call in time. The detection operation can be performed faster, and the detection efficiency is improved, and the higher detection efficiency is also conducive to improving the mounting efficiency of the external storage device.

其中,检测操作为检测外部存储设备的文件系统是否异常,并针对异常的文件系统进行修复。需要说明的是,检测操作包括在检测到异常时,对异常的文件系统进行修复的操作,故本实施例中,检测时长包括修复时长。具体地,若文件系统存在损坏,则异常,无损坏则正常,并在异常时外部存储设备管理模块将尝试修复异常的文件系统。进一步地,若修复完成,此时文件系统无损坏,可以认为是无异常即正常的。Wherein, the detection operation is to detect whether the file system of the external storage device is abnormal, and repair the abnormal file system. It should be noted that the detection operation includes the operation of repairing the abnormal file system when an abnormality is detected, so in this embodiment, the detection duration includes the repair duration. Specifically, if the file system is damaged, it is abnormal, and if there is no damage, it is normal, and the external storage device management module will try to repair the abnormal file system when abnormal. Further, if the restoration is completed, the file system is not damaged at this time, and it can be considered normal without exception.

在一些实施方式中,若文件系统正常或者文件系统异常且修复完成,则外部存储设备管理模块判定检测操作已完成,并且若文件系统异常且未修复完成,则文件系统仍处于异常状态,外部存储设备管理模块判定检测操作未完成。其中:In some embodiments, if the file system is normal or the file system is abnormal and the repair is completed, the external storage device management module determines that the detection operation has been completed, and if the file system is abnormal and the repair is not completed, the file system is still in an abnormal state, and the external storage device The device management module determines that the detection operation is not completed. in:

作为一种方式,若文件系统正常或者文件系统异常且修复完成,则外部存储设备管理模块判定检测操作已完成;若文件系统异常且无法修复,则外部存储设备管理模块判定检测操作未完成。由此,对于检测操作不限时长,并当文件系统异常时,判定检测操作未完成。从而在修复完成时,可以及时判定检测操作已完成,以便进行下一步操作。As a method, if the file system is normal or the file system is abnormal and the repair is completed, the external storage device management module determines that the detection operation has been completed; if the file system is abnormal and cannot be repaired, the external storage device management module determines that the detection operation is not completed. Thus, there is no time limit for the detection operation, and when the file system is abnormal, it is determined that the detection operation is not completed. Therefore, when the restoration is completed, it can be determined in time that the detection operation has been completed, so as to proceed to the next operation.

作为另一种方式,外部存储设备管理模块的检测操作对应设置有预设时长,并在文件系统异常且在预设时长内未修复完成时,即检测时长超过预设时长时,判定检测操作未完成。具体地,若检测到文件系统正常,此时无需修复,外部存储设备管理模块判定检测操作已完成;若检测到文件系统异常但在预设时长内修复完成,则外部存储设备管理模块判定检测操作已完成;若检测时长超过预设时长但仍未修复完成,此时外部存储设备管理模块检测到文件系统异常,但在预设时长内损坏的文件系统未被修复完成,则判定检测操作未完成。由此,可以控制检测操作的执行时间,可以及时作出响应以便进行下一步操作,从而保证检测效率的同时,避免检测超时无响应,提高系统可用性。As another way, the detection operation of the external storage device management module is correspondingly set with a preset duration, and when the file system is abnormal and has not been repaired within the preset duration, that is, when the detection duration exceeds the preset duration, it is determined that the detection operation is not completed. Finish. Specifically, if it is detected that the file system is normal and there is no need to repair it at this time, the external storage device management module determines that the detection operation has been completed; Completed; if the detection time exceeds the preset time but the repair is still not completed, the external storage device management module detects an abnormal file system at this time, but the damaged file system has not been repaired within the preset time, then it is determined that the detection operation has not been completed . In this way, the execution time of the detection operation can be controlled, and a response can be made in time for the next operation, so as to ensure the detection efficiency, avoid detection timeout and no response, and improve system availability.

在另一些实施方式中,外部存储设备管理模块的检测操作对应设置有预设时长,并在文件系统异常且在预设时长内未修复完成时,即检测时长超过预设时长时,仍判定检测操作已完成。具体地,若文件系统正常或者文件系统异常且修复完成,则外部存储设备管理模块判定检测操作已完成,并且若文件系统异常且在预设时长内未修复完成,则文件系统仍处于异常状态,此时外部存储设备管理模块仍判定检测操作完成。也就是,检测操作最多可以执行预设时长,并且达到预设时长时,判定检测操作已完成,此时包括文件系统可以是正常的,也可以是异常的。由此,可以控制检测操作的执行时间,并在文件系统未修复完成时仍判定检测操作已完成,可以及时作出响应以便进行下一步操作,从而保证检测效率的同时,避免检测超时无响应,提高系统可用性。In some other implementations, the detection operation of the external storage device management module is correspondingly set with a preset duration, and when the file system is abnormal and has not been repaired within the preset duration, that is, when the detection duration exceeds the preset duration, it is still determined that the detection Operation complete. Specifically, if the file system is normal or the file system is abnormal and the repair is completed, the external storage device management module determines that the detection operation has been completed, and if the file system is abnormal and the repair is not completed within the preset time length, the file system is still in the abnormal state, At this time, the external storage device management module still determines that the detection operation is completed. That is, the detection operation can be performed for a preset duration at most, and when the preset duration is reached, it is determined that the detection operation has been completed. At this time, the file system may be normal or abnormal. In this way, the execution time of the detection operation can be controlled, and the detection operation can still be judged to be completed when the file system has not been repaired, and a response can be made in time for the next operation, thereby ensuring detection efficiency while avoiding detection timeout and no response, improving System availability.

进一步地,在检测时长超过预设时长时,外部存储设备管理模块可以终止检测操作,也可以不终止,具体的实施方式如下:Further, when the detection duration exceeds the preset duration, the external storage device management module may or may not terminate the detection operation. The specific implementation method is as follows:

在一种实施方式中,在检测时长超过预设时长时,外部存储设备管理模块可以终止检测操作,节省资源,提高系统可用性。In an implementation manner, when the detection duration exceeds a preset duration, the external storage device management module may terminate the detection operation to save resources and improve system availability.

在另一种实施方式中,在检测时长超过预设时长时,外部存储设备管理模块也可以不终止检测操作,使得检测操作继续,具体地,在文件系统损坏过多时,外部存储设备管理模块要完成对所有异常的文件系统的修复,所需时长较长,并且所需时长可能超过预设时长,此时通过在检测时长超过预设时长时,仍不中断检测操作,使得外部存储设备管理模块可以继续修复,由此,存在在挂载操作执行前,完成修复的可能,此时检测操作未完成的外部存储设备仍具有可被成功挂载的可能。具体的实施方式,可以参见后述实施例,本实施例不再赘述。In another embodiment, when the detection duration exceeds the preset duration, the external storage device management module may not terminate the detection operation, so that the detection operation continues. Specifically, when the file system is damaged too much, the external storage device management module needs to It takes a long time to complete the repair of all abnormal file systems, and the required time may exceed the preset time. At this time, when the detection time exceeds the preset time, the detection operation is still not interrupted, so that the external storage device management module The repair can be continued, thus, there is a possibility that the repair can be completed before the mount operation is performed, and at this time, the external storage device whose detection operation has not been completed may still be successfully mounted. For specific implementation manners, reference may be made to the following embodiments, and details will not be repeated in this embodiment.

进一步地,于本实施例中,在检测时长超过预设时长时,可以执行S204;在检测时长未超过预设时长时,可以执行S203。Further, in this embodiment, when the detection duration exceeds the preset duration, S204 may be executed; when the detection duration does not exceed the preset duration, S203 may be executed.

S203:当检测时长超过预设时长时,外部存储设备管理模块设置检测状态标识为检测异常标识。S203: When the detection duration exceeds the preset duration, the external storage device management module sets the detection status flag as a detection abnormality flag.

其中,检测状态标识还包括检测异常标识,该检测异常标识可以用于指示存储管理服务模块当前检测异常,即检测时长超过预设时长仍未修复完成,此时外部存储设备的文件系统仍异常。Wherein, the detection status flag also includes a detection abnormality flag, which can be used to indicate that the storage management service module is currently detecting an abnormality, that is, the detection time exceeds the preset time and has not been repaired, and the file system of the external storage device is still abnormal at this time.

于本实施例中,当检测时长超过预设时长时,外部存储设备管理模块设置检测状态标识为检测异常标识。具体地,在一种实施方式中,检测异常标识可以是数字、字母、单词等字符串,如“0”、“uncheckable”等用于表征经检测操作后文件系统仍异常,可以是系统预设的,也可以是自定义的,从而通过该检测异常标识,可以获知文件系统异常,另外,本实施例对检测异常标识的命名形式不做其他限定。In this embodiment, when the detection duration exceeds the preset duration, the external storage device management module sets the detection status flag as a detection abnormality flag. Specifically, in one implementation, the abnormality detection flag can be a string of numbers, letters, words, etc., such as "0", "uncheckable", etc., used to indicate that the file system is still abnormal after the detection operation, and can be a system preset It can also be self-defined, so that the abnormality of the file system can be known through the abnormality detection flag. In addition, this embodiment does not make other restrictions on the naming form of the abnormality detection flag.

由于文件系统异常时,外部存储设备难以挂载成功,故当文件系统异常且在预设时长内未修复完成时,通过设置检测异常标识,可以在检测到检测异常标识时,不对该外部存储设备进行挂载,从而减少不必要的资源消耗,提高响应效率。具体的实施方式,可见后述实施例,在此不作赘述。When the file system is abnormal, it is difficult for the external storage device to mount successfully. Therefore, when the file system is abnormal and has not been repaired within the preset time, by setting the abnormal detection flag, the external storage device will not be detected when the abnormal detection flag is detected. Mount to reduce unnecessary resource consumption and improve response efficiency. Specific implementation manners can be seen in the following embodiments, and details are not repeated here.

S204:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S204: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

于本实施例中,在检测操作已完成时,外部存储设备的文件系统可以是正常的,也可以是异常的,其中正常的包括本身即正常的情况,以及异常但修复完成的情况。In this embodiment, when the detection operation is completed, the file system of the external storage device may be normal or abnormal, wherein the normal includes the normal itself and the abnormal but repaired.

作为一种实施方式,若文件系统异常且在预设时长内未修复完成,即检测时长超过预设时长时,仍判定检测操作已完成,此时通过外部存储设备管理模块向存储管理服务模块发送检测完成指令,使得存储管理服务模块通过接收到该检测完成指令,可以获知当前外部存储设备已完成检测操作,可以进行挂载。此时,外部存储设备的文件系统可以异常的,也可以是非异常的。As an implementation, if the file system is abnormal and has not been repaired within the preset time period, that is, when the detection time exceeds the preset time period, it is still determined that the detection operation has been completed. At this time, the external storage device management module sends the file system to the storage management service module. The detection completion instruction enables the storage management service module to know that the current external storage device has completed the detection operation and can be mounted after receiving the detection completion instruction. At this time, the file system of the external storage device may be abnormal or non-abnormal.

作为另一种实施方式,若文件系统异常且在预设时长内未修复完成,即检测时长超过预设时长时,判定检测操作未完成,此时通过外部存储设备管理模块向存储管理服务模块发送检测完成指令,使得存储管理服务模块通过接收到该检测完成指令,可以获知当前外部存储设备是正常的,可以进行挂载。此时,外部存储设备的文件系统是非异常的,即在外部存储设备的文件系统仍异常时,不发送检测完成指令。As another implementation, if the file system is abnormal and has not been repaired within the preset time, that is, when the detection time exceeds the preset time, it is determined that the detection operation has not been completed. At this time, the external storage device management module sends the The detection completion instruction enables the storage management service module to know that the current external storage device is normal and can be mounted after receiving the detection completion instruction. At this time, the file system of the external storage device is not abnormal, that is, when the file system of the external storage device is still abnormal, no detection completion instruction is sent.

S205:存储管理服务模块基于检测完成指令通知外部存储设备管理模块对外部存储设备进行挂载。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, based on the detection completion instruction, the storage management service module can determine that the current external storage device has completed the detection operation and can be mounted, and at this time notifies the external storage device management module to mount the external storage device. Therefore, the detection operation and the mounting operation are performed separately in different threads, and the file system of the external storage device is mounted only when the detection operation determines that the file system of the external storage device is normal, which can improve the success rate and efficiency of the mounting.

S206:外部存储设备管理模块对外部存储设备进行挂载时,确定是否能够查找到检测异常标识。S206: When the external storage device management module mounts the external storage device, it is determined whether the detected abnormality identifier can be found.

在一些实施方式中,若文件系统异常且在预设时长内未修复完成,即检测时长超过预设时长时,仍判定检测操作已完成,外部存储设备管理设备管理模块对外部存储设备进行挂载时,确定是否能够查找到检测异常标识,具体地,例如,基于表征检测状态的标志位,判断该标志位上的检测状态标识是否位检测异常标识;再如,可以直接查找对应该外部存储设备是否存储检测异常标识。In some embodiments, if the file system is abnormal and has not been repaired within the preset time period, that is, when the detection time exceeds the preset time period, it is still determined that the detection operation has been completed, and the external storage device management module mounts the external storage device When determining whether the abnormal detection flag can be found, specifically, for example, based on the flag bit representing the detection state, it is judged whether the detection state flag on the flag bit is an abnormal detection flag; Whether to store detected exception flags.

在另一些实施方式中,若文件系统异常且在预设时长内未修复完成,即检测时长超过预设时长时,判定检测操作未完成,则在S205之后不执行S206至S207,此时,外部存储设备的文件系统是非异常的,也就无需查找检测异常标识。In other embodiments, if the file system is abnormal and has not been repaired within the preset time period, that is, when the detection time exceeds the preset time period, it is determined that the detection operation has not been completed, and then S206 to S207 are not executed after S205. At this time, the external The file system of the storage device is non-abnormal, so there is no need to find and detect an abnormality identifier.

进一步地,若能够查找到检测异常标识,可以执行S207;若不能够,可以继续执行挂载操作。Further, if the detected abnormality identification can be found, S207 can be executed; if not, the mounting operation can be continued.

S207:若能够,则停止对外部存储设备进行挂载。S207: If possible, stop mounting the external storage device.

若能够查找到检测异常标识,此时外部存储设备管理模块判定外部存储设备的文件系统为异常,通过停止对外部存储设备进行挂载,可以降低运行资源的消耗,提高系统运行效率,并有利于提高挂载效率。If the abnormality detection flag can be found, the external storage device management module determines that the file system of the external storage device is abnormal. By stopping the external storage device from being mounted, the consumption of operating resources can be reduced, the operating efficiency of the system can be improved, and it is beneficial to Improve loading efficiency.

需要说明的是,上述步骤中未详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that, for parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

本实施例提供的挂载处理方法,通过将检测操作和挂载操作分开在不同的线程执行,通过外部存储设备管理模块在接收到第一调用指令之后,立刻返回使得本次Binder调用的线程可以及时结束,并开启第二线程执行实际的检测操作,使得实际的检测时长,并且其中还包含的修复时长不影响主线程,即基于第二线程执行可能导致Binder调用卡住的检测操作,避免了由于检测时长过长导致的系统无响应,防止了异常外部存储设备插入导致的系统卡死或定屏等异常情况发生,大大提升了系统的稳定性。并且,通过确定是否能够找到检测异常标识,使得外部存储设备管理设备在外部存储设备的文件系统是非异常时,才继续进行挂载,还可以提高挂载成功率以及效率,另外,由于外部存储设备管理模块在文件系统异常时不进行挂载,还可以减少不必要的资源消耗,提高系统运行效率。The mount processing method provided by this embodiment, by separating the detection operation and the mount operation into different threads, the external storage device management module returns immediately after receiving the first call instruction so that the thread called by the Binder can End in time, and start the second thread to perform the actual detection operation, so that the actual detection time, and the repair time included in it will not affect the main thread, that is, the detection operation that may cause the Binder call to be stuck based on the second thread execution, avoiding The system does not respond due to too long detection time, which prevents abnormal situations such as system freezing or fixed screen caused by the insertion of abnormal external storage devices, and greatly improves the stability of the system. Moreover, by determining whether the detection abnormality mark can be found, the external storage device management device continues to mount when the file system of the external storage device is normal, which can also improve the success rate and efficiency of the mount. In addition, because the external storage device The management module does not mount when the file system is abnormal, which can also reduce unnecessary resource consumption and improve system operating efficiency.

另外,在检测时长超过预设时长时,也可以结束本次方法,不进行下一步操作。具体地,请参阅图3,该方法包括:S301至S303。In addition, when the detection duration exceeds the preset duration, the current method may also be terminated without performing the next step. Specifically, referring to FIG. 3 , the method includes: S301 to S303.

S301:存储管理服务模块向外部存储设备管理模块发送第一调用指令。S301: The storage management service module sends a first call instruction to the external storage device management module.

S302:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S302: The external storage device management module executes a detection operation in response to the first call instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

S303:当检测时长超过预设时长时,外部存储设备管理模块设置检测状态标识为检测异常标识。S303: When the detection duration exceeds the preset duration, the external storage device management module sets the detection status flag as a detection abnormality flag.

于本实施例中,当检测时长超过预设时长时,结束本次方法,使得在文件系统异常且在预设时长内未修复完成时,不通知存储管理服务模块而结束本次方法,可以大大减少运行资源的消耗,提高系统运行效率。In this embodiment, when the detection duration exceeds the preset duration, the method is ended, so that when the file system is abnormal and has not been repaired within the preset duration, the storage management service module is not notified and the method is terminated, which can be greatly improved. Reduce the consumption of operating resources and improve the operating efficiency of the system.

进一步地,作为一种方式,当检测时长超过预设时长时,可以先执行S303,再结束本次方法。此时外部存储设备管理模块设置检测状态标识为检测异常标识,使得在存储管理服务模块获取到外部存储设备的检测状态标识时,可以获知外部存储设备的文件系统处于异常状态,从而使得用户可以及时尝试重新挂载。Further, as a way, when the detection duration exceeds the preset duration, S303 may be executed first, and then this method ends. At this time, the external storage device management module sets the detection status identification as the abnormal detection identification, so that when the storage management service module obtains the detection status identification of the external storage device, it can know that the file system of the external storage device is in an abnormal state, so that the user can timely Try remounting.

作为另一种方式,当检测时长超过预设时长时,可以不执行S303,而结束本次方法。此时存储管理服务模块认为外部存储设备一直处于检测中,仍在执行检测操作,具体地,外部存储设备对应地检测状态一直为“Checking”。As another manner, when the detection duration exceeds the preset duration, S303 may not be executed, and this method ends. At this time, the storage management service module considers that the external storage device has been being checked and is still performing the checking operation. Specifically, the corresponding detection status of the external storage device is always "Checking".

S304:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S304: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

S305:存储管理服务模块基于检测完成指令通知外部存储设备管理模块对外部存储设备进行挂载。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, for the part described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

本实施例提供的挂载处理方法,在前述实施例的基础上,通过在检测时长超过预设时长时,结束本次方法,可以大大减少运行资源的消耗,提高运行效率,并且可以使得用户通过重新插入外部存储设备或其他措施,重新尝试挂载,提高用户挂载体验。The mounting processing method provided in this embodiment, on the basis of the foregoing embodiments, terminates the method when the detection duration exceeds the preset duration, which can greatly reduce the consumption of operating resources, improve operating efficiency, and allow users to pass Reinsert the external storage device or take other measures to retry the mount to improve the user mount experience.

请参阅图4,示出了本申请实施例提供的一种挂载处理方法,具体地,该方法包括:S401至S404。Please refer to FIG. 4 , which shows a mounting processing method provided by the embodiment of the present application. Specifically, the method includes: S401 to S404.

S401:存储管理服务模块向外部存储设备管理模块发送第一调用指令。S401: The storage management service module sends a first call instruction to the external storage device management module.

S402:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S402: The external storage device management module executes a detection operation in response to the first call instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

S403:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S403: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

上述S401至S403的具体实施方式可参考前述实施例,在此不再赘述。For specific implementation manners of the foregoing S401 to S403, reference may be made to the foregoing embodiments, and details are not repeated here.

S404:存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令。S404: The storage management service module sends a second call instruction to the external storage device management module in response to the detection completion instruction.

其中,第二调用指令用于通知外部存储设备管理模块对外部存储设备进行挂载。Wherein, the second calling instruction is used to notify the external storage device management module to mount the external storage device.

作为一种实施方式,存储管理服务模块响应于检测完成指令,通过Binder调用将挂载指令发送至外部存储设备管理模块,其中,第二调用指令包括挂载指令,例如,挂载指令可以是用于挂载外部存储设备的函数Mount,也可以是其他用于挂载外部存储设备的接口函数,本实施例对此不作限定。具体地,存储管理服务模块基于Binder通信调用函数Mount至外部存储设备管理模块,使得外部存储设备管理模块可以执行函数Mount,执行挂载操作。As an implementation, the storage management service module sends the mount instruction to the external storage device management module through a Binder call in response to the detection completion instruction, wherein the second call instruction includes the mount instruction, for example, the mount instruction can be The function Mount for mounting an external storage device may also be other interface functions for mounting an 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 perform a mount operation.

作为另一种实施方式,挂载指令可以是预先加载的,即第二调用指令不包括挂载指令,此时,存储管理服务模块向外部存储设备管理模块发送第二调用指令,可以使得外部存储设备管理模块响应于第二调用指令,可以执行预先加载的挂载指令,减少进程间的通信数据量,降低函数加载时间,提高通信效率的同时提高挂载效率。As another implementation, the mount instruction may be preloaded, that is, the second call instruction does not include the mount instruction. At this time, the storage management service module sends the second call instruction to the external storage device management module, which can make the external storage In response to the second calling instruction, the device management module can execute the preloaded mounting instruction, reduce the amount of communication data between processes, reduce the function loading time, improve communication efficiency and improve mounting efficiency.

请参阅图5,示出了本申请实施例提供的一种挂载处理方法,具体地,该方法包括:S501至S507。Please refer to FIG. 5 , which shows a mounting processing method provided by the embodiment of the present application. Specifically, the method includes: S501 to S507.

S501:存储管理服务模块向外部存储设备管理模块发送第一调用指令。S501: The storage management service module sends a first calling instruction to the external storage device management module.

S502:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S502: The external storage device management module executes a detection operation in response to the first call instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

S503:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S503: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

S504:存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令。S504: The storage management service module sends a second call instruction to the external storage device management module in response to the detection completion instruction.

S505:外部存储设备管理模块响应于第二调用指令,根据检测状态标识,判断外部存储设备的文件系统是否异常。S505: The external storage device management module determines whether the file system of the external storage device is abnormal according to the detection status flag in response to the second calling instruction.

于本实施例中,外部存储设备管理模块响应于第二调用指令,根据外部存储设备对应的检测状态标识,判断外部存储设备的文件系统是否异常。具体地,若当前的检测状态标识为检测异常标识,外部存储设备的文件系统异常,否则非异常,即文件系统正常。In this embodiment, the external storage device management module determines whether the file system of the external storage device is abnormal according to the detection status identifier corresponding to the external storage device in response to the second call instruction. Specifically, if the current detection status flag is a detection abnormality flag, the file system of the external storage device is abnormal; otherwise, it is not abnormal, that is, the file system is normal.

本实施例中,S505之后,若非异常,可以执行S506;若异常,可以执行S508。In this embodiment, after S505, if there is no abnormality, S506 can be executed; if there is an abnormality, S508 can be executed.

S506:外部存储设备管理模块获取挂载结果。S506: The external storage device management module acquires a mounting result.

若非异常,此时外部存储设备管理模块检测到外部存储设备的文件系统非异常,外部存储设备管理模块对外部存储设备执行挂载操作,获取挂载结果。具体地,外部存储设备管理模块基于挂载指令,如用于挂载的函数Mount,通过执行该函数Mount,对外部存储设备执行挂载操作,获取挂载结果。其中,挂载结果包括挂载成功和挂载失败。If it 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 performs a mount operation on the external storage device to obtain a mount result. Specifically, the external storage device management module executes a mount operation on the external storage device based on a mount command, such as a function Mount for mounting, and obtains a mount result. Wherein, the mount result includes mount success and mount failure.

S507:外部存储设备管理模块根据挂载结果,设置挂载状态标识。S507: The external storage device management module sets a mounting state identifier according to the mounting result.

具体地,挂载状态标识可以是一个用于表征挂载状态的标志位,例如,若挂载状态标识为“unmountable”,表征外部存储设备无法挂载,若挂载状态标识为“mounted”,表征外部存储设备已挂载。需要说明的是,只要挂载状态标识可以用于表征挂载状态,本实施例对挂载状态标识的命名形式不作其他限定。Specifically, the mount status identifier may be a flag bit used to represent the mount status. For example, if the mount status identifier is "unmountable", it indicates that the external storage device cannot be mounted; if the mount status identifier is "mounted", Indicates that the external storage device is mounted. It should be noted that, as long as the mounting state identifier can be used to represent the mounting state, this embodiment does not impose other limitations on the naming form of the mounting state identifier.

作为一种实施方式,若挂载成功,设置挂载状态标识为已挂载标识,如“mounted”;若挂载失败,设置挂载状态标识为无法挂载标识,如“unmountable”,或设置为未挂载标识,如“unmounted”。从而使得存储管理服务模块通过获取挂载状态标识可以获知对应的挂载结果。As an implementation, if the mount is successful, set the mount status flag to the mounted flag, such as "mounted"; if the mount fails, set the mount status flag to the unmountable flag, such as "unmountable", or set Unmounted flag, such as "unmounted". Therefore, the storage management service module can obtain the corresponding mounting result by obtaining the mounting state identifier.

S508:设置外部存储设备的挂载状态标识为无法挂载标识。S508: Set the mount status flag of the external storage device as an flag that cannot be mounted.

若异常,此时外部存储设备管理模块检测到外部存储设备的文件系统异常,此时设置外部存储设备的挂载状态标识为无法挂载标识,使得外部存储设备管理模块无法对外部存储设备进行挂载。由于文件系统异常时,对外部存储设备挂载成功的可能性低,因此通过判断外部存储设备的文件系统是否异常,可以判断挂载成功的可能性,从而在实际执行挂载操作前作出预判,并在文件系统异常时,停止挂载,可以节省资源,提高挂载效率。If it is abnormal, the external storage device management module detects that the file system of the external storage device is abnormal. At this time, the mount status flag of the external storage device is set as an unmountable flag, so that the external storage device management module cannot mount the external storage device. load. When the file system is abnormal, the possibility of successfully mounting the external storage device is low. Therefore, by judging whether the file system of the external storage device is abnormal, the possibility of successful mounting can be judged, so as to make a prediction before actually performing the mounting operation. , and when the file system is abnormal, stop mounting, which can save resources and improve mounting efficiency.

作为一种实施方式,S508之后可以结束本次方法,即设置挂载状态标识后再结束本次方法,使得存储管理服务模块可以获取该挂载状态标识,从而获知当前插入的外部存储设备无法挂载,使得用户可以采取措施重新挂载该外部存储设备,如重新插入等,提升用户挂载外部存储设备的用户体验。As an implementation, after S508, this method can be ended, that is, after setting the mounting status identifier, this method can be ended, so that the storage management service module can obtain the mounting status identifier, so as to know that the currently inserted external storage device cannot be mounted. Mount, so that the user can take measures to remount the external storage device, such as reinserting, etc., to improve the user experience of mounting the external storage device.

作为另一种实施方式,S508之前可以结束本次方法,即若外部存储设备管理模块判断外部存储设备的文件系统异常,不执行S508,而结束本次方法。进一步节省挂载所需的运行资源,由于在文件系统异常时,难以对外部存储设备挂载成功,因此,本实施方式通过在文件系统异常时,不执行实际的挂载操作,例如不执行函数Mount等操作,而结束本次方法,可以减少不必要的运行资源。As another implementation manner, this method may end before S508, that is, if the external storage device management module determines that the file system of the external storage device is abnormal, S508 is not executed, and this method ends. To further save the running resources required for mounting, since it is difficult to successfully mount the external storage device when the file system is abnormal, this embodiment does not perform the actual mounting operation when the file system is abnormal, for example, does not execute the function Mount and other operations, and ending this method can reduce unnecessary running resources.

作为又一种实施方式,S508之后可以将无法挂载标识发送至存储管理服务模块,使得存储管理服务模块可以获知外部存储设备的当前挂载状态。具体的实施方式,可以参考后述实施例,在此不再赘述。As yet another implementation manner, after S508, the unmountable identifier may be sent to the storage management service module, so that the storage management service module may know the current mount status of the external storage device. For specific implementation manners, reference may be made to the following embodiments, and details are not repeated here.

需要说明的是,上述步骤中未详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that, for parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

本实施例提供的挂载处理方法,由于文件系统异常时,对外部存储设备挂载成功的可能性低,因此在前述实施例的基础上,本实施例通过判断外部存储设备的文件系统是否异常,可以判断挂载成功的可能性,从而在实际执行挂载操作前作出预判,并在文件系统异常时不进行挂载操作,可以节省资源,提高挂载效率。The mounting processing method provided in this embodiment, because when the file system is abnormal, the possibility of successfully mounting the external storage device is low, so on the basis of the foregoing embodiments, this embodiment judges whether the file system of the external storage device is abnormal , the possibility of successful mounting can be judged, so that a prediction can be made before the actual execution of the mounting operation, and the mounting operation will not be performed when the file system is abnormal, which can save resources and improve mounting efficiency.

另外,外部存储设备管理模块在判定外部存储设备的文件系统异常,并设置外部存储设备的挂载状态标识为无法挂载标识时,可以不执行挂载操作,但将无法挂载标识发送至存储管理服务模块,使得存储管理服务模块可以广播对应的挂载结果。具体地,请参阅图6,示出了本申请实施例提供的一种挂载处理方法,具体地,该方法包括:S601至S610。In addition, when the external storage device management module determines that the file system of the external storage device is abnormal, and sets the mount status flag of the external storage device as an unmountable flag, it may not perform the mount operation, but sends the unmountable flag to the storage device. The management service module enables the storage management service module to broadcast the corresponding mounting result. Specifically, please refer to FIG. 6 , which shows a mounting processing method provided by the embodiment of the present application. Specifically, the method includes: S601 to S610.

S601:存储管理服务模块向外部存储设备管理模块发送第一调用指令。S601: The storage management service module sends a first calling instruction to the external storage device management module.

S602:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S602: The external storage device management module executes a detection operation in response to the first calling instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

S603:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S603: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

S604:存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令。S604: The storage management service module sends a second call instruction to the external storage device management module in response to the detection completion instruction.

S605:外部存储设备管理模块响应于第二调用指令,根据检测状态标识,判断外部存储设备的文件系统是否异常。S605: The external storage device management module determines whether the file system of the external storage device is abnormal according to the detection status flag in response to the second calling instruction.

于本实施例中,若非异常,可以执行S606;若异常,可以执行S608。In this embodiment, if it is not abnormal, S606 may be executed; if abnormal, S608 may be executed.

S606:外部存储设备管理模块获取挂载结果。S606: The external storage device management module acquires a mounting result.

S607:外部存储设备管理模块根据挂载结果,设置挂载状态标识。S607: The external storage device management module sets a mounting state identifier according to the mounting result.

S608:设置外部存储设备的挂载状态标识为无法挂载标识。S608: Set the mount state flag of the external storage device as the flag that cannot be 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 flag of the external storage device is set as an unmountable flag.

S609:外部存储设备管理模块在当前挂载已完成时,向存储管理服务模块发送挂载完成指令。S609: When the current mounting is completed, the external storage device management module sends a mounting completion instruction to the storage management service module.

于本实施例中,在当前挂载已完成时,向存储管理服务模块发送挂载完成指令,其中挂载完成指令包括挂载状态标识,使得存储管理服务模块在接收到挂载完成指令时,可以获取外部存储设备的挂载状态标识。In this embodiment, when the current mount is completed, send a mount completion instruction to the storage management service module, wherein the mount completion instruction includes a mount status identifier, so that when the storage management service module receives the mount completion instruction, The mount status identifier of the external storage device can be obtained.

其中,外部存储设备管理模块执行挂载操作对外部存储设备进行挂载后,可以获取挂载结果,于本实施例中,若外部存储设备管理模块判定外部存储设备的文件系统异常,设置外部存储设备的挂载状态标识为无法挂载标识,此时当前挂载已完成;若非异常,获取挂载结果,并根据挂载结果设置挂载状态标识,此时当前挂载也已完成。由于在文件系统异常时,外部存储设备管理模块仍将无法挂载标识发送至存储管理服务模块,使得存储管理服务模块对可以广播每次挂载外部存储设备时对应的挂载结果都可以广播,即便在文件系统异常时,未执行挂载操作,也将对应的挂载失败进行广播,使得其他应用程序可以及时获知所插入的外部存储设备的挂载状态。Wherein, after the external storage device management module executes the mount operation to mount the external storage device, the mount result can be obtained. In this embodiment, if the external storage device management module determines that the file system of the external storage device is abnormal, set the external storage device If the mount status of the device is marked as unable to mount, the current mount has been completed; if it is not abnormal, obtain the mount result and set the mount status flag according to the mount result, and the current mount has also been completed at this time. Because when the file system is abnormal, the external storage device management module will still send the unmountable flag to the storage management service module, so that the storage management service module can broadcast the corresponding mount result every time the external storage device is mounted, Even if the mount operation is not performed when the file system is abnormal, the corresponding mount failure will be broadcasted, so that other applications can know the mount status of the inserted external storage device in time.

S610:存储管理服务模块根据挂载状态标识,广播与挂载状态标识对应的挂载结果。S610: The storage management service module broadcasts a mounting result corresponding to the mounting state identifier according to the mounting state identifier.

作为一种实施方式,若挂载状态标识为无法挂载标识,存储管理服务模块广播挂载失败;若挂载状态标识为已挂载标识,存储管理服务模块广播挂载成功,使得系统上的应用程序可以访问挂载成功的外部存储设备。具体地,存储管理服务模块向系统广播挂载结果,应用程序监听到广播后可以作对应操作,例如,用于文件管理的应用程序可以在监听到挂载成功的广播时,在该应用程序的界面显示出该外部存储设备,并在监听到挂载失败的广播时,在该应用程序的界面显示该外部存储设备异常。As an implementation, if the mount status flag is unable to mount, the storage management service module broadcasts the mount failure; if the mount status flag is mounted, the storage management service module broadcasts the mount success, so that the Applications can access successfully mounted external storage devices. Specifically, the storage management service module broadcasts the mounting result to the system, and the application can perform corresponding operations after listening to the broadcast. For example, when an application for file management listens to the broadcast of successful mounting, it can The interface displays the external storage device, and when the mount failure broadcast is heard, the application interface displays that the external storage device is abnormal.

需要说明的是,上述步骤中未详细描述的部分,可参考前述实施例,在此不再赘述。It should be noted that, for parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

本实施例提供的挂载处理方法,在前述实施例的基础上,在外部存储设备管理模块检测到外部存储设备的文件系统异常后,不执行挂载操作,降低不必要的资源消耗,同时通过将无法挂载标识发送至存储管理服务模块,使得存储管理服务模块仍广播检测异常标识对应的挂载结果,使得其他应用程序可以及时获知当前挂载结果,提高响应效率,便于用户在挂载失败时及时采取措施,提升用户体验。The mounting processing method provided in this embodiment, on the basis of the foregoing embodiments, does not perform the mounting operation after the external storage device management module detects that the file system of the external storage device is abnormal, so as to reduce unnecessary resource consumption, and at the same time pass Send the mount failure flag to the storage management service module, so that the storage management service module still broadcasts the mount result corresponding to the abnormal detection flag, so that other applications can know the current mount result in time, improve the response efficiency, and facilitate the user when the mount fails Take timely measures to improve user experience.

另外,外部存储设备管理模块在判定外部存储设备的文件系统异常,并设置外部存储设备的挂载状态标识为无法挂载标识时,仍可以进行挂载操作,具体地,请参阅图7,示出了本申请实施例提供的一种挂载处理方法,具体地,该方法包括:S701至S710。In addition, when the external storage device management module determines that the file system of the external storage device is abnormal, and sets the mount status flag of the external storage device as an unmountable flag, the mount operation can still be performed. Specifically, please refer to Figure 7, which shows A mounting processing method provided by the embodiment of the present application is provided. Specifically, the method includes: S701 to S710.

S701:存储管理服务模块向外部存储设备管理模块发送第一调用指令。S701: The storage management service module sends a first calling instruction to the external storage device management module.

S702:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S702: The external storage device management module executes a detection operation in response to the first call instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

作为一种实施方式,在检测时长超过预设时长时,外部存储设备管理模块也可以不中断检测操作,使得检测操作继续,继续对损坏的文件系统进行修复。具体地,在文件系统损坏过多时,外部存储设备管理模块要完成对所有异常的文件系统的修复,所需的时长较长,并且所需的时长可能超过预设时长,此时通过在检测时长超过预设时长时,仍不中断检测操作,使得外部存储设备管理模块可以对外部存储设备中损坏的文件系统继续进行修复,由此,存在在挂载操作执行前,完成修复的可能,此时检测操作未完成的外部存储设备仍具有可被成功挂载的可能。As an implementation manner, 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, and the damaged file system continues to be repaired. Specifically, when the file system is damaged too much, the external storage device management module needs to complete the repair of all abnormal file systems, which takes a long time, and the required time may exceed the preset time. When the preset duration is exceeded, the detection operation is still not interrupted, so that the external storage device management module can continue to repair the damaged file system in the external storage device. Therefore, there is a possibility that the repair can be completed before the mount operation is executed. At this time External storage devices whose detection operation has not been completed may still be successfully mounted.

S703:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S703: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

S704:存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令S704: The storage management service module sends a second call instruction to the external storage device management module in response to the detection completion instruction

S705:外部存储设备管理模块响应于第二调用指令,根据检测状态标识,判断外部存储设备的文件系统是否异常。S705: The external storage device management module determines whether the file system of the external storage device is abnormal according to the detection status flag in response to the second calling instruction.

S706:设置外部存储设备的挂载状态标识为无法挂载标识。S706: Set the mount state flag of the external storage device as an flag that cannot be mounted.

若外部存储设备管理模块判定外部存储设备的文件系统异常,设置外部存储设备的挂载状态标识为无法挂载标识,仍可以进行挂载操作,继续执行S707。If the external storage device management module determines that the file system of the external storage device is abnormal, it sets the mount status flag of the external storage device as an unmountable flag, and the mount operation can still be performed, and continues to execute S707.

作为一种实施方式,在S707之前,外部存储设备管理模块将外部存储设备的文件系统修复完成,使得该文件系统恢复正常,此时,通过执行S707,可以使得由于在预设时长内未修复完成导致检测状态标识设置为检测异常标识的外部存储设备,在文件系统恢复正常时,可以及时进行挂载,而不需要重新插入、重新执行检测、挂载操作,因此提高了外部存储设备的挂载效率。As an implementation, before S707, the external storage device management module completes the repair of the file system of the external storage device, so that the file system returns to normal. The external storage device whose detection status flag is set as the detection abnormality flag can be mounted in time when the file system returns to normal without reinserting, re-executing detection, and mounting operations, thus improving the mountability of external storage devices. efficiency.

S707:外部存储设备管理模块获取挂载结果。S707: The external storage device management module acquires a mounting result.

S708:外部存储设备管理模块根据挂载结果,更新挂载状态标识。S708: The external storage device management module updates the mounting state identifier according to the mounting result.

S709:外部存储设备管理模块在当前挂载已完成时,向存储管理服务模块发送挂载完成指令。S709: When the current mounting is completed, the external storage device management module sends a mounting completion instruction to the storage management service module.

S710:存储管理服务模块根据挂载状态标识,广播与挂载状态标识对应的挂载结果。S710: 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 parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

本实施例提供的挂载处理方法,通过在检测时长超过预设时长时,仍未中断检测操作,继续对损坏的文件系统进行修复,并在执行挂载操作,获取挂载结果前这段时间完成了修复,使得外部存储设备的文件系统恢复正常,从而本实施例通过外部存储设备管理模块在根据检测异常标识设置挂载状态标识为无法挂载后,仍可执行挂载操作,使得外部存储设备可以在文件系统恢复正常时及时被挂载,提高挂载效率。The mount processing method provided in this embodiment continues to repair the damaged file system without interrupting the detection operation when the detection duration exceeds the preset duration, and performs the mount operation during the period before obtaining the mount result The repair is completed, so that the file system of the external storage device returns to normal, so that in this embodiment, the external storage device management module can still perform the mount operation after setting the mount status flag as unmountable according to the detection abnormality flag, so that the external storage device The device can be mounted in time when the file system returns to normal, improving the mounting efficiency.

另外,外部存储设备管理模块在判定外部存储设备的文件系统异常,并设置外部存储设备的挂载状态标识为无法挂载标识时,也可以不进行挂载操作,而结束本次方法,请参阅图8,示出了本申请实施例提供的一种挂载处理方法,具体地,该方法包括:S801至S810。In addition, when the external storage device management module determines that the file system of the external storage device is abnormal, and sets the mount status flag of the external storage device to be unmountable, it may not perform the mount operation and end this method. Please refer to FIG. 8 shows a mounting processing method provided by an embodiment of the present application. Specifically, the method includes: S801 to S810.

S801:存储管理服务模块向外部存储设备管理模块发送第一调用指令。S801: The storage management service module sends a first calling instruction to the external storage device management module.

S802:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S802: The external storage device management module executes a detection operation in response to the first call instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

S803:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S803: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

S804:存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令。S804: The storage management service module sends a second call instruction to the external storage device management module in response to the detection completion instruction.

S805:外部存储设备管理模块响应于第二调用指令,根据检测状态标识,判断外部存储设备的文件系统是否异常。S805: The external storage device management module determines whether the file system of the external storage device is abnormal according to the detection status flag in response to the second calling instruction.

S806:设置外部存储设备的挂载状态标识为无法挂载标识。S806: Set the mount status flag of the external storage device as the flag that cannot be mounted.

若外部存储设备管理模块判定外部存储设备的文件系统异常,设置外部存储设备的挂载状态标识为无法挂载标识后,结束本次方法,使得外部存储设备管理模块在检测到外部存储设备的文件系统异常时,不执行挂载操作,也不广播挂载结果,节省了资源。If the external storage device management module determines that the file system of the external storage device is abnormal, after setting the mount status flag of the external storage device to be unable to mount the flag, the method ends, so that the external storage device management module detects the file of the external storage device. When the system is abnormal, the mount operation is not performed, and the mount result is not broadcast, which saves resources.

S807:外部存储设备管理模块获取挂载结果。S807: The external storage device management module acquires a mounting result.

S808:外部存储设备管理模块根据挂载结果,更新挂载状态标识。S808: The external storage device management module updates the mounting state identifier according to the mounting result.

S809:外部存储设备管理模块在当前挂载已完成时,向存储管理服务模块发送挂载完成指令。S809: When the current mounting is completed, the external storage device management module sends a mounting completion instruction to the storage management service module.

S810:存储管理服务模块根据挂载状态标识,广播与挂载状态标识对应的挂载结果。S810: 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 parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

本实施例提供的挂载处理方法,通过在外部存储设备管理模块判定外部存储设备的文件系统异常,设置外部存储设备的挂载状态标识为无法挂载标识后,结束本次方法,使得外部存储设备管理模块在检测到外部存储设备的文件系统异常时,不执行挂载操作,也不广播挂载结果,从而在前述实施例的基础上,节省了资源,提高了系统运行效率。The mount processing method provided by this embodiment ends this method after the external storage device management module determines that the file system of the external storage device is abnormal, and sets the mount status flag of the external storage device as an unmountable flag, so that the external storage device When the device management module detects that the file system of the external storage device is abnormal, it does not execute the mount operation and does not broadcast the mount result, thereby saving resources and improving system operation efficiency on the basis of the foregoing embodiments.

另外,在外部存储设备管理模块判定外部存储设备的文件系统异常时,也可以不设置挂载状态标识,并响应于第二调用指令,对外部存储设备进行挂载,具体地,请参阅图9,示出了本申请实施例提供的一种挂载处理方法,具体地,该方法包括:S901至S908。In addition, when the external storage device management module determines that the file system of the external storage device is abnormal, the mount status flag may not be set, and the external storage device may be mounted in response to the second call instruction. Specifically, please refer to FIG. 9 , shows a mounting processing method provided by the embodiment of the present application, specifically, the method includes: S901 to S908.

S901:存储管理服务模块向外部存储设备管理模块发送第一调用指令。S901: The storage management service module sends a first calling instruction to the external storage device management module.

S902:外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。S902: The external storage device management module executes a detection operation in response to the first call instruction, and sets the detection state flag of the external storage device as a detection state flag, and returns the detection state flag.

S903:外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。S903: When the detection operation is completed, the external storage device management module sends a detection completion instruction to the storage management service module.

S904:存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令。S904: The storage management service module sends a second call instruction to the external storage device management module in response to the detection completion instruction.

于本实施例中,外部存储设备管理模块响应于第二调用指令,对外部存储设备进行挂载,具体地,可以包括S905至S906。In this embodiment, the external storage device management module mounts the external storage device in response to the second calling instruction, specifically, S905 to S906 may be included.

S905:外部存储设备管理模块获取挂载结果。S905: The external storage device management module acquires a mounting result.

S906:外部存储设备管理模块根据挂载结果,设置挂载状态标识S906: The external storage device management module sets a mounting status identifier according to the mounting result

S907:外部存储设备管理模块在当前挂载已完成时,向存储管理服务模块发送挂载完成指令。S907: 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 mount completion instruction includes a mount state identifier of the external storage device.

S908:存储管理服务模块根据挂载状态标识,广播与挂载状态标识对应的挂载结果。S908: 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 parts not described in detail in the above steps, reference may be made to the foregoing embodiments, and details are not repeated here.

本实施例提供的挂在处理方法,通过将检测操作与挂载操作分别基于不同的调用指令执行,防止耗时长的检测操作在执行过程中卡住主进程,使得系统无响应,出现卡死或定屏等系统异常情况,提升了系统稳定性。并在对外部存储设备执行挂载操作后,广播挂载结果,使得系统上的应用程序可以获知外部存储设备的挂载结果,并在挂载成功时访问外部存储设备,提高了系统响应效率,并且提升了用户体验。The hang-up processing method provided in this embodiment, by executing the detection operation and the mount operation based on different call instructions, prevents the time-consuming detection operation from getting stuck in the main process during execution, making the system unresponsive, causing stuck or Fixed screen and other system abnormalities have improved system stability. And after performing the mount operation on the external storage device, broadcast the mount result, so that the application program on the system can know the mount result of the external storage device, and access the external storage device when the mount is successful, which improves the system response efficiency. And improve the user experience.

进一步地,请参阅图10,示出了本申请实施例提供的一种触发第一调用指令的方法流程图,该方法描述了在外部存储设备插入终端设备,且存储管理服务模块向外部存储设备管理模块发送第一调用指令之前的过程,具体地,该方法包括:S1001至S1003。Further, please refer to FIG. 10 , which shows a flow chart of a method for triggering a first call instruction provided by an embodiment of the present application. The method describes that a terminal device is inserted into an external storage device, and the storage management service module sends a call to the external storage device. The process before the management module sends the first calling instruction, specifically, the method includes: S1001 to S1003.

S1001:外部存储设备管理模块在检测到外部存储设备的插入事件时,向存储管理服务模块发送外部存储设备的设备信息。S1001: When the external storage device management module detects an insertion event of the external storage device, it sends device information of the external storage device to the storage management service module.

作为一种实施方式,在外部存储设备插入终端设备时,系统底层驱动将外部存储设备的插入时间上报到外部存储设备管理模块,使得外部存储设备管理模块获知外部存储设备的插入事件,并创建外部存储设备的存储路径以及设备信息,将插入的外部存储设备的设备信息转发至存储管理服务模块。其中,设备信息可以包括设备ID、存储容量大小、文件系统类型等信息。具体地,在一些实施方式中,外部存储设备管理模块可以基于Binder调用将设备信息发送至存储管理服务模块。As an implementation, when an external storage device is inserted into a terminal device, the bottom layer driver of the system 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, and creates an external The storage path and device information of the storage device forward the device information of the inserted external storage device to the storage management service module. Wherein, the device information may include information such as device ID, storage capacity, and file system type. Specifically, in some implementation manners, the external storage device management module can send the device information to the storage management service module based on the Binder call.

S1002:存储管理服务模块根据设备信息,创建外部存储设备的存储访问接口,以使外部存储设备被访问。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 can be accessed.

作为一种实施方式,存储管理服务模块根据接收的外部存储设备的设备信息,创建外部存储设备的存储访问接口,使得上层应用程序可以通过存储访问接口访问对应的外部存储设备。As an implementation, 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 upper-layer applications can access the corresponding external storage device through the storage access interface.

S1003:存储管理服务模块在当前存储设备列表上添加外部存储设备,并向外部存储设备管理模块发送第一调用指令。S1003: The storage management service module adds an external storage device to the current storage device list, and sends a first call instruction to the external storage device management module.

作为一种实施方式,存储管理服务模块在创建外部存储设备的存储访问接口后,在预先配置的当前存储设备列表上添加该外部存储设备。此时存储管理服务模块基于Binder调用向外部存储设备管理模块发送第一调用指令。As an implementation manner, the storage management service module adds the external storage device to the preconfigured current storage device list after creating the storage access interface of the external storage device. At this time, the storage management service module sends the first call instruction to the external storage device management module based on the Binder call.

请参阅图11,其示出了本申请实施例提供的一种挂载处理装置的结构框图,该挂载处理装置1100可以包括:第一调用模块1110、第一返回模块1120、检测完成模块1130和挂载通知模块1140。Please refer to FIG. 11 , which shows a structural block diagram of a mounting processing device provided by an embodiment of the present application. The mounting processing device 1100 may include: a first calling module 1110 , a first returning module 1120 , and a detection completion module 1130 and mount notification module 1140.

第一调用模块1110,用于存储管理服务模块向外部存储设备管理模块发送第一调用指令。The first calling module 1110 is used for the storage management service module to send a first calling instruction to the external storage device management module.

第一返回模块1120,用于外部存储设备管理模块响应于第一调用指令,执行检测操作,且设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识。The first return module 1120 is used for the external storage device management module to perform a detection operation in response to the first call instruction, and set the detection status flag of the external storage device as a detection flag, and return the detection status flag.

检测完成模块1130,用于外部存储设备管理模块在检测操作已完成时,向存储管理服务模块发送检测完成指令。The detection completion module 1130 is used for the external storage device management module to send a detection completion instruction to the storage management service module when the detection operation is completed.

挂载通知模块1140,用于存储管理服务模块基于检测完成指令通知外部存储设备管理模块对外部存储设备进行挂载。The mounting notification module 1140 is used for the storage management service module to notify the external storage device management module to mount the external storage device based on the detection completion instruction.

进一步地,第一返回模块1120包括:第一线程单元以及第二线程单元,其中:Further, the first return module 1120 includes: a first thread unit and a second thread unit, wherein:

第一线程单元,用于外部存储设备管理模块响应于第一调用指令,基于第一线程设置外部存储设备的检测状态标识为检测中标识,并返回检测状态标识;The first thread unit is used for the external storage device management module to respond to the first call instruction, set the detection state flag of the external storage device as the detection state flag based on the first thread, and return the detection state flag;

第二线程单元,用于外部存储设备管理模块响应于第一调用指令,基于第二线程执行检测操作。The second thread unit is used for the external storage device management module to execute the detection operation based on the second thread in response to the first calling instruction.

在一种实施方式中,第一线程与第二线程同时进行。In one embodiment, the first thread is performed concurrently with the second thread.

在一种实施方式中,检测操作为检测外部存储设备的文件系统是否异常,并针对异常的文件系统进行修复,若文件系统正常或者文件系统异常且修复完成,则外部存储设备管理模块判定检测操作已完成。In one embodiment, the detection operation is to detect whether the file system of the external storage device is abnormal, and repair the abnormal file system. If the file system is normal or the file system is abnormal and the repair is completed, the external storage device management module determines the detection operation. completed.

进一步地,外部存储设备管理模块响应于第一调用指令,执行检测操作之后,挂载处理装置1100还包括:检测超时异常模块、检测异常确定模块、检测超时结束模块以及挂载停止模块,其中:Further, after the external storage device management module executes the detection operation in response to the first calling instruction, the mounting processing apparatus 1100 further includes: a detection timeout exception module, a detection abnormality determination module, a detection timeout end module, and a mount stop module, wherein:

检测超时异常模块,用于当检测时长超过预设时长时,外部存储设备管理模块设置检测状态标识为检测异常标识。The detection timeout exception module is used to set the detection state flag as the detection abnormality flag by the external storage device management module when the detection time exceeds the preset time length.

检测异常确定模块,用于外部存储设备管理模块对外部存储设备进行挂载时,确定是否能够查找到检测异常标识。The detection abnormality determining module is used for determining whether the detection abnormality identification can be found when the external storage device management module mounts the external storage device.

挂载停止模块,用于若能够,则停止对外部存储设备进行挂载。The mounting stop module is configured to stop mounting the external storage device if possible.

进一步地,外部存储设备管理模块响应于第一调用指令,执行检测操作之后,还包括:检测超时结束单元,其中:Further, after performing the detection operation in response to the first calling instruction, the external storage device management module further includes: a detection timeout end unit, wherein:

检测超时结束单元,用于当检测时长超过预设时长时,结束本次方法。The detection overtime ending unit is used to end the method when the detection time exceeds the preset time.

进一步地,在一些实施方式中,第一调用指令为检测指令,此时第一调用模块1110包括:第一调用单元,其中:Further, in some implementations, the first calling instruction is a detection instruction, at this time the first calling module 1110 includes: a first calling unit, wherein:

第一调用单元,用于存储管理服务模块通过Binder调用将检测指令发送至外部存储设备管理模块。The first calling unit is used for the storage management service module to send the detection instruction to the external storage device management module through the Binder call.

进一步地,挂载通知模块1140包括:挂载通知单元,用于存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令,第二调用指令用于通知外部存储设备管理模块对外部存储设备进行挂载。Further, the mount notification module 1140 includes: a mount notification unit, used for the storage management service module to send a second call instruction to the external storage device management module in response to the detection completion instruction, and the second call instruction is used to notify the external storage device management The module mounts the external storage device.

进一步地,存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令之后,挂载处理装置1100还包括:异常判断模块以及异常挂载标识设置模块。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 mounting processing apparatus 1100 further includes: an abnormality judgment module and an abnormal mounting flag setting module.

异常判断单元,用于外部存储设备管理模块响应于第二调用指令,根据检测状态标识,判断外部存储设备的文件系统是否异常。The abnormality judging unit is used for the external storage device management module to judge whether the file system of the external storage device is abnormal according to the detection status flag in response to the second calling instruction.

异常挂载标识设置模块,用于若异常,设置外部存储设备的挂载状态标识为无法挂载标识,以使存储管理服务模块无法对外部存储设备进行挂载。The abnormal mounting flag setting module is used to set the mounting status flag of the external storage device as an unmountable flag in case of abnormality, so that the storage management service module cannot mount the external storage device.

在一些实施方式中,外部存储设备管理模块响应于第二调用指令,根据检测状态标识,判断外部存储设备的文件系统是否异常之后,挂载处理装置1100还包括:异常结束模块,其中:In some implementations, after the external storage device management module determines whether the file system of the external storage device is abnormal according to the detection status flag in response to the second call instruction, the mount processing apparatus 1100 further includes: an abnormal end module, wherein:

异常结束模块,用于若异常,结束本次方法。The abnormal end module is used to end this method if there is an exception.

进一步地,外部存储设备管理模块响应于第二调用指令,根据检测状态标识,判断外部存储设备的文件系统是否异常之后,挂载处理装置1100还包括:挂载结果获取模块以及挂载标识设置模块,其中:Furthermore, after the external storage device management module determines whether the file system of the external storage device is abnormal according to the detection status flag in response to the second call instruction, the mounting processing apparatus 1100 further includes: a mounting result acquisition module and a mounting identification setting module ,in:

挂载结果获取模块,用于若非异常,外部存储设备管理模块获取挂载结果。The mounting result obtaining module is used for obtaining the mounting result by the external storage device management module unless there is an abnormality.

挂载标识设置模块,用于外部存储设备管理模块根据挂载结果,设置挂载状态标识。The mounting identification setting module is used for the external storage device management module to set the mounting status identification according to the mounting result.

进一步地,挂载标识设置模块,包括:成功设置单元以及失败设置单元,其中:Further, the mount identification setting module includes: a success setting unit and a failure setting unit, wherein:

成功设置单元,用于若挂载成功,设置挂载状态标识为已挂载标识。The successful setting unit is used to set the mount status flag to the mounted flag if the mount is successful.

失败设置单元,用于若挂载失败,设置挂载状态标识为无法挂载标识。The failure setting unit is used to set the mount status flag as the flag of unable to mount if the mount fails.

进一步地,存储管理服务模块响应于检测完成指令,向外部存储设备管理模块发送第二调用指令之后,挂载处理装置1100还包括:第二调用模块、挂载完成模块以及挂载广播模块,其中: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: a second call module, a mount completion module, and a mount broadcast module, wherein :

第二调用模块,用于外部存储设备管理模块响应于第二调用指令,对外部存储设备进行挂载。The second calling module is used for the external storage device management module to mount the external storage device in response to the second calling instruction.

挂载完成模块,用于外部存储设备管理模块在当前挂载已完成时,向存储管理服务模块发送挂载完成指令,挂载完成指令包括外部存储设备的挂载状态标识。The mount completion module is used for the external storage device management module to send a mount completion instruction to the storage management service module when the current mount is completed, and the mount completion instruction includes the mount status identifier of the external storage device.

挂载广播模块,用于存储管理服务模块根据挂载状态标识,广播与挂载状态标识对应的挂载结果。The mount broadcast module is used for the storage management service module to broadcast the mount result corresponding to the mount state identifier according to the mount state identifier.

进一步地,第二调用模块包括:挂载结果获取单元以及挂载标识设置单元,其中:Further, the second calling module includes: a mounting result obtaining unit and a mounting identification setting unit, wherein:

挂载结果获取单元,用于外部存储设备管理模块获取挂载结果。The mount result obtaining unit is used for the external storage device management module to obtain the mount result.

挂载标识设置单元,用于外部存储设备管理模块根据挂载结果,设置外部存储设备的挂载状态标识。The mounting identification setting unit is used for the external storage device management module to set the mounting state identification of the external storage device according to the mounting result.

进一步地,挂载标识设置单元包括成功设置子单元以及失败设置子单元,其中:Further, the mount identification setting unit includes a success setting subunit and a failure setting subunit, wherein:

成功设置子单元,用于若挂载成功,设置挂载状态标识为已挂载标识。Successfully set the subunit, which is used to set the mount status flag to the mounted flag if the mount is successful.

失败设置子单元,用于若挂载失败,设置挂载状态标识为无法挂载标识。The failure setting sub-unit is used to set the mount status flag to the flag of unable to mount if the mount fails.

进一步地,挂载广播模块包括:挂载失败广播单元以及挂载成功广播单元。Further, the mount broadcast module includes: a mount failure broadcast unit and a mount success broadcast unit.

挂载失败广播单元,用于若挂载状态标识为无法挂载标识,存储管理服务模块广播挂载失败;The mount failure broadcast unit is used to broadcast the mount failure by the storage management service module if the mount status flag is the mount failure flag;

挂载成功广播单元,用于若挂载状态标识为已挂载标识,存储管理服务模块广播挂载成功。The mount success broadcast unit is used to broadcast the mount success by the storage management service module if the mount status flag is the mount flag.

进一步地,挂载处理装置1100还包括:设备信息发送模块、访问接口创建模块以及存储设备添加模块,其中:Further, the mounting processing apparatus 1100 also includes: 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 an insertion event of the external storage device.

访问接口创建模块,用于存储管理服务模块根据设备信息,创建外部存储设备的存储访问接口,以使外部存储设备被访问。The access interface creation module is used for the storage management service module to create a storage access interface of the external storage device according to the device information, so that the external storage device can be accessed.

存储设备添加模块,用于存储管理服务模块在当前存储设备列表上添加外部存储设备,并向外部存储设备管理模块发送第一调用指令。The storage device adding module is used for the storage management service module to add an external storage device to the current storage device list, and send 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 embodiments, and has the beneficial effects of the corresponding method embodiments, so details are not repeated here.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the devices and modules described above can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In several embodiments provided in the present application, the coupling between the modules may be electrical, mechanical or other forms of coupling.

另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, each module may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules.

请参考图12,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备1200可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的电子设备1200可以包括一个或多个如下部件:处理器1210、存储器1220、以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器1220中并被配置为由一个或多个处理器1210执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to FIG. 12 , which shows a structural block diagram of an electronic device provided by an embodiment of the present application. The electronic device 1200 may be an electronic device capable of running application programs, such as a smart phone, a tablet computer, and an e-book. The electronic device 1200 in this application may include one or more of the following components: a processor 1210, a memory 1220, and one or more application programs, wherein one or more application programs may be stored in the memory 1220 and configured to be used by One or more processors 1210 are executed, and one or more programs are configured to execute the methods described in the foregoing method embodiments.

处理器1210可以包括一个或者多个处理核。处理器1210利用各种接口和线路连接整个电子设备1200内的各个部分,通过运行或执行存储在存储器1220内的指令、程序、代码集或指令集,以及调用存储在存储器1220内的数据,执行电子设备1200的各种功能和处理数据。可选地,处理器1210可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1210可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1210中,单独通过一块通信芯片进行实现。Processor 1210 may include one or more processing cores. The processor 1210 uses various interfaces and circuits to connect various parts of the entire electronic device 1200, and executes or executes instructions, programs, code sets or instruction sets stored in the memory 1220, and calls data stored in the memory 1220 to execute Various functions of the electronic device 1200 and processing data. Optionally, the processor 1210 may adopt at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). implemented in the form of hardware. The processor 1210 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used to render and draw the displayed content; the modem is used to handle wireless communication. It can be understood that the above modem may also not be integrated into the processor 1210, but implemented by a communication chip alone.

进一步地,处理器1210还包括:外部存储设备管理模块1211以及存储管理服务模块1212。其中,外部存储设备管理模块1211可以是安卓(Android)平台中外部存储系统的管控中心,是管理和控制Android平台外部存储设备的后台进程。其功能主要包括:外部存储设备的插拔事件检测、外部存储设备的挂载、卸载、格式化等;存储管理服务模块1212为Android系统框架层与外部存储设备管理模块1211进行通信的模块,同时存储管理服务模块1212也是向应用提供存储访问接口及存储挂载消息广播的模块。进一步地,在一种实施方式中,外部存储设备管理模块1211与存储管理服务模块1212可以基于Binder通信机制进行通信。Further, the processor 1210 further includes: an external storagedevice management module 1211 and a storagemanagement service module 1212 . Wherein, the external storagedevice management module 1211 may be the management and control center of the external storage system in the Android platform, and is a background process for managing and controlling the external storage device on the Android platform. Its functions mainly include: plug event detection of external storage devices, mounting, unloading, formatting of external storage devices, etc.; the storagemanagement service module 1212 is a module for the Android system framework layer to communicate with the external storagedevice management module 1211, and at the same time The storagemanagement service module 1212 is also a module that provides storage access interfaces and broadcasts storage mount messages to applications. Further, in an implementation manner, the external storagedevice management module 1211 and the storagemanagement service module 1212 may communicate based on a Binder communication mechanism.

存储器1220可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器1220可用于存储指令、程序、代码、代码集或指令集。存储器1220可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备1200在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 1220 may include random access memory (Random Access Memory, RAM), and may also include read-only memory (Read-Only Memory). The memory 1220 may be used to store instructions, programs, codes, sets of codes or sets of instructions. The memory 1220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system and instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like. The storage data area can also store data created by the electronic device 1200 during use (such as phonebook, audio and video data, chat record data) and the like.

则如果上述图11所示的挂载处理装置中的各个单元作为程序包等函数模块的话,该挂载处理装置内的各个单元存储在存储器1220内,能够被处理器调用,并执行对应的功能。Then, if each unit in the above-mentioned mount processing device shown in FIG. 11 is used as a function module such as a program package, each unit in the mount processing device is stored in the memory 1220, can be called by the processor, and executes the corresponding function .

请参考图13,其示出了本申请实施例提供的一种计算机可读取存储介质的结构框图。该计算机可读取存储介质1300中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 13 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. Program codes are stored in the computer-readable storage medium 1300, and the program codes can be invoked by a processor to execute the methods described in the foregoing method embodiments.

计算机可读取存储介质1300可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读取存储介质1300包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读取存储介质1300具有执行上述方法中的任何方法步骤的程序代码1310的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1310可以例如以适当形式进行压缩。The computer readable storage medium 1300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 1300 includes a non-transitory computer-readable storage medium (non-transitory computer-readable storage medium). The computer-readable storage medium 1300 has a storage space forprogram code 1310 for executing any method steps in the above methods. These program codes can be read from or written into one or more computer program products.Program code 1310 may, for example, be compressed in a suitable form.

最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not drive the essence of the corresponding technical solutions away from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims (19)

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;
CN201980091202.2A2019-05-052019-05-05Mounting processing method, mounting processing device, electronic equipment and computer readable storage mediumActiveCN113412480B (en)

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
PCT/CN2019/085568WO2020223862A1 (en)2019-05-052019-05-05Mounting processing method and apparatus, electronic device, and computer readable storage medium

Publications (2)

Publication NumberPublication Date
CN113412480A CN113412480A (en)2021-09-17
CN113412480Btrue CN113412480B (en)2023-05-16

Family

ID=73050671

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201980091202.2AActiveCN113412480B (en)2019-05-052019-05-05Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium

Country Status (2)

CountryLink
CN (1)CN113412480B (en)
WO (1)WO2020223862A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113377627B (en)*2021-06-102023-12-05广州朗国电子科技股份有限公司Business server abnormality detection method, system, equipment and storage medium
CN114327752A (en)*2021-12-132022-04-12青岛聚看云科技有限公司 Microservice configuration method, device and device
CN115086828B (en)*2022-08-232022-12-27荣耀终端有限公司Earphone control method and related device
CN115755811B (en)*2022-11-252025-04-25浙江衣拿智能科技股份有限公司 A distribution abnormality identification control method and device for a distribution device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2001232069A (en)*2000-02-212001-08-28Namco Ltd GAME DEVICE, DATA COMMUNICATION METHOD, AND COMPUTER-READABLE RECORDING MEDIUM RECORDING GAME PROGRAM
US7743283B1 (en)*2007-04-272010-06-22Netapp, Inc.Dynamically modifying parameters for servicing of storage devices
CN102664929A (en)*2012-04-052012-09-12福兴达科技实业(深圳)有限公司Mobile terminal and method for managing mass storage device
CN107423157A (en)*2017-07-312017-12-01北京雷石天地电子技术有限公司A kind of hard disk hanging method, module and operating system
CN109086079B (en)*2018-06-112021-05-11青岛海信移动通信技术股份有限公司Mounting management method and device for storage equipment

Also Published As

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

Similar Documents

PublicationPublication DateTitle
CN113412480B (en)Mounting processing method, mounting processing device, electronic equipment and computer readable storage medium
CN109376053B (en)Data processing method and device and mobile terminal
CN103744821B (en)Method and device for realizing USB OTG (Universal Serial Bus On-The-Go) function of mobile terminal
CN107635078B (en) Game control method and device
CN114020652B (en)Application program management method and electronic equipment
WO2020211791A1 (en)Method and device for anonymous page management, terminal device, and readable storage medium
US12393499B2 (en)Method and device for recovering self-test exception of server component, system and medium
CN112860322B (en)Operating system switching method, device, equipment and storage medium
CN107766177A (en) Boot optimization method, device, storage medium and terminal equipment
WO2024078218A1 (en)System booting method and electronic device
CN106569913A (en) Method and device for terminal backup data
CN114579055A (en)Disk storage method, device, equipment and medium
CN115951949A (en) Method, device and computing device for recovering configuration parameters of BIOS
CN115407943A (en)Memory dump file generation method, device and equipment and readable storage medium
CN103425539B (en)Information processing method and device
CN105100901B (en)A kind of virtual memory card configuration method and system
CN110753040B (en)Request processing method and device
CN114327606B (en)Configuration management method and device, electronic equipment and computer readable storage medium
CN110399168A (en) System startup method, device and equipment for multi-data disk storage server
CN103377071B (en)A kind of batch data delet method and system
CN110365839B (en)Shutdown method, shutdown device, shutdown medium and electronic equipment
CN113396391B (en) Application startup method, device, electronic device and storage medium
CN109634782B (en) A system robustness detection method, device, storage medium and terminal
CN111400085A (en) Transaction rollback exception processing method, device, computer equipment and storage medium
CN107480004B (en)Fault recovery method and device and computer equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp