Storage card locking state control method, system and device and storage medium

By reading the status register of the memory card and using the memory card device node to realize the hardware-level locking/unlocking function, the problem that the Android system storage control function is easily cracked is solved, and the security of memory card data is enhanced to prevent data leakage and tampering.

CN120046165APending Publication Date: 2025-05-27SHENZHEN XINGUODU TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411916583.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The storage control functions of existing Android systems are easily cracked or bypassed by malware, and the memory card faces the risk of data leakage and tampering when it flows between different devices.

Method used

It determines its locked state by reading the status register of the memory card, and implements the hardware-level locking/unlocking function through the memory card device node, ensuring that the locking operation depends on hardware instructions and avoids the system being cracked or bypassed by malware.

Benefits of technology

The hardware-level locking/unlocking function of the memory card is realized, which enhances data security protection and prevents data leakage and tampering when the memory card flows between different devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046165A_ABST
    Figure CN120046165A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a system and a device for controlling a locking state of a memory card and a storage medium, which are used for realizing a hardware-level locking / unlocking function of the memory card and providing stronger data security protection. The method comprises the following steps: reading a state register of a memory card when a device in which the memory card is inserted is started; judging whether the memory card is locked or not according to the state register; if yes, skipping an initialization process of the memory card, and creating a memory card device node; when an operation command of a target application on the memory card is obtained, an interaction program is executed, the interaction program is used for executing the operation command through the memory card equipment node, and the operation command comprises a locking command and an unlocking command.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data security, and particularly to a method, system, device, and storage medium for controlling the locked state of a memory card. Background Art

[0002] The management technologies of storage devices adopted by conventional operating systems of traditional computers, mobile phones, etc. mainly focus on basic read and write operation support, permission allocation at the file system level, and simple storage device identification and mounting processes. To ensure the security of stored data and reasonably regulate the use of storage resources by applications, the operating system also has a series of its own mechanisms to achieve storage control.

[0003] In the prior art, the storage control function of the Android system is mainly implemented through the operating system and relies on system permissions, sandboxing, and user authorization. System permissions constrain the utilization of storage resources by applications by finely dividing different levels of access permissions, such as setting permission rules for allowing or prohibiting operations such as reading, writing, and deleting. The user authorization mechanism gives part of the control right to the user. When an application requests access to a storage area, the user can decide whether to grant authorization according to actual needs to ensure the rationality of storage operations and the user's control over data.

[0004] However, when the system is cracked or invaded by malicious software with root privileges, the above software-level protection mechanisms are easily bypassed. Malicious software can break through permissions, sandboxes, and user authorization restrictions to access and tamper with stored data. And when the memory card is removed from an Android device and inserted into another device, the existing Android permission mechanism fails, and the memory card data will be completely exposed, facing the risks of leakage and tampering during transfer between different devices, seriously affecting user data security. Summary of the Invention

[0005] This application provides a method, system, device, and storage medium for controlling the locked state of a memory card, which is used to implement the hardware-level locking / unlocking function of the memory card and provide stronger data security protection.

[0006] The first aspect of this application provides a method for controlling the locked state of a memory card, including:

[0007] When the device with the memory card inserted is powered on, read the status register of the memory card;

[0008] Judge whether the memory card is locked according to the status register;

[0009] If so, skip the initialization process of the memory card and create a memory card device node;

[0010] When an operation command of the target application on the memory card is obtained, an interaction program is executed. The interaction program is used to execute the operation command through the memory card device node, and the operation command includes a locking command and an unlocking command.

[0011] Optionally, when the operation command is the locking command, the execution of the interaction program includes:

[0012] Obtain a first password parameter input by the user on the target application;

[0013] Transmit the first password parameter and the locking command to the memory card device node, so that the memory card device node locks the memory card based on the first password parameter.

[0014] Optionally, after obtaining the first password parameter input by the user on the target application, the method further includes:

[0015] Judge whether the first password parameter meets the preset requirements;

[0016] The transmission of the first password parameter and the locking command to the memory card device node includes:

[0017] If it meets the preset requirements, transmit the first password parameter and the locking command to the memory card device node.

[0018] Optionally, when the operation command is the unlocking command, the execution of the interaction program includes:

