Method, device and equipment for managing mobile storage medium and readable storage medium

By performing special disk partitioning and formatting on the removable storage medium to generate normal partitions and unpartitioned partitions, and using loop devices for authentication and access in the Linux system, the security risks of connecting removable storage media are resolved, read and write control of the unpartitioned storage area is realized, and the security of the terminal system is improved.

CN115688203BActive Publication Date: 2026-11-06QI AN XIN TECHNOLOGY GROUP INC +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110837054.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-23
Publication Date
2026-11-06
Estimated Expiration
2041-07-23

AI Technical Summary

Technical Problem

In existing technologies, mobile storage media lack effective authentication and authorization when connected to terminals, leading to security risks such as virus transmission and data leakage.

Method used

By performing special disk partitioning and formatting on the removable storage medium, a normal partition occupying only a very small amount of storage space and an unpartitioned partition occupying the vast majority of storage space are generated, along with storage management programs and registration information. After successful authentication, the unformatted physical disk block device is accessed through the loop device in the Linux system.

Benefits of technology

It enables effective control over mobile storage media, enhances the security of terminal systems, and prevents virus transmission and data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115688203B_ABST
    Figure CN115688203B_ABST
Patent Text Reader

Abstract

The application discloses a kind of mobile storage medium's management and control method, device, equipment and readable storage medium, the method includes: when detecting mobile storage medium access Linux system, the normal partition formatted in the mobile storage medium is mounted to the Linux system, wherein the mobile storage medium includes: normal partition formatted and unformatted physical disk block device;Through the Linux system, previously stored management and control program is obtained from the normal partition;Call the management and control program to authenticate the mobile storage medium, and after authentication succeeds, unformatted physical disk block device in the mobile storage medium is accessed by loop device in the Linux system;The application can realize the effective management and control of mobile storage medium, increase the security of terminal system using mobile storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and readable storage medium for managing mobile storage media. Background Technology

[0002] With the continuous development of computer storage technology, the capacity and ease of use of portable storage media have been greatly improved, making them frequently used devices in daily office work. However, while bringing convenience to work, portable storage media also pose significant security risks to enterprises. In existing technologies, when portable storage media (such as USB flash drives, portable hard drives, floppy disks, optical discs, and memory cards) are connected to a terminal, the terminal operating system automatically mounts the portable storage media without authenticating or authorizing it. Therefore, portable storage media can easily become carriers of viruses and can also cause data leaks within enterprises. Thus, how to more effectively manage the use of portable storage media to prevent virus spread and data leaks has become a pressing technical problem that needs to be solved by those skilled in the art. Summary of the Invention

[0003] The purpose of this invention is to provide a method, apparatus, device, and readable storage medium for managing mobile storage media, which can effectively manage mobile storage media and increase the security of terminal systems using mobile storage media.

[0004] According to one aspect of the present invention, a method for managing a removable storage medium is provided, the method comprising:

[0005] When a removable storage medium is detected to be connected to a Linux system, the formatted normal partition in the removable storage medium is mounted to the Linux system. The removable storage medium includes: a formatted normal partition and an unformatted physical disk block device.

[0006] The Linux system retrieves the pre-stored control program from the normal partition;

[0007] The control program is invoked to authenticate the removable storage medium, and after successful authentication, the unformatted physical disk block device in the removable storage medium is accessed through the loop device in the Linux system.

[0008] Optionally, before mounting the formatted normal partition in the removable storage medium to the Linux system, the method further includes:

[0009] A portion of the storage area is selected from the removable storage medium to perform a partitioning operation, resulting in the normal partition. The unselected storage area in the removable storage medium is used as the physical disk block device, wherein the storage space size of the normal partition is smaller than the storage space size of the physical disk block device.

[0010] The normal partition is formatted, and the preset control program is stored in the formatted normal partition.

[0011] Optionally, after formatting the normal partition and storing the preset control program in the formatted normal partition, the method further includes:

[0012] The preset registration information is stored in the formatted normal partition; wherein, the registration information includes: verification information used for identity verification.

[0013] Optionally, the step of invoking the control program to authenticate the removable storage medium specifically includes:

