CN115794753A - Dual-file system implementation method and device, electronic equipment and storage medium - Google Patents

Dual-file system implementation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115794753A
CN115794753A CN202211491275.0A CN202211491275A CN115794753A CN 115794753 A CN115794753 A CN 115794753A CN 202211491275 A CN202211491275 A CN 202211491275A CN 115794753 A CN115794753 A CN 115794753A
Authority
CN
China
Prior art keywords
partition
storage
file system
management system
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211491275.0A
Other languages
Chinese (zh)
Inventor
周振宇
赵常龙
陈迪
陈浪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Jiefeng Technology Co ltd
Original Assignee
Hangzhou Jiefeng Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Jiefeng Technology Co ltd filed Critical Hangzhou Jiefeng Technology Co ltd
Priority to CN202211491275.0A priority Critical patent/CN115794753A/en
Publication of CN115794753A publication Critical patent/CN115794753A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method and a device for realizing a dual-file system, electronic equipment and a storage medium. The dual file system implementation method comprises the following steps: dividing a storage device of a target device into a plurality of storage partitions, wherein the target device is an electronic device using a private file system, and the private file system is a hard disk file operating system used for managing the storage partitions; configuring a first partition and a second partition in a plurality of storage partitions; the first partition and the second partition are respectively an inactive partition and an active partition; storing private file system data and standard file system data based on the first partition and the second partition, respectively; the standard file system is a hard disk file operating system used by other electronic equipment, and the other electronic equipment is electronic equipment which can be externally connected with storage equipment, such as a mobile phone, a computer and the like. By the method, the data of the private file system can be protected from being damaged when the storage device with the private file system is accessed to other electronic devices using the standard file system.

Description