[0019] Obtain a second password parameter input by the user on the target application;

[0020] Transmit the second password parameter and the unlocking command to the memory card device node, so that the memory card device node unlocks the memory card based on the second password parameter.

[0021] Optionally, the operation command further includes a clear password command, and the execution of the interaction program further includes:

[0022] After the memory card is successfully unlocked, judge whether the clear password command is obtained;

[0023] If so, transmit the clear password command to the memory card device node.

[0024] Optionally, after judging whether the clear password command is obtained, the method further includes:

[0025] If not, restore the locked state of the memory card after the device is restarted.

[0026] Optionally, before executing the interaction program, the method further includes:

[0027] Determine whether the operation command conflicts with the locked state of the memory card;

[0028] If so, generate an operation invalid prompt message;

[0029] The execution of the interaction program includes:

[0030] If not, call the AIDL interface to execute the interaction program.

[0031] A second aspect of the present application provides a control system for the locked state of a memory card, including:

[0032] A reading unit, configured to read the status register of the memory card when the device with the memory card inserted is powered on;

[0033] A judging unit, configured to judge whether the memory card is locked according to the status register;

[0034] A creating unit, configured to skip the initialization process of the memory card and create a memory card device node when the judgment result of the judging unit is yes;

[0035] An execution unit, configured to execute an interaction program when an operation command of a target application on the memory card is obtained, where the interaction program is used to execute the operation command through the memory card device node, and the operation command includes a locking command and an unlocking command.

[0036] Optionally, when the operation command is the locking command, the execution unit is specifically configured to:

[0037] Obtain a first password parameter input by a user on the target application;

[0038] Transmit the first password parameter and the locking command to the memory card device node, so that the memory card device node locks the memory card based on the first password parameter.

[0039] Optionally, after obtaining the first password parameter input by the user on the target application, the execution unit is further specifically configured to:

[0040] Judge whether the first password parameter meets a preset requirement;

[0041] If it meets the preset requirement, transmit the first password parameter and the locking command to the memory card device node.

[0042] Optionally, when the operation command is the unlocking command, the execution unit is specifically configured to:

[0043] Obtain a second password parameter input by the user on the target application;

[0044] Transmit the second password parameter and the unlocking command to the memory card device node, so that the memory card device node unlocks the memory card based on the second password parameter.

[0045] Optionally, the operation command further includes a clear password command, and the execution unit is specifically further configured to:

[0046] After the memory card is successfully unlocked, determine whether the clear password command is obtained;

[0047] If so, transmit the clear password command to the memory card device node.

[0048] Optionally, after determining whether the clear password command is obtained, the execution unit is specifically further configured to:

[0049] If not, restore the locked state of the memory card after the device restarts.

[0050] Optionally, the system further includes:

[0051] A conflict handling unit, configured to determine whether the operation command conflicts with the locked state of the memory card; if so, generate an operation invalid prompt message;

[0052] The execution unit is specifically configured to call the AIDL interface to execute an interaction program when the conflict handling unit determines that the operation command does not conflict with the locked state of the memory card.

[0053] A third aspect of the present application provides a control device for the locked state of a memory card, and the device includes:

[0054] A processor, a memory, an input / output unit, and a bus;

[0055] The processor is connected to the memory, the input / output unit, and the bus;

[0056] The memory stores a program, and the processor calls the program to execute the control method for the locked state of the memory card in the first aspect and any optional one of the first aspect.

[0057] A fourth aspect of the present application provides a computer-readable storage medium, and a program is stored on the computer-readable storage medium, and when the program is executed on a computer, it executes the control method for the locked state of the memory card in the first aspect and any optional one of the first aspect.

[0058] From the above technical solutions, it can be seen that the present application has the following advantages:

[0059] Implement the hardware-level locking / unlocking function of the memory card in the Android system. By reading the status register of the memory card, determine whether it is locked, and skip the initialization process according to the locked state. At the same time, implement the execution of the locking / unlocking command for the memory card through the memory card device node. During this process, the locking / unlocking operation of the memory card depends on hardware instructions to achieve hardware-level locking state control. Even if the system is cracked or there is malicious software, the locking protection cannot be bypassed. In addition, once the memory card is locked, its locked state remains effective even after being removed and inserted into other devices, and is not restricted by the Android system permission mechanism, avoiding the risk of data leakage and tampering when the memory card is transferred between different devices, and providing stronger data security protection. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0061] Figure 1 Schematic flowchart of an embodiment of the control method for the locked state of the memory card provided by this application;

[0062] Figure 2 Schematic flowchart of an embodiment of the interaction program for the locking operation in the control method for the locked state of the memory card provided by this application;

[0063] Figure 3 Schematic flowchart of an embodiment of the interaction program for the unlocking operation in the control method for the locked state of the memory card provided by this application;

[0064] Figure 4 Schematic flowchart of an embodiment of determining whether the operation command conflicts with the locked state of the memory card in the control method for the locked state of the memory card provided by this application;

[0065] Figure 5 Schematic diagram of the system architecture of the control method for the locked state of the memory card provided by this application;

[0066] Figure 6 Schematic structural diagram of an embodiment of the control system for the locked state of the memory card provided by this application;

[0067] Figure 7 Schematic structural diagram of an embodiment of the control device for the locked state of the memory card provided by this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0068] The present application provides a control method, system, device and storage medium for the locked state of a memory card, which is used to implement the hardware-level locking / unlocking function of the memory card and provide stronger data security protection.

[0069] It should be noted that the control method for the locked state of the memory card provided by the present application is applied to a terminal equipped with an Android system. For example, the terminal can be a smart phone, a computer, a tablet computer, a smart TV, a smart watch, a portable computer terminal, or a fixed terminal such as a desktop computer. For the convenience of description, in the present application, the system installed on the terminal is used as the execution subject for illustration.

[0070] Please refer to Figure 1 , Figure 1 which is an embodiment of the control method for the locked state of the memory card provided by the present application. The method includes:

[0071] S101. When the device with the memory card inserted is powered on, read the status register of the memory card;

[0072] In memory card standards such as MMC (MultiMediaCard) and SD (Secure Digital), the card itself usually has some hardware-level functions, including locking and unlocking functions. The hardware-level locking mechanism usually controls the access permission of the memory card through the command set embedded in the memory card. Usually, various types of memory cards are compatible with the MMC protocol. A series of commands (referred to as the MMC instruction set) are defined in the MMC protocol for locking or unlocking the memory card.

[0073] During the startup process of the device, the MMC driver on the system initializes the MMC controller and attempts to identify the memory card inserted into the device. During this process, the MMC driver accesses the memory card through the standard MMC protocol, such as using the CMD13 command. The CMD13 command is used to read the status register of the memory card and request to return the status information of the memory card. After the system receives the response from the memory card, it can determine the status of the memory card by parsing the information in the status register.

[0074] S102. Determine whether the memory card is locked according to the status register;

[0075] The status register of the memory card contains multiple flag bits, and each flag bit represents a different state of the memory card. The key flag bits of the status register usually include:

[0076] LOCKED (locked state): If this flag bit is "1", it means that the memory card has been locked and the system cannot perform write operations.

[0077] READY (Ready state): If this flag bit is "1", it indicates that the memory card is in a normal read / write state and is ready for data transfer.

[0078] ERROR (Error state): If this flag bit is "1", it indicates that the memory card is currently in an error state and cannot operate normally.

[0079] In step S101, after the MMC driver obtains the status register information from the memory card through the CMD13 command, the received response will contain the above-mentioned flag bits. The system parses the status register and checks the value of the LOCKED flag bit to determine the status of the memory card, that is, to determine whether the memory card is locked.

[0080] If the LOCKED flag bit is "1", it means that the memory card is in a locked state, and the system will mark the memory card as "read-only". Since write operations cannot be performed in the locked state, the system cannot initialize the memory card normally, and at this time, step 103 needs to be executed.

[0081] If the LOCKED flag bit is "0", it means that the memory card is not locked, and the system can continue to perform read / write operations on the memory card. At this time, the memory card can be initialized normally, and step 104 can be directly executed after the startup is completed.

[0082] S103. Skip the initialization process of the memory card and create a memory card device node;

[0083] Since write operations cannot be performed on the memory card in the locked state, the system cannot complete the initialization process of the memory card normally. Usually, the initialization process includes operations such as formatting and file system mounting, and these operations all require write permissions. If the memory card is locked, the system may cause initialization failure when attempting to perform these write operations. Therefore, it is necessary to skip the initialization process of the memory card to ensure that the device startup process will not be interfered by the locked state of the memory card.

[0084] When the memory card is not locked, the system will automatically create a memory card device node during the initialization process of the memory card. This memory card device node is an interface representing the hardware device in the system and is a prerequisite for the system to interact with the hardware. This memory card device node enables the application program to access the stored data in the memory card.

[0085] In this embodiment, in order to implement subsequent unlocking operations and interactions with application programs, even if the memory card is in a locked state, the system still needs to create a memory card device node for the memory card. When the memory card is locked, the creation of the memory card device node allows the system to continue monitoring the memory card status and implement subsequent unlocking operations.

[0086] S104. When an operation command for the memory card is obtained, execute an interaction program, which is used to execute the operation command through the memory card device node. The operation commands include a locking command and an unlocking command.

[0087] The memory card locking / unlocking operation is a hardware-level security function and needs to be implemented through specific MMC instructions (such as CMD42). When the memory card is in the locked state, it cannot perform write operations and can only resume normal read / write permissions after unlocking. In an Android device, in order to enable an application to control these hardware-level operations through the system interface, an AIDL (Android Interface Definition Language) interface can be encapsulated in the system-level background service. The AIDL interface is used to define the communication protocol between applications. In this embodiment, the AIDL interface can act as a bridge between the application and the system service, allowing the application to send operation commands (such as locking and unlocking commands) to the system and interact with the memory card device node through the background service.

[0088] In practical applications, the target application (i.e., a certain application in the user space) will send a request to lock or unlock the memory card to the system. At this time, the target application sends an operation command by calling the AIDL interface provided by the system. The target application includes a file manager or a security management application, etc., and is not specifically limited here. The target application passes the operation command through the AIDL interface and sends the necessary parameters together. The AIDL interface will be processed in the system service and execute the corresponding interaction program according to the operation command. The interaction program is a system-level executable program responsible for interacting with the memory card device node and performing actual hardware operations to implement the locking and unlocking of the memory card. After the interaction program executes the locking or unlocking command, the result will be fed back to the AIDL interface. The AIDL interface returns the execution result (success or failure) to the target program for the user to perform subsequent processing.

[0089] It should be noted that the Android system will control the access of processes to the memory card device node through permission mechanisms such as SELinux to prevent unauthorized operations and ensure that only authorized processes can perform these operations. Since the locking and unlocking operations involve the hardware control of the memory card, in order to enable the system-level background service to perform the locking and unlocking operations, it is necessary to configure the SELinux policy in advance to open the relevant permissions for the system-level background service to access the memory card.

[0090] In this embodiment, a hardware-level locking / unlocking function for the MMC memory card is implemented in the Android system. The status register of the memory card is read through the MMC driver to determine whether it is locked, and the initialization process is skipped according to the locked state. At the same time, the locking / unlocking command for the memory card is executed through the memory card device node. During this process, the locking / unlocking operation of the memory card depends on hardware instructions to achieve hardware-level locking state control, so that even if the system is cracked or there is malicious software, the locking protection cannot be bypassed. In addition, once the memory card is locked, its locked state remains effective even after being removed and inserted into other devices, and is not restricted by the Android system permission mechanism, avoiding the risk of data leakage and tampering when the memory card is transferred between different devices, and providing stronger data security protection.

[0091] The implementation of the memory card locking operation also involves the process of user inputting a password and password verification. The following describes the locking process of the memory card in detail. Please refer to Figure 2 , Figure 2 As an embodiment of the interactive program for the locking operation, the method includes:

[0092] S201. Obtain the first password parameter input by the user on the target application;

[0093] S202. Determine whether the first password parameter meets the preset requirements;

[0094] S203. Transmit the first password parameter and the locking command to the memory card device node, so that the memory card device node locks the memory card based on the first password parameter.

[0095] In steps S201 to S203 of this embodiment, the user needs to set a password to lock the memory card to ensure that only those who provide the correct password can unlock it. Therefore, a UI interface needs to be provided on the target application for the user to input the password. The target application will receive the password input by the user, that is, the first password parameter, through the UI interface. To ensure the security and complexity of the password, the target application can perform a simple format verification on the first password parameter after the user inputs it to determine whether the first password parameter meets the preset requirements, including but not limited to verifying the length and character type of the first password parameter. If the first password parameter does not meet the preset requirements, the user will be prompted to modify it. After the first password parameter passes the verification, the system transmits the first password parameter and the locking command to the memory card device node together, and controls the hardware of the memory card through the memory card device node to achieve locking. The memory card obtains the locking command and stores the first password parameter at the specified location, and the memory card will switch to the locked state to prevent any further write operations and ensure data security. By performing the locking operation at the hardware level, the security locking of the memory card is finally achieved. This locking mechanism can effectively prevent unauthorized write operations and provide hardware-level security protection.

[0096] The implementation of the memory card unlocking operation also involves the process of clearing the password. The memory card unlocking process is described in detail below. Figure 3 , Figure 3 In another embodiment of the interactive program for unlocking operation, the method includes:

[0097] S301, obtaining a second password parameter input by a user on a target application;

[0098] S302: passing the second password parameter and the unlock command to the memory card device node, so that the memory card device node performs an unlock operation on the memory card based on the second password parameter;

[0099] In steps S301 to S302 of this embodiment, when the user wants to unlock the memory card, the system needs to ensure that only the correct password can unlock the memory card. Therefore, the target application needs to provide an interface for the user to enter the unlock password, that is, the second password parameter. The second password parameter is the password entered by the user to unlock the memory card. Similar to the locking operation, the system will pass the second password parameter to the memory card device node through the AIDL interface, and perform the unlocking operation through the memory card device node. Specifically, the memory card device node sends an unlocking request to the memory card through commands such as CMD42, and attaches the second password parameter for verification. If the verification is passed, the memory card is successfully unlocked. At this time, the memory card will release the read-only state and resume normal read and write operations. The unlocking process is completed at the hardware level, relying on the physical instructions of the memory card, and is not easy to be bypassed or cracked, ensuring the security of the unlocking operation.

[0100] S303: When the memory card is unlocked successfully, determine whether a clear password command is obtained;

[0101] When the memory card is unlocked successfully, the system needs to determine whether the user has also selected the clear password command. The password clearing operation is a security measure that ensures that the memory card does not save the password when unlocking is no longer needed, thereby preventing the password from being leaked or maliciously restored. The system can check whether the clear password command is obtained through the AIDL interface or other IPC mechanisms. The clear password command is usually sent by the target application to instruct the system to delete the password data saved in the memory card.

[0102] If the clear password command is obtained, step 304 is executed. If the clear password command is not obtained, the actual effect is temporary unlocking, and step 305 is executed at this time.

[0103] S304, passing the clear password command to the storage card device node;

[0104] If the user selects to clear the password, the system needs to delete the password information in the memory card to ensure that the password is not retained in the memory card. Specifically, the system passes the password clearing command to the memory card device node to perform the password clearing operation through the memory card device node.

[0105] S305. Restore the locked state of the memory card after the device restarts.

[0106] If the user does not select to clear the password, the unlocking operation of the memory card this time will be temporary. After the memory card is unlocked, the user can read and write to the memory card in the current session. However, to ensure long-term data protection, the system will automatically restore the locked state of the memory card after the device restarts. Specifically, after the device restarts, the system will re-identify the memory card through the MMC driver and read its status register. If the memory card was unlocked in the previous session but the user did not select to clear the password, the system will automatically restore the status of the memory card to locked, further enhancing data security protection.

[0107] In this embodiment, if the user does not select to clear the password, the unlocking operation is only valid in the current session, and the system will automatically restore the locked state of the memory card after the device restarts. Through this mechanism, the system avoids the risk that the memory card remains unlocked after the device restarts, thereby ensuring the security of data when the memory card is used across devices and preventing unauthorized access and tampering.

[0108] In practical applications, before executing an operation command, it is necessary to determine whether the operation command conflicts with the current locked state of the memory card, and provide corresponding feedback and execute an interactive program according to the judgment result. Please refer to Figure 4 , Figure 4 As an embodiment for determining whether an operation command conflicts with the locked state of the memory card, the method includes:

[0109] S401. Determine whether the operation command conflicts with the locked state of the memory card;

[0110] S402. Generate a prompt message indicating that the operation is invalid;

[0111] S403. Call the AIDL interface to execute the interactive program.

[0112] In steps S401 to S403 of this embodiment, before executing the operation command of the memory card, it is necessary to determine whether the operation command conflicts with the lock state of the memory card. If the acquired operation command requires the execution of an operation that does not match the current lock state, the system will identify it as a conflict. For example: 1. If the memory card is in a locked state, and the user requests to write data or modify the content of the memory card, the system will identify it as an operation conflict. 2. If the memory card is in an unlocked state, and the operation command involves an unlocking operation, the redundant operating system at this time will also identify it as an operation conflict. If it is determined that the operation command conflicts with the lock state of the memory card, step S402 is executed to generate specific prompt information according to the conflict judgment, such as "the memory card is in a locked state and cannot be written" or "the memory card has been unlocked and does not need to be unlocked again". If it is determined that the operation command does not conflict with the lock state of the memory card, step S403 is executed, that is, the system calls the AIDL interface to execute the interactive program and performs related operations through the memory card device node. Through these steps, the system can effectively avoid operation conflicts and ensure the security and correctness of memory card operations.

[0113] See also Figure 5 , Figure 5 The system architecture diagram of the control method of the lock state of the memory card provided in this application, wherein the APP layer refers to the application program in the user space, i.e., the target application. The APP initiates the operation command by calling the generalMethod(cmd, pwd, ...) method, wherein cmd can be a password setting, a password clearing, a locking operation or an unlocking operation, and pwd is the corresponding password parameter. SELinux is a security mechanism in the Android system, which is used to control the operation permissions of the APP. SystemService is a system service, which communicates with the APP through the AIDL interface, and receives the operation command of the APP through the generalMethod(cmd, pwd, ...) method. C Program is the interactive program in this application, which specifically interacts with the Linux kernel through the ioctl(fd, cmd, arg) method, wherein fd is a file descriptor, cmd is an operation command, and arg is a parameter. Linux Kernel refers to the Linux kernel, which interacts with the SD Card through the MMC Driver and is responsible for executing the operation command. The SD Card is a memory card, which finally performs specific operations such as locking and unlocking according to the operation command. All of the above levels communicate through specific interfaces and methods to ensure the safety and correctness of the operation.

[0114] The following is a detailed description of the control system for the memory card lock state provided by this application. Figure 6 , Figure 6 Another embodiment of the control system for the memory card lock state provided by the present application includes:

[0115] A reading unit 601, configured to read the status register of the memory card when the device with the memory card inserted is powered on;

[0116] A judging unit 602, configured to judge whether the memory card is locked according to the status register;

[0117] A creating unit 603, configured to skip the initialization process of the memory card and create a memory card device node when the judgment result of the judging unit is yes;

[0118] An executing unit 604, configured to execute an interaction program when an operation command of the target application on the memory card is obtained, where the interaction program is configured to execute the operation command through the memory card device node, and the operation command includes a locking command and an unlocking command.

[0119] Optionally, when the operation command is a locking command, the executing unit 604 is specifically configured to:

[0120] Obtain a first password parameter input by the user on the target application;

[0121] Transmit the first password parameter and the locking command to the memory card device node, so that the memory card device node locks the memory card based on the first password parameter.

[0122] Optionally, after obtaining the first password parameter input by the user on the target application, the executing unit 604 is further specifically configured to:

[0123] Judge whether the first password parameter meets a preset requirement;

[0124] If it meets the preset requirement, transmit the first password parameter and the locking command to the memory card device node.

[0125] Optionally, when the operation command is an unlocking command, the executing unit 604 is specifically configured to:

[0126] Obtain a second password parameter input by the user on the target application;

[0127] Transmit the second password parameter and the unlocking command to the memory card device node, so that the memory card device node unlocks the memory card based on the second password parameter.

[0128] Optionally, the operation command further includes a password clearing command, and the executing unit 604 is further specifically configured to:

[0129] Judge whether the password clearing command is obtained after the memory card is successfully unlocked;

[0130] If so, transmit the password clearing command to the memory card device node.