[0014] The control program is invoked to obtain the authentication information entered by the user through the Linux system;

[0015] Determine whether the verification information entered by the user is consistent with the verification information in the registration information;

[0016] If yes, authentication is successful; otherwise, the normal partition is unloaded from the Linux system.

[0017] Optionally, the step of selecting a portion of the storage area from the removable storage medium to perform a partitioning operation to obtain the normal partition, and using the unselected storage area in the removable storage medium as the physical disk block device, specifically includes:

[0018] Write the start and end address information of the normal partition into the partition table set in the removable storage medium;

[0019] Based on the storage space size of the removable storage medium and the start and end address information of the normal partition stored in the partition table, the unpartitioned storage area in the removable storage medium is determined, and the unpartitioned storage area is set as the physical disk block device.

[0020] Optionally, the step of accessing the unformatted physical disk block device in the removable storage medium through the loop device in the Linux system after successful authentication specifically includes:

[0021] The management program is invoked to identify an idle target loop device from the Linux system, the physical disk block device is associated with the target loop device, and the target loop device is mounted to the Linux system so that the Linux system can perform read and write operations on the physical disk block device.

[0022] To achieve the above objectives, the present invention also provides a control device for a mobile storage medium, the device specifically comprising the following components:

[0023] The detection module is used to mount the formatted normal partition in the removable storage medium to the Linux system when the removable storage medium is detected to be connected to the Linux system. The removable storage medium includes: a formatted normal partition and an unformatted physical disk block device.

[0024] The acquisition module is used to acquire the pre-stored management program from the normal partition through the Linux system;

[0025] The module is used to call the management program to authenticate the removable storage medium, and after successful authentication, access the unformatted physical disk block device in the removable storage medium through the loop device in the Linux system.

[0026] Optionally, the device further includes:

[0027] The processing module is configured to select a portion of the storage area from the removable storage medium to perform a partitioning operation, thereby obtaining the normal partition, and to use the unselected storage area in the removable storage medium as the physical disk block device, wherein the storage space size of the normal partition is smaller than the storage space size of the physical disk block device; to perform a formatting operation on the normal partition, and to store a preset control program in the formatted normal partition.

[0028] To achieve the above objectives, the present invention also provides a computer device, which specifically includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the mobile storage medium control method described above.

[0029] To achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method for controlling a removable storage medium.

[0030] The present invention provides a method, apparatus, device, and readable storage medium for managing mobile storage media. First, the mobile storage medium connected to the terminal system is partitioned and formatted using a special format to obtain a normal partition occupying only a small amount of storage space and an unpartitioned storage area occupying the vast majority of storage space, with the unpartitioned storage area existing as a physical disk block device. Next, a preset management program is imported into the normal partition. Finally, after the normal partition is mounted to the terminal system, the management program is invoked to verify the mobile storage medium. Upon successful verification, the management program is invoked again, and the unpartitioned physical disk block device in the mobile storage medium is mounted to the terminal system using a loop device in the terminal system, thereby enabling the terminal system to read and write to the unpartitioned physical disk block device in the mobile storage medium. This invention allows the terminal system to effectively manage mobile storage media, increasing the security of the terminal system using mobile storage media. Attached Figure Description

[0031] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0032] Figure 1 This is a schematic diagram of an optional process for the management and control method of the mobile storage medium provided in Embodiment 1;

[0033] Figure 2 This is a schematic diagram of the physical disk data layout of the removable storage medium in Embodiment 1;

[0034] Figure 3 This is a schematic diagram of an optional component structure of the control device for the mobile storage medium provided in Embodiment 3;

[0035] Figure 4 This is a schematic diagram of an optional hardware architecture for a computer device provided in Embodiment 4. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0037] Example 1

[0038] This invention provides a method for managing and controlling mobile storage media, such as... Figure 1 As shown, the method specifically includes the following steps:

[0039] Step S101: When the removable storage medium is detected to be connected to the Linux system, the formatted normal partition in the removable storage medium is mounted to the Linux system, wherein the removable storage medium includes: a formatted normal partition and an unformatted physical disk block device.

[0040] It should be noted that this embodiment is applicable to Linux systems, and can be used to manage the use of removable storage media in Linux systems.

[0041] Because there is only a single file structure tree in the Linux system, and the root directory of this file structure tree is / , all accessible files must be associated with this file structure tree. Therefore, if the Linux system needs to use an external device, it needs to associate the file system of the external device with the file structure tree. The act of mounting is to associate the external device with the file structure tree of the Linux system so that the Linux system can find the associated external device starting from the root directory and thus access the file data within the external device.

[0042] Specifically, the method further includes:

[0043] Step A1: Select a portion of the storage area from the removable storage medium to perform a partitioning operation to obtain the normal partition, and use the unselected storage area in the removable storage medium as the physical disk block device, wherein the storage space size of the normal partition is smaller than the storage space size of the physical disk block device;

[0044] Among them, such as Figure 2 The diagram shows the physical disk data layout of a removable storage medium. Normal partitions occupy only a small portion of the storage space on the removable storage medium.

[0045] Step A2: Format the normal partition and store the preset control program in the formatted normal partition;

[0046] The control program is used to authenticate the user using the mobile storage medium and, after successful authentication, allow the user to read and write to the unformatted storage area of ​​the mobile storage medium through the loop device in the Linux system.

[0047] Step A3: Store the preset registration information in the formatted normal partition; wherein, the registration information includes: verification information used for identity verification;

[0048] The verification information includes: device identification information (device ID) for uniquely identifying the removable storage medium, user identification information (user ID) for uniquely identifying the user, password information, and user access permission information for the removable storage medium (e.g., read / write, read-only, disabled).

[0049] When using removable storage media (e.g., USB flash drives, optical discs, hard drives, floppy disks), the media must first be partitioned and formatted. The Linux system can only mount the formatted storage area of ​​the removable storage media, storing authentication information in the formatted partition. Only after successful authentication and security confirmation is the Linux system allowed to read and write to the unformatted storage area of ​​the removable storage media, thus improving security during access. In this embodiment, the removable storage media is pre-partitioned and formatted using a special format to obtain a normal partition occupying only a minimal amount of storage space and an unpartitioned, unformatted storage area occupying the vast majority of storage space. Pre-set control programs and registration information are stored in the normal partition. By setting the storage space of the formatted normal partition to be a very small proportion of the total storage space of the removable storage media, security is improved without significantly affecting the media's normal storage functions.

[0050] In practical applications, a pre-set processing program can be used to implement steps A1 to A3 above. This program processes removable storage media in batches, ensuring that each processed removable storage media contains a normal partition with management programs and registration information stored within it. When a processed removable storage media is connected to a target terminal with a Linux system, the normal partition can be directly mounted to the target terminal, allowing the target terminal to read the management programs and registration information from the normal partition. Alternatively, the processing program can be stored in a target terminal with a Linux system. When an unused removable storage media is connected to the target terminal, the processing program is invoked to create a normal partition on the removable storage media, and the management programs and registration information are stored in the normal partition. Then, the normal partition is directly mounted to the target terminal.

[0051] Step S102: Obtain the pre-stored management program from the normal partition through the Linux system.

[0052] In this embodiment, since only the normal partition in the removable storage medium has been formatted, the Linux system can read the contents of the normal partition normally.

[0053] Step S103: Invoke the management program to authenticate the removable storage medium, and after successful authentication, access the unformatted physical disk block device in the removable storage medium through the loop device in the Linux system.

[0054] Specifically, the step of invoking the control program to authenticate the removable storage medium includes:

[0055] Step B1: Invoke the control program to obtain the authentication information entered by the user through the Linux system;

[0056] Step B2: Determine whether the verification information entered by the user is consistent with the verification information in the registration information;

[0057] Step B3: If yes, authentication is successful; otherwise, the normal partition is unloaded from the Linux system.

[0058] In this embodiment, when the control program is invoked, it displays a dialog box on the target terminal for the user to input verification information, such as user ID and password. The control program determines whether the user ID and password entered by the user are consistent with the user ID and password in the registration information. If they are, the authentication is successful and the user can use the removable storage medium normally. If not, the authentication fails and a security prompt message is displayed on the target terminal.

[0059] In practical applications, a corresponding mobile storage medium can be configured for each employee in the company, that is, the mobile storage medium stores only the unique employee ID information; or a corresponding mobile storage medium can be configured for each part of the company, that is, the mobile storage medium stores the ID information of all employees in that part.

[0060] Furthermore, the step of selecting a portion of the storage area from the removable storage medium to perform a partitioning operation to obtain the normal partition, and using the unselected storage area in the removable storage medium as the physical disk block device, specifically includes:

[0061] Step C1: Write the start and end address information of the normal partition into the partition table set in the removable storage medium;

[0062] Step C2: Based on the storage space size of the removable storage medium and the start and end address information of the normal partition stored in the partition table, determine the unpartitioned storage area in the removable storage medium, and set the unpartitioned storage area as the physical disk block device.

[0063] like Figure 2As shown, a partition table is set up in the removable storage medium. This partition table records the storage space size information of the removable storage medium and the start and end address information of each partition. The unpartitioned storage area in the removable storage medium can be determined through this partition table, and the unpartitioned storage area exists in the form of physical disk block devices.

[0064] Furthermore, the step of accessing the unformatted physical disk block device in the removable storage medium via the loop device in the Linux system after successful authentication specifically includes:

[0065] The management program is invoked to identify an idle target loop device from the Linux system, the physical disk block device is associated with the target loop device, and the target loop device is mounted to the Linux system so that the Linux system can perform read and write operations on the physical disk block device.

[0066] A loop device is a pseudo-device, also known as a loopback device, that can be used to simulate a file as a block device. Once a file is simulated as a block device, it can be used like a disk or optical disc. Typically, a Linux system has eight loop devices, usually / dev / loop0 to / dev / loop7. You can use the `losetup -a` command to check the usage of all loop devices. If the command outputs nothing, it means that none of the loop devices are currently in use, and these unused loop devices can be used for storage.

[0067] Furthermore, the invocation of the management program to determine the idle target loop device from the Linux system specifically includes:

[0068] Obtain the device IDs of all loop devices in the Linux system;

[0069] The usage status of each loop device is queried sequentially in ascending order of device number until an idle loop device is found, and the idle loop device is selected as the target loop device.

[0070] In practical applications, there are usually 8 loop devices in a Linux system, typically / dev / loop0 to / dev / loop7. In this embodiment, based on the loop device's code, the usage status of each loop device is queried in ascending order of its number, and the first loop device with an idle usage status is set as the target loop device. That is, when there are multiple loop devices, only the loop device with the smallest number and an idle usage status is set as the target loop device.

[0071] Associating the physical disk block device with the target loop device specifically includes:

[0072] The physical disk block device is associated with the target loop device using the losetup command;

[0073] For example, `losetup / dev / loop3 a.ios` associates the physical disk block device `a.ios` with the fourth loop device in the Linux system using the `losetup` command.

[0074] The step of mounting the target loop device to the Linux system specifically includes:

[0075] Create an empty subdirectory under the root directory / of the Linux system, and mount the target loop device to the empty subdirectory using the mount command.

[0076] Since mounting will hide files in existing subdirectories, the root directory and existing subdirectories of the Linux system are not suitable as mount points. Empty subdirectories need to be created as mount points. When the target loop device is mounted to an empty subdirectory, when a user accesses the empty subdirectory through the Linux system, it is equivalent to accessing the physical disk block device in the removable storage medium managed by the target loop device. This enables the Linux system to read and write to the unpartitioned storage area in the removable storage medium.

[0077] In the prior art, the loop device in the Linux system can simulate a file as a block device, and the Linux system can perform read and write operations on the file by associating the block device with the loop device and mounting the loop device to the Linux system. The unpartitioned storage area in the removable storage medium is equivalent to a block device. Therefore, in this embodiment, the read and write operations of the unpartitioned storage area in the removable storage medium can be controlled by using the loop device in the Linux system.

[0078] In this embodiment, the removable storage medium connected to the Linux system is first partitioned and formatted using a special format to obtain a normal partition that occupies only a very small amount of storage space and an unpartitioned storage area that occupies the vast majority of storage space. The unpartitioned storage area exists in the form of a physical disk block device. Then, a preset management program is imported into the normal partition. Finally, after the normal partition is mounted to the Linux system, the management program is called to verify the removable storage medium. After successful verification, the management program is called and the loop device in the Linux system is used to mount the unpartitioned physical disk block device in the removable storage medium to the Linux system, thereby enabling the Linux system to perform read and write operations on the unpartitioned physical disk block device in the removable storage medium.

[0079] Example 2

[0080] This invention provides a method for managing removable storage media, applied to a target terminal using a Linux system. The method specifically includes the following steps:

[0081] Step 1: When the removable storage medium is detected to be connected to the Linux system, perform a partitioning operation on the removable storage medium to obtain normal partitions;

[0082] Among them, such as Figure 2 The diagram shows the physical disk data layout of a removable storage medium. Normal partitions occupy only a small portion of the storage space on the removable storage medium.

[0083] Step 2: Format the normal partition and store the preset control program in the formatted normal partition;

[0084] The control program is used to authenticate the user using the removable storage medium and, after successful authentication, to allow the user to read and write to the unpartitioned storage area of ​​the removable storage medium through the loop device in the Linux system.

[0085] Step 3: Store the preset registration information in the formatted normal partition; wherein, the registration information includes: verification information used for identity verification;

[0086] The verification information includes: device identification information (device ID) for uniquely identifying the removable storage medium, user identification information (user ID) for uniquely identifying the user, password information, and user access permission information for the removable storage medium (e.g., read / write, read-only).

[0087] Step 4: Write the start and end address information of the normal partition into the partition table set in the removable storage medium.

[0088] Step 5: Based on the storage space size of the removable storage medium and the start and end address information of the normal partition stored in the partition table, determine the unpartitioned storage area in the removable storage medium and set the unpartitioned storage area as a physical disk block device;

[0089] like Figure 2 As shown, a partition table is set up in the removable storage medium. This partition table records the storage space size information of the removable storage medium and the start and end address information of each partition. The unpartitioned storage area in the removable storage medium can be determined through this partition table, and the unpartitioned storage area exists in the form of physical disk block devices.

[0090] Step 6: Mount the formatted normal partition in the removable storage medium to the Linux system.

[0091] Step 7: Call the management program in the normal partition to obtain the verification information entered by the user through the Linux system.

[0092] In this embodiment, when the control program is invoked, it displays a dialog box on the target terminal for the user to input verification information, such as user ID and password. The control program determines whether the user ID and password entered by the user are consistent with the user ID and password in the registration information. If they are, the authentication is successful and the user can use the removable storage medium normally. If not, the authentication fails and a security prompt message is displayed on the target terminal.

[0093] Step 8: Determine whether the verification information entered by the user matches the verification information in the registration information; if yes, the authentication is successful and proceed to step 9; if no, the authentication fails and the normal partition is unloaded from the Linux system.

[0094] Step 9: Call the control program to query the usage status of each loop device in ascending order of the device number, and set the first loop device with an idle usage status as the target loop device.

[0095] Step 10: Invoke the management program to associate the physical disk block device with the target loop device via the losetup command.

[0096] Step 11: Invoke the management program to mount the target loop device to the Linux system, so as to enable the Linux system to read and write to the physical disk block device.

[0097] Example 3

[0098] This invention provides a control device for mobile storage media, such as... Figure 3 As shown, the device specifically includes the following components:

[0099] The detection module 301 is used to mount the formatted normal partition in the mobile storage medium to the Linux system when the mobile storage medium is detected to be connected to the Linux system. The mobile storage medium includes: a formatted normal partition and an unformatted physical disk block device.

[0100] The acquisition module 302 is used to acquire a pre-stored management program from the normal partition through the Linux system;

[0101] Module 303 is used to call the management program to authenticate the removable storage medium, and after successful authentication, access the unformatted physical disk block device in the removable storage medium through the loop device in the Linux system.

[0102] Specifically, the device further includes:

[0103] The processing module is configured to select a portion of the storage area from the removable storage medium to perform a partitioning operation, thereby obtaining the normal partition, and to use the unselected storage area in the removable storage medium as the physical disk block device, wherein the storage space size of the normal partition is smaller than the storage space size of the physical disk block device; to perform a formatting operation on the normal partition, and to store a preset control program in the formatted normal partition.

[0104] Furthermore, the processing module is also used for:

[0105] The preset registration information is stored in the formatted normal partition; wherein, the registration information includes: verification information used for identity verification.

[0106] Module 303 is used specifically for:

[0107] The management program is invoked to obtain the verification information entered by the user through the Linux system; it is then determined whether the verification information entered by the user is consistent with the verification information in the registration information; if so, the authentication is successful; otherwise, the normal partition is unloaded from the Linux system.

[0108] Furthermore, the processing module is also used for:

[0109] Write the start and end address information of the normal partition into the partition table set in the removable storage medium; determine the unpartitioned storage area in the removable storage medium according to the storage space size of the removable storage medium and the start and end address information of the normal partition stored in the partition table, and set the unpartitioned storage area as the physical disk block device.

[0110] Module 303 is also used for:

[0111] The management program is invoked to identify an idle target loop device from the Linux system, the physical disk block device is associated with the target loop device, and the target loop device is mounted to the Linux system so that the Linux system can perform read and write operations on the physical disk block device.

[0112] Example 4

[0113] This embodiment also provides a computer device, such as a smartphone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server, or cabinet server (including a standalone server or a server cluster composed of multiple servers), etc., capable of executing programs. Figure 4 As shown, the computer device 40 in this embodiment includes, but is not limited to, a memory 401 and a processor 402 that are communicatively connected to each other via a system bus. It should be noted that... Figure 4 Only a computer device 40 with components 401-402 is shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0114] In this embodiment, the memory 401 (i.e., the readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 401 may be an internal storage unit of the computer device 40, such as the hard disk or memory of the computer device 40. In other embodiments, the memory 401 may also be an external storage device of the computer device 40, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 40. Of course, the memory 401 may include both the internal storage unit and the external storage device of the computer device 40. In this embodiment, the memory 401 is typically used to store the operating system and various application software installed on the computer device 40. In addition, the memory 401 may also be used to temporarily store various types of data that have been output or will be output.

[0115] In some embodiments, processor 402 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. This processor 402 is typically used to control the overall operation of computer device 40.

[0116] Specifically, in this embodiment, the processor 402 is used to execute a program for managing the removable storage medium stored in the memory 401. When the program for managing the removable storage medium is executed, it performs the following steps:

[0117] When a removable storage medium is detected to be connected to a Linux system, the formatted normal partition in the removable storage medium is mounted to the Linux system. The removable storage medium includes: a formatted normal partition and an unformatted physical disk block device.

[0118] The Linux system retrieves the pre-stored control program from the normal partition;

[0119] The control program is invoked to authenticate the removable storage medium, and after successful authentication, the unformatted physical disk block device in the removable storage medium is accessed through the loop device in the Linux system.

[0120] For a detailed description of the above method steps, please refer to the first embodiment. This embodiment will not repeat the details here.

[0121] Example 5

[0122] This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, app store, etc., which stores a computer program. When the computer program is executed by a processor, it implements the following method steps:

[0123] When a removable storage medium is detected to be connected to a Linux system, the formatted normal partition in the removable storage medium is mounted to the Linux system. The removable storage medium includes: a formatted normal partition and an unformatted physical disk block device.

[0124] The Linux system retrieves the pre-stored control program from the normal partition;

[0125] The control program is invoked to authenticate the removable storage medium, and after successful authentication, the unformatted physical disk block device in the removable storage medium is accessed through the loop device in the Linux system.

[0126] For a detailed description of the above method steps, please refer to the first embodiment. This embodiment will not repeat the details here.

[0127] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0128] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0129] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0130] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for managing and controlling a removable storage medium, characterized in that, The method includes: When a removable storage medium is detected to be connected to a Linux system, the formatted normal partition in the removable storage medium is mounted to the Linux system. The removable storage medium includes: a formatted normal partition and an unformatted physical disk block device. The Linux system retrieves the pre-stored control program from the normal partition; The control program is invoked to authenticate the removable storage medium, and after successful authentication, the unformatted physical disk block device in the removable storage medium is accessed through the loop device in the Linux system. The method further includes, prior to mounting the formatted normal partition in the removable storage medium to the Linux system: A portion of the storage area is selected from the removable storage medium to perform a partitioning operation, resulting in the normal partition. The unselected storage area in the removable storage medium is used as the physical disk block device, wherein the storage space size of the normal partition is smaller than the storage space size of the physical disk block device. The normal partition is formatted, and a preset control program is stored in the formatted normal partition; wherein, the Linux system can only mount the formatted storage area in the removable storage medium; The preset registration information is stored in the formatted normal partition; wherein, the registration information includes: verification information used for identity verification; The step of accessing the unformatted physical disk block device in the removable storage medium via the loop device in the Linux system after successful authentication specifically includes: The control program is invoked to identify idle target loop devices from the Linux system; The physical disk block device is associated with the target loop device using the losetup command; An empty subdirectory is created in the root directory of the file structure tree of the Linux system as a mount point, and the target loop device is mounted to the empty subdirectory using a mount command, so that when the user accesses the empty subdirectory through the Linux system, read and write operations can be performed on the physical disk block device associated with the target loop device.

2. The method for controlling mobile storage media according to claim 1, characterized in that, The invocation of the control program to authenticate the removable storage medium specifically includes: The control program is invoked to obtain the authentication information entered by the user through the Linux system; Determine whether the verification information entered by the user is consistent with the verification information in the registration information; If yes, authentication is successful; otherwise, the normal partition is unloaded from the Linux system.

3. The method for controlling mobile storage media according to claim 1, characterized in that, The step of selecting a portion of storage area from the removable storage medium to perform a partitioning operation, obtaining the normal partition, and using the unselected storage area from the removable storage medium as the physical disk block device, specifically includes: Write the start and end address information of the normal partition into the partition table set in the removable storage medium; Based on the storage space size of the removable storage medium and the start and end address information of the normal partition stored in the partition table, the unpartitioned storage area in the removable storage medium is determined, and the unpartitioned storage area is set as the physical disk block device.

4. A control device for a portable storage medium, characterized in that, The device includes: The detection module is used to mount the formatted normal partition in the removable storage medium to the Linux system when the removable storage medium is detected to be connected to the Linux system. The removable storage medium includes: a formatted normal partition and an unformatted physical disk block device. The acquisition module is used to acquire the pre-stored management program from the normal partition through the Linux system; The module is used to call the management program to authenticate the removable storage medium, and after successful authentication, access the unformatted physical disk block device in the removable storage medium through the loop device in the Linux system; The device further includes: A processing module is configured to select a portion of storage area from the removable storage medium to perform a partitioning operation, thereby obtaining a normal partition, and to use the unselected storage area in the removable storage medium as the physical disk block device, wherein the storage space size of the normal partition is smaller than the storage space size of the physical disk block device; to format the normal partition and store a preset management program in the formatted normal partition; wherein the Linux system can only mount the formatted storage area in the removable storage medium; and to store preset registration information in the formatted normal partition; wherein the registration information includes verification information used for identity verification. The module in question is specifically used for: The management program is invoked to identify an idle target loop device from the Linux system; the physical disk block device is associated with the target loop device using the losetup command; an empty subdirectory is created in the root directory of the file structure tree of the Linux system as a mount point, and the target loop device is mounted to the empty subdirectory using a mount command, so that when the user accesses the empty subdirectory through the Linux system, read and write operations can be performed on the physical disk block device associated with the target loop device.

5. A computer device, the computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Encryption method of removable disc

    CN103136122A

  • Encryption method and apparatus

    CN106650477A

  • Encryption and decryption method and system for removable storage medium

    CN110532791A