Dual-file system implementation method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of storage, and in particular, to a method and an apparatus for implementing a dual file system, an electronic device, and a storage medium.
Background
Currently, some devices have independent hard file operating systems, called "private file systems", for example, hard file operating systems used by monitoring devices manufactured by different manufacturers and having respective memories are private file systems. Compared with a standard file system used by a memory of electronic equipment such as a mobile phone, a computer and the like, the private file system has the characteristics of good data privacy, more flexibility in operation and higher reading and writing efficiency.
However, when the storage device with the private file system is accessed to the electronic device using the standard file system, there is a problem that the private file system cannot be identified, so that the storage device with the private file system can be identified as a storage device without a hard disk file operating system, and then the storage device with the private file system can be formatted.
Disclosure of Invention
In view of the above, the present application aims to provide a dual file system implementation method, apparatus, electronic device and computer readable storage medium, so as to protect data in a storage device with a private file system from being damaged when accessing other electronic devices.
In a first aspect, an embodiment of the present application provides a method for implementing a dual file system, including: dividing a storage device of a target device into a plurality of storage partitions, wherein the target device is an electronic device using a private file system, and the private file system is a hard disk file operating system used by the target device; configuring a first partition and a second partition in the plurality of memory partitions; wherein the first partition and the second partition are an inactive partition and an active partition, respectively; storing the private filesystem data and standard filesystem data, respectively, based on the first partition and the second partition; the standard file system is a hard disk file operating system used by other electronic equipment except the target equipment for managing the storage partition.
In the embodiment of the application, the storage device is split, so that different storage partitions can be obtained, and different functions can be realized through different storage partitions. Thus, the storage partition may be configured to configure the first partition and the second partition as an inactive partition and an active partition, respectively, the inactive partition storing the private filesystem data and the active partition storing the standard filesystem data, thereby enabling the target device to store and use the private filesystem and the standard filesystem simultaneously. The storage device of the target device is accessed into other electronic devices, and if the partition is identified to be an inactive partition, the identification is not continued, so that the data of the private file system is protected from being read and damaged, and then other electronic devices can identify other partitions. Therefore, after the storage device of the target device is accessed to other electronic devices, the other electronic devices can perform read-write operation on the storage device of the target device through the standard file system, and the private file system is not damaged, so that the data of the private file system is protected.
In one embodiment, the configuring the first partition and the second partition includes: based on a preset partition rule, respectively modifying partition attributes of different storage partitions to obtain the first partition and the second partition; wherein the preset partition rule comprises definitions of partition attributes of the inactive partition and the active partition respectively, and the partition attributes characterize the type of the storage partition.
In the embodiment of the application, the partition attributes of the storage partition are modified through the preset partition rule, the first partition and the second partition can be configured, the process of modifying the partition attributes is easy to realize, the configuration process of the storage partition can be simplified, and the configuration efficiency of the first partition and the second partition is improved.
In an embodiment, the dividing the storage device of the target device into a plurality of storage partitions includes: determining a target partition management system corresponding to the space capacity of the storage equipment based on the space capacity of the storage equipment and a preset relation between the space capacity and the partition management system; dividing the storage device into the plurality of storage partitions using the target partition management system.
The space capacities of different storage devices may have different sizes, and a part of the partition management system cannot completely partition the storage devices with all the capacities, thereby causing a waste of storage space capacity resources. In the embodiment of the application, by presetting the relationship, the partition management system corresponding to the space capacity of the storage device can be used for partitioning, and the space capacity of the storage device is fully utilized.
In one embodiment, the partition management system comprises an MBR partition management system, the determining a target partition management system corresponding to the space capacity of the storage device comprises: and when the space capacity is determined to be smaller than or equal to a preset space threshold value, determining that the MBR partition management system is the target partition management system.
In the embodiment of the present application, although the MBR partition management system cannot partition a storage device with a larger capacity, since many devices use MBR sectors at present, the MBR partition management system is used to partition a storage device with a space capacity less than or equal to a preset space threshold, and can partition a larger number of storage devices, thereby improving applicability of partitioning different storage devices.
In one embodiment, the configuring the first partition and the second partition includes: and modifying MBR partition table data of different storage partitions respectively based on preset MBR partition table data definitions of the inactive partition and the active partition to obtain the first partition and the second partition, wherein the MBR partition table data is used for representing the types of the storage partitions obtained by partitioning based on an MBR partition management system.
In the embodiment of the application, the MBR partition table data comprises partition attributes of each storage partition obtained by partitioning, so that the MBR partition table data can be modified and configured to obtain the first partition and the second partition.
In an embodiment, the partition management system includes a GPT partition management system, and when it is determined that the size of the storage device is greater than a preset space threshold, the GPT partition management system is determined to be the storage device partition management system.
In the embodiment of the application, the GPT partition management system can effectively divide a larger storage device, so that the GPT partition management system is used for dividing the storage device which is larger than the preset space threshold value, and the waste of storage resources caused by dividing the storage partition can be effectively avoided.
In one embodiment, the configuring the first partition and the second partition includes: and modifying the GPT partition types of different storage partitions respectively based on preset GPT partition type definitions of the inactive partition and the active partition to obtain the first partition and the second partition, wherein the GPT partition type represents the type of the storage partition obtained by partitioning based on the GPT partition management system.
In the embodiment of the application, the storage partitions divided by the GPT partition management system have partition types, so that the storage partitions can be configured into the active partitions and the inactive partitions only by modifying the partition types of the storage partitions based on the preset GPT partition type definition, the implementation is easy, the process of configuring the storage partitions can be simplified, and the configuration efficiency is improved.
In a second aspect, an embodiment of the present application provides an apparatus for implementing a dual file system, including: the device comprises a partitioning module, a storage module and a processing module, wherein the partitioning module is used for partitioning a storage device of a target device into a plurality of storage partitions, the target device is an electronic device using a private file system, and the private file system is a hard disk file operating system used by the target device; a configuration module to configure a first partition and a second partition in the plurality of storage partitions; wherein the first partition and the second partition are an inactive partition and an active partition, respectively; the storage module is used for respectively storing the data of the private file system and the data of a standard file system based on the first partition and the second partition; the standard file system is a hard disk file operating system used by other electronic equipment except the target equipment to manage the storage partition.
In a third aspect, an embodiment of the present application provides an electronic device, including a communication module, a memory, and a processor, where the communication module is connected to a storage device of a target device, the target device is an electronic device using a private file system, and the private file system is a hard disk file operating system used by a management storage partition of the target device; the memory has stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the method of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the dual file system implementation method according to the first aspect.
Additional features and advantages of the disclosure will be set forth in the description which follows, or in part may be learned by the practice of the above-described techniques of the disclosure, or may be learned by practice of the disclosure.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a flowchart of a dual file system implementation method according to an embodiment of the present application;
FIG. 2 is a schematic illustration of a boot sector of an MBR partition management system according to an embodiment of the present application;
fig. 3 is a schematic diagram of partition types of a GPT partition management system according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a dual file system implementation apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Icon: a dual file system implementation 200; a partitioning module 210; a configuration module 220; a storage module 230; an electronic device 300; a processor 310; a memory 320; a communication module 330.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, fig. 1 is a diagram illustrating a method for implementing a dual file system according to an embodiment of the present application, including:
s110, dividing the storage device of the target device into a plurality of storage partitions, wherein the target device is an electronic device using a private file system, and the private file system is a hard disk file operating system used by the target device for managing the storage partitions.
The storage device of the target device may be a hard disk, an SD Card (Secure Digital Memory Card), or the like. The private file system may be a hard disk file operating system used by each of different manufacturers, and specific contents of the private file system may refer to the prior art and are not described herein again.
The storage device may also be configured to store data of the target device during operation, including a work log, a cache, an execution result, and the like, for example, when the target device is a video monitoring device, the storage device may store data of a monitoring video, and when the target device is a recording device, the storage device may store recorded audio data. In some other embodiments, the target device may also be another device with a private file system, which is not listed here for brevity.
In this embodiment, the storage device of the target device may be accessed to other electronic devices, for example, the storage device may be an SD card, a usb disk, a hard disk, and the like, and may be used to access other electronic devices except the target device; the target device may also be an electronic device that provides an interface for opening its own storage device to the outside, so that other electronic devices can read and write the storage device of the target device. The standard file system can be a hard disk file operating system such as fat32/Ext4, and other electronic equipment can be a computer, a mobile phone and the like. The specific content of the standard file system may refer to the prior art, which is not described herein again.
In this embodiment, the storage device of the storage device may be divided to obtain a plurality of storage partitions, so that different storage partitions are used to store the private file system data and the standard file system data, respectively. Wherein the standard file system is a hard disk file operating system used by other electronic devices except the target device to manage the storage partition.
When the storage device is partitioned, an existing partitioning tool or system, for example, an MBR (Master Boot Record) partitioning management system, a GPT (global unique identification Table) partitioning management system, or a partitioning tool provided by the electronic device itself, may be used, and a specific implementation process of partitioning may refer to the prior art and is not described in detail.
S120, configuring a first partition and a second partition in a plurality of storage partitions; the first partition and the second partition are respectively an inactive partition and an active partition.
After the other electronic device accesses the storage device of the target device, the other electronic device detects data in the storage device of the target device, so as to determine a hard disk file operating system used by the storage device of the target device, and the other electronic device can mount the first identified hard disk file operating system. When the private file system is detected and identified, other electronic devices may not be able to identify the private file system, and then perform a formatting operation on the storage device of the target device, thereby causing the data of the private file system to be damaged.
To avoid the above situation, in this embodiment, two memory partitions of the divided memory partitions may be configured to obtain a first partition which is an inactive partition and a second partition which is an active partition.
In this embodiment, the inactive partition is a storage partition that is not detected and identified by other electronic devices, and the active partition is a storage partition that can be normally detected and identified by other electronic devices. Therefore, after the storage device of the target device is accessed to other electronic devices, the other electronic devices do not detect and identify the inactive partition, but normally detect and identify the active partition.
In this embodiment, the two selected memory partitions may be any two memory partitions whose available memory sizes meet the requirement. The data of the private file system and the data of the standard file system have certain sizes, and the storage partitions with the sizes corresponding to the private file system and the standard file system or larger than the private file system and the standard file system can be selected for configuration. The data sizes of the private file system and the standard file system may be different according to different hard disk file operating systems used by different manufacturers, and the data sizes of the private file system and the standard file system are not limited herein.
In one embodiment, partition attributes of different storage partitions are modified respectively based on a preset partition rule to obtain a first partition and a second partition; the preset partition rule comprises definitions of partition attributes of the inactive partition and the active partition respectively, and the partition attributes represent types of the storage partitions.
In this embodiment, each storage partition has respective partition attributes, including partition size, number of sectors, partition type, and the like. The preset partition rule includes definitions of partition attributes of the inactive partition and the active partition, respectively, so that after the memory partition is configured according to the preset partition rule, a first partition with the inactive partition attributes and a second partition with the active partition attributes can be obtained.
In this embodiment, the partition type may be modified to configure the storage partition into the first partition and the second partition. In some other embodiments, the first partition and the second partition may be further marked by adding a flag for characterizing the inactive partition and the active partition, so that the other electronic device preferentially detects the flag and determines the type of the partition by the flag. It is understood that there are various ways to actually configure the memory partition, and the details are not described herein.
S130, storing the private file system data and the standard file system data based on the first partition and the second partition respectively.
In combination with the above, the standard file system is a hard disk file operating system used by other electronic devices, and the other electronic devices are electronic devices such as mobile phones and computers which can be connected with external storage devices.
In this embodiment, after the first partition and the second partition are obtained, the private file system data and the standard file system data may be stored in the first partition and the second partition, respectively. The working data of the target device may be stored in the second partition, or may be stored in other partitions besides the first partition and the second partition.
In some other embodiments, the first partition and the second partition may also be used to store other data. For example, some more important data may be stored in the first partition, such as privacy data, data of an operating program of the target device, and the like, so as to avoid other storage devices from reading and writing the data. The data type in the form can be put into the first partition by setting a judgment threshold of the importance degree and calculating the importance degree of the data to judge whether the data needs to be stored into the first partition or presetting the form of the data type.
Some data that can be obtained by the outside world or data that needs to be provided to the outside world can be stored in the second partition. For example, the target device may include data that needs to be debugged, and when the target device is a monitoring device, the target device may further include monitoring data that can be provided to the outside. The part of data can be read and written by the outside by storing into the second partition.
It can be understood that the data stored in the first partition and the second partition can be reasonably set according to the user requirements, and are not described herein any more.
Through the method, when the storage device of the target device is accessed to other electronic devices, if the other electronic devices detect and recognize that the first partition is the inactive partition, the data in the storage partition is not further recognized, and the other storage partitions are detected instead, so that the private file system data in the first partition are protected. And if the other electronic equipment detects and identifies the second partition as the active partition, identifying the second partition, acquiring data of the standard file system in the second partition, and realizing read-write operation on the storage equipment of the target equipment based on the standard file system.
In the embodiment of the application, the storage device is split, so that different storage partitions can be obtained, and different functions can be realized through different storage partitions. Thus, the storage partition may be configured to configure the first partition and the second partition as an inactive partition and an active partition, respectively, the inactive partition storing data of the private file system and the active partition storing data of the standard file system, thereby enabling the target device to use the private file system and the standard file system at the same time. When the storage device of the target device is accessed into other electronic devices, if the partition is identified to be an inactive partition, the identification is not continued, so that the data of the private file system is protected from being read and damaged, then other electronic devices can identify other partitions, and when the partition is identified to be an active partition, the other electronic devices can realize normal reading and writing of the storage device of the target device through the data of the standard file system in the active partition. Therefore, after the storage device of the target device is accessed to other electronic devices, the other electronic devices can perform read-write operation on the storage device of the target device through the standard file system, and the private file system is not damaged, so that the data of the private file system is protected.
Currently, many MBR partition management systems are available for partition management. After the storage device is divided, a plurality of partitions are obtained, each partition comprises a plurality of sectors, one sector is 512 bytes, and the sectors are used for representing the space capacity of the storage device. However, if the MBR partition management system uses four bytes to store the total number of sectors in one storage partition, the maximum total number of sectors in one storage partition can be expressed as a power of 32 of 2, and therefore, when the MBR partition management system is used for partitioning, the maximum space capacity that the MBR partition management system can partition cannot exceed 2TB, that is, the maximum available space size of the MBR partition management system is 2TB. The specific principle of the MBR partition management system can refer to the prior art, and is not expanded in detail here.
However, the respective storage devices of different electronic devices may have different sizes of space capacities, for example, the space capacities of the different storage devices are 32G, 512G, 6TB, 8TB, and so on, respectively. When the space capacity is large, partitions obtained by partitioning based on the MBR partition management system cannot fully utilize the space capacity of the storage device, and the GPT partition management system can partition the storage device with any size of space capacity and can fully utilize the space capacity of the storage device.
In order to solve the above problem, in the embodiment provided in the application, when the storage device is divided into a plurality of storage partitions, a target partition management system corresponding to the space capacity of the storage device may be further determined based on the space capacity of the storage device and a preset relationship between the space capacity and the partition management system; the storage device is partitioned into a plurality of storage partitions using a target partition management system.
In this embodiment, the preset relationship includes a space capacity and a corresponding partition management system. Therefore, the partition management system corresponding to the space capacity of the storage device of the target device can be selected for partitioning, and waste of the space capacity of the storage device is avoided.
In one embodiment, the preset relationship includes a relationship between a preset space threshold, a space capacity size, and a corresponding partition management system.
In this embodiment, the size of the preset spatial threshold is 2TB.
In this embodiment, determining the target partition management system corresponding to the space capacity of the storage device may include:
when the space capacity of the storage device of the target device is determined to be greater than the preset space threshold, the GPT partition management system may be used for partitioning, that is, the GPT partition management system is determined to be the target partition management system.
When the space capacity of the storage device of the target device is determined to be less than or equal to the preset space threshold, the MBR partition management system may be used for partitioning, that is, the MBR partition management system is determined to be the target partition management system.
In the embodiment of the present application, because the partition management systems used are different, the manners of configuring the first partition and the second partition are also different, and then, after the partition is performed by using the MBR partition management system and the GPT partition management system, the configuration process of the first partition and the second partition will be described.
For the MBR partition management system, the MBR partition table data of different storage partitions can be modified respectively based on preset MBR partition table data definitions of inactive partitions and active partitions to obtain a first partition and a second partition, and the MBR partition table data is the type of the storage partition obtained by partitioning based on the MBR partition management system.
Referring to fig. 2, fig. 2 is a schematic view of a boot sector of an MBR partition management system according to an embodiment of the present disclosure.
The bootstrap sector schematic diagram shown in fig. 2 includes bytes in a bootstrap sector of the MBR partition management system, where the sector is 512 bytes, and includes: MBR boot program, DPT (Disk Partition Table), and a valid flag. Wherein, the first 446 bytes shown in FIG. 2 is the bootstrap; the frame selection area is 64 bytes of DPT, the DPT is MBR partition table data after partition of an MBR partition management system, each 16 bytes of DPT is used for describing one partition, namely, the 16 bytes in sequence of DPT can represent the type of each partition after partition; a two byte valid flag "55AA" is used to characterize whether the DPT is valid.
Thus, when configuring the first partition and the second partition, the DPT may be modified, thereby enabling the DPT to be used to characterize the type of memory partition.
As shown in fig. 2, the first partition is: 00 41 02 00 00FE FF 00 FF 10 00 00 00 00B0 B603. Wherein, byte 1, 0x00, indicates that the partition is an inactive partition, and byte 5, 0x00, indicates that the partition is not allocated, i.e. indicates that the partition is not used. Bytes 9-12, collectively representing a partition start sector number of 4096, and bytes 13-16, collectively representing a total number of sectors of a partition 62304256.
It is understood that the above description and the accompanying drawings are only examples, and when configuring a storage partition, the 1 st byte of the storage partition is configured as 00 and the 5 th byte of the storage partition is configured as 00, i.e. the partition can be characterized as an active partition and can be used for storing data.
With continued reference to fig. 2, the second partition is: 80FE FF 0B FF 01C0B 03 0050 00, wherein the 1 st byte 0x80 indicates that the partition is an active partition, the 5 th byte 0x0B indicates that the partition mounts the Fat standard file system, the 9 th to 12 th bytes collectively indicate that the partition start sector number is 62308353, and the 13 th to 16 th bytes collectively indicate that the total sector number of the partition is 20480 (10M).
The size 10M of the total number of sectors is only an example, and in actual setting, other sizes may be set according to needs.
In fig. 2, the divided storage partitions include only two partitions, and for other partitions, the other partitions may be reasonably set according to requirements and are not expanded here.
Referring to table 1, table 1 is a DPT byte meaning table provided in this embodiment, and when configuring a partition, the setting may be performed according to the DPT byte meaning table.
Figure BDA0003963357820000121
Figure BDA0003963357820000131
TABLE 1 DPT Byte implication Table
The DPT byte meaning table in table 1 reveals the meaning of a part of bytes, and for the configuration of other bytes in the DPT, the configuration can be set reasonably according to the requirement, and specific contents may refer to the prior art and are not described herein again.
Next, for the GPT partition management system, based on a preset GPT partition type definition for an inactive partition and an active partition, modifying the GPT partition types of different storage partitions respectively to obtain a first partition and the second partition. The GPT partition type can represent the type of a memory partition obtained by partitioning based on a GPT partition management system.
In this embodiment, in a plurality of storage partitions obtained by partitioning the GPT partition management system, each storage partition includes a plurality of sectors, each sector is 512 bytes, and a sector is usually represented by an LBA (Logical Block Address). Where LBA 0 represents the first sector, LBA-1 represents the last sector, and so on.
LBA 0 is the header of the GPT partition and can store a boot sector of the MBR to be compatible with the MBR partition management system. The 5 th byte of the boot sector DPT is a byte indicating that the GPT partition management system is used, for example, 0xEE.
The LBA 1 is used to characterize a partition table header, to define the available space of the hard disk and data such as the size and number of items constituting the partition table, and to store a check table, to determine whether the partition table is faulty, and to characterize the hard disk as unusable if the check is faulty.
LBA 2-33 is used to store partition table entries, and the 16 bytes of the default location of a partition table entry are used to indicate the partition type, i.e., the GUID value.
In the GPT partition management system, the GUID value of a partial partition type has its corresponding meaning, based on which a storage partition can be determined as a storage partition of the partition type to which the GUID value corresponds, and the meaning relationship of the GUID value can refer to the prior art, and is not expanded here.
Referring to fig. 3, fig. 3 is a schematic diagram illustrating partition types of a partition management system according to an embodiment of the present application.
In this embodiment, when configuring the first partition of the inactive partition, the GUID value of the partition type may be modified to have a value other than the corresponding meaning value, so that the meaning corresponding to the GUID value is allowed, and after the GUID value is identified, the continued identification is not performed. Thus, the partition may be configured as an inactive partition, and it may be determined to store data of the private file system for the first partition. As shown in fig. 3, 55 d … e 35 may be represented as a first partition.
It is understood that the inactive partition refers to a storage partition that is not recognized by other electronic devices, and therefore, in the present embodiment, the partition type of the inactive partition may not belong to the defined partition type, and the GUID value thereof may be any value that does not have a corresponding meaning.
In this embodiment, when the second partition of the active partition is configured, the GUID value of the partition may be configured to be the GUID value corresponding to the standard partition type, so that the partition may be normally identified, and after the standard file system is stored, it may be identified that the partition is mounted with the standard file system. As shown in fig. 3, A2 A0 … C7 may be represented as a second partition.
Therefore, the data of the private file system and the data of the standard file system can be stored in the corresponding positions of the first partition and the second partition respectively. When other electronic equipment detects the storage equipment of the target equipment, after detecting the GUID corresponding to the first partition, the other electronic equipment skips the first partition and continues to detect the subsequent storage partition, and when the GUID of the second partition is detected, the data in the second partition is identified and mounted so as to realize the read-write operation on the storage equipment of the target equipment.
Based on the same inventive concept, the embodiment of the application also provides a double-file implementation device. Referring to fig. 4, fig. 4 is a schematic structural diagram of a dual file system implementation apparatus according to an embodiment of the present disclosure, in which the dual file system implementation apparatus 200 includes a partition module 210, a configuration module 220, and a storage module 230.
The partition module 210 is configured to divide the storage device of the target device into multiple storage partitions, where the storage device of the target device is a storage device with a private file system, and the private file system is a hard disk file operating system used by the storage partition managed by the target device.
A configuration module 220, configured to configure a first partition and a second partition in a plurality of storage partitions; the first partition and the second partition are respectively an inactive partition and an active partition.
A storage module 230 for storing the private file system data and the standard file system data based on the first partition and the second partition, respectively.
The configuration module 220 is further configured to modify partition attributes of different storage partitions respectively based on a preset partition rule to obtain a first partition and the second partition; the preset partition rule comprises definitions of partition attributes of the inactive partition and the active partition respectively, and the partition attributes represent types of the storage partitions.
The partition module 210 is further configured to determine a target partition management system corresponding to the space capacity of the storage device based on the space capacity of the storage device and a preset relationship between the space capacity and the partition management system; the storage device is partitioned into a plurality of storage partitions using a target partition management system.
The partition management system comprises a GPT partition management system and an MBR partition management system.
The partitioning module 210 is further configured to determine that the MBR partition management system is a target partition management system when it is determined that the space capacity of the storage device is less than or equal to a preset space threshold.
The configuration module 220 is further configured to modify MBR partition table data of different storage partitions respectively based on preset MBR partition table data definitions of the inactive partition and the active partition, so as to obtain a first partition and the second partition, where the MBR partition table data is used to characterize types of the storage partitions obtained by partitioning based on the MBR partition management system.
The partitioning module 210 is further configured to determine that the GPT partition management system is the target partition management system when it is determined that the space capacity of the storage device is greater than the preset space threshold.
The configuration module 220 modifies the GPT partition types of different storage partitions respectively based on the preset GPT partition type definitions of the inactive partition and the active partition to obtain a first partition and a second partition, and the GPT partition type represents the type of the storage partition obtained by partitioning based on the GPT partition management system.
It can be understood that the dual file system implementation apparatus 200 provided in the present application corresponds to the dual file system implementation method provided in the present application, and for brevity of the description, the same or similar parts may refer to the contents of the dual file system implementation method part, and are not described herein again.
The modules in the above dual file system implementation apparatus may be implemented wholly or partially by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent of a processor in the server, and can also be stored in a memory in the server in a software form, so that the processor can call and execute operations corresponding to the modules. The processor can be a Central Processing Unit (CPU), a microprocessor, a singlechip and the like.
The above-described dual file system implementation method or storage device may be implemented in the form of computer readable instructions that may be executed on an electronic device as shown in fig. 4.
Referring to fig. 5, an embodiment of the present application further provides an electronic device 300, which can be used as an execution main body of the foregoing dual file system implementation method, including: a processor 310 and a memory 320 communicatively coupled to the processor 310, and a communication module 330.
The memory 320 stores instructions executable by the processor 310, and the instructions are executed by the processor 310 to enable the processor 310 to execute the dual file system implementation method in the foregoing embodiments or to implement the functions of the dual file system implementation apparatus in the foregoing embodiments.
The processor 310 and the memory 320 may be connected by a communication bus. Or by some communication module, for example: a wireless communication module, a Bluetooth communication module, a 4G/5G communication module, etc.
The processor 310 may be an integrated circuit chip having signal processing capabilities. The Processor 310 may be a general-purpose Processor including a CPU (Central Processing Unit), an NP (Network Processor), and the like; but may also be a digital signal processor, an application specific integrated circuit, an off-the-shelf programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components. Which may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The Memory 320 may include, but is not limited to, a RAM (Random Access Memory), a ROM (Read Only Memory), a PROM (Programmable Read-Only Memory), an EPROM (Erasable Programmable Read-Only Memory), an EEPROM (electrically Erasable Programmable Read-Only Memory), and the like.
The communication module 330 is used to implement connection between the electronic device 300 and a target device, the communication module 330 is provided with an Interface, and is connected to other devices through the Interface, and the Interface may include but is not limited to a Serial port 232, a Serial port 485, an ethernet, a GPIB (General-Purpose-Serial Bus), a USB (Universal Serial Bus), and the like.
It is understood that the electronic device 300 may further include more general modules required by itself, and the embodiments of the present application are not described in detail.
An embodiment of the present application further provides a computer-readable medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computer, the dual file system implementation method in the foregoing embodiment is executed or the function of the dual file system implementation apparatus in the foregoing embodiment is implemented.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A dual file system implementation method is characterized by comprising the following steps:
dividing a storage device of a target device into a plurality of storage partitions, wherein the target device is an electronic device using a private file system, and the private file system is a hard disk file operating system used by the target device for managing the storage partitions;
configuring a first partition and a second partition in the plurality of memory partitions; wherein the first partition and the second partition are an inactive partition and an active partition, respectively;
storing the private filesystem data and standard filesystem data, respectively, based on the first partition and the second partition; the standard file system is a hard disk file operating system used by other electronic equipment except the target equipment to manage the storage partition.
2. The method of claim 1, wherein the configuring the first partition and the second partition comprises:
based on a preset partition rule, respectively modifying partition attributes of different storage partitions to obtain the first partition and the second partition;
wherein the preset partition rule includes definitions of partition attributes by the inactive partition and the active partition, respectively, the partition attributes characterizing a type of the storage partition.
3. The method of claim 1 or 2, wherein the dividing the storage device of the target device into a plurality of storage partitions comprises:
determining a target partition management system corresponding to the space capacity of the storage device based on the space capacity of the storage device and a preset relation between the space capacity and the partition management system;
dividing the storage device into the plurality of storage partitions using the target partition management system.
4. The method of claim 3, wherein the partition management system comprises an MBR partition management system, and wherein determining the target partition management system corresponding to the space capacity of the storage device comprises:
and when the space capacity is determined to be smaller than or equal to a preset space threshold value, determining that the MBR partition management system is the target partition management system.
5. The method of claim 4, wherein the configuring the first partition and the second partition comprises:
and modifying MBR partition table data of different storage partitions respectively based on preset MBR partition table data definitions of the inactive partition and the active partition to obtain the first partition and the second partition, wherein the MBR partition table data is used for representing the types of the storage partitions obtained by partitioning based on an MBR partition management system.
6. The method of claim 3, wherein the partition management system, including a GPT partition management system, and wherein determining the target partition management system corresponding to the space capacity of the storage device comprises:
when the space capacity is determined to be larger than a preset space threshold value, determining the GPT partition management system as the target partition management system.
7. The method of claim 6, wherein the configuring the first partition and the second partition comprises:
and modifying the GPT partition types of different storage partitions respectively based on preset GPT partition type definitions of the inactive partition and the active partition to obtain the first partition and the second partition, wherein the GPT partition type represents the type of the storage partition obtained by partitioning based on the GPT partition management system.
8. A dual file system implementation apparatus, comprising:
the partition module is used for dividing storage equipment of target equipment into a plurality of storage partitions, wherein the target equipment is electronic equipment using a private file system, and the private file system is a hard disk file operating system used by the target equipment for managing the storage partitions;
a configuration module to configure a first partition and a second partition in the plurality of storage partitions; wherein the first partition and the second partition are an inactive partition and an active partition, respectively;
a storage module to store the private file system data and standard file system data, respectively, based on the first partition and the second partition; the standard file system is a hard disk file operating system used by other electronic equipment except the target equipment to manage the storage partition.
9. An electronic device is characterized by comprising a communication module, a memory and a processor, wherein the communication module is used for connecting with a storage device of a target device, the target device is an electronic device using a private file system, and the private file system is a hard disk file operating system used by a storage partition managed by the target device; the memory has stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, in which a computer program is stored which, when run on a computer, causes the computer to carry out the method according to any one of claims 1 to 7.
CN202211491275.0A 2022-11-25 2022-11-25 Dual-file system implementation method and device, electronic equipment and storage medium Pending CN115794753A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211491275.0A CN115794753A (en) 2022-11-25 2022-11-25 Dual-file system implementation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211491275.0A CN115794753A (en) 2022-11-25 2022-11-25 Dual-file system implementation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115794753A true CN115794753A (en) 2023-03-14