[0131] Optionally, after determining whether the clear password command is obtained, the execution unit 604 is further specifically configured to:

[0132] If not, restore the locked state of the memory card after the device is restarted.

[0133] Optionally, the system further includes:

[0134] A conflict handling unit 605, configured to determine whether an operation command conflicts with the locked state of the memory card; if so, generate an operation invalid prompt message;

[0135] The execution unit 604 is specifically configured to call the AIDL interface to execute an interaction program when the conflict handling unit 605 determines that the operation command does not conflict with the locked state of the memory card.

[0136] In the system of this embodiment, the functions of each unit correspond to the steps in the foregoing Figures 1 to 4 method embodiment shown, and will not be elaborated here.

[0137] This application further provides a control device for the locked state of a memory card. Please refer to Figure 7 , Figure 7 which is an embodiment of the control device for the locked state of a memory card provided by this application. The device includes:

[0138] A processor 701, a memory 702, an input / output unit 703, and a bus 704;

[0139] The processor 701 is connected to the memory 702, the input / output unit 703, and the bus 704;

[0140] The memory 702 stores a program, and the processor 701 calls the program to execute any one of the control methods for the locked state of the memory card as described above.

[0141] This application also relates to a computer-readable storage medium on which a program is stored. When the program runs on a computer, the computer is caused to execute any one of the control methods for the locked state of the memory card as described above.

[0142] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated here.

[0143] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be in electrical, mechanical, or other forms.

[0144] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0146] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, read-only memory), random access memories (RAM, random access memory), magnetic disks, or optical discs and other various media that can store program codes.

Claims

1. A method for controlling a memory card lock state, characterized in that: The control method comprises: When the device into which the memory card is inserted is powered on, a status register of the memory card is read; determining whether the memory card is locked according to the status register; If yes, skip the initialization process of the memory card and create a memory card device node; When an operation command of the target application on the memory card is obtained, an interactive program is executed, wherein the interactive program is used to execute the operation command through the memory card device node, and the operation command includes a lock command and an unlock command.

2. The method according to claim 1, characterized in that When the operation command is the lock command, the executing interactive program includes: Obtaining a first password parameter entered by a user on the target application; The first password parameter and the lock command are transmitted to the memory card device node, so that the memory card device node performs a lock operation on the memory card based on the first password parameter.

3. The method according to claim 2, characterized in that After obtaining the first password parameter input by the user on the target application, the method further includes: Determining whether the first password parameter meets the preset requirements; The transmitting the first password parameter and the locking command to the memory card device node includes: If the preset requirements are met, the first password parameter and the lock command are transmitted to the memory card device node.

4. The method according to claim 1, characterized in that: When the operation command is the unlock command, the executing interactive program includes: Obtaining a second password parameter input by a user on the target application; The second password parameter and the unlock command are transmitted to the memory card device node, so that the memory card device node performs an unlock operation on the memory card based on the second password parameter.

5. The method according to claim 4, characterized in that The operation command also includes a clear password command, and the execution interactive program also includes: When the memory card is unlocked successfully, determining whether the clear password command is obtained; If so, the clear password command is transmitted to the memory card device node.

6. The method according to claim 5, characterized in that After determining whether the clear password command is obtained, the method further includes: If not, the locked state of the memory card is restored after the device is restarted.

7. The method according to any one of claims 1 to 6, characterized in that Before executing the interactive program, the method further includes: Determining whether the operation command conflicts with the lock state of the memory card; If so, an invalid operation prompt message is generated; The execution interactive program includes: If not, call the AIDL interface to execute the interactive program.

8. A control system for a memory card lock state, characterized in that: The system comprises: A reading unit, used to read the status register of the memory card when the device into which the memory card is inserted is powered on; a judging unit, configured to judge whether the memory card is locked according to the status register; A creating unit, configured to skip the initialization process of the memory card and create a memory card device node when the judgment result of the judging unit is yes; The execution unit is used to execute an interactive program when an operation command of the target application on the memory card is obtained, and the interactive program is used to execute the operation command through the memory card device node, and the operation command includes a lock command and an unlock command.

9. A device for controlling a memory card lock state, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed on a computer, the method according to any one of claims 1 to 7 is performed.