Family

ID=85441536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211491275.0A Pending CN115794753A (en) 2022-11-25 2022-11-25 Dual-file system implementation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115794753A (en)

Similar Documents

Publication Publication Date Title
US11360696B2 (en) System startup method and apparatus, electronic device, and storage medium
US8918579B2 (en) Storage device and method for selective data compression
US8954705B2 (en) Memory space management method and memory controller and memory storage device and memory storage using the same
US8996787B2 (en) Storage device aware of I/O transaction and stored data
CN106648463B (en) Nand Flash block management method and system
CN107797934B (en) Method for processing de-allocation command and storage device
US9047176B2 (en) Storage device and method for utilizing unused storage space
WO2017050064A1 (en) Memory management method and device for shared memory database
CN107797938B (en) Method for accelerating de-allocation command processing and storage device
KR20170010810A (en) Method, device and user equipment for reading/writing data in nand flash
WO2016173470A1 (en) Storage method and system based on embedded multi-media card
KR101065147B1 (en) Storage device and method of accessing a status thereof
US10990323B2 (en) Flash memory controller, memory device and method for accessing flash memory module
CN109871337B (en) SSD storage medium switching method and system
CN105279094A (en) NAND Flash operation processing method, NAND Flash operation processing device and logic device
CN115794753A (en) Dual-file system implementation method and device, electronic equipment and storage medium
CN114444141B (en) Solid state disk and solid state disk data protection method, device and equipment
US8370599B2 (en) Storage system and controlling system and method thereof
CN115543859A (en) Wear leveling optimization method, device, equipment and medium for multi-partition SSD
CN210776642U (en) Automatic disk splicing device for multiple TF cards
TW201337553A (en) Data writing method, memory controller and memory storage apparatus
US20200151119A1 (en) Method and apparatus for performing access control between host device and memory device
CN107632774B (en) Method and device for repairing disk mount
CN111435331A (en) Data writing method and device for storage volume, electronic equipment and machine-readable storage medium
CN111198651B (en) Method for managing storage space, data storage device and controller thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination