Storage device management method, device and equipment and computer readable storage medium

By creating mirror files for physical storage devices in the server and performing two-way synchronization, the problem of insufficient number of USB ports and distinction is solved, and the use of virtual storage devices is realized and the user experience is improved.

CN119088318APending Publication Date: 2024-12-06SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411295686.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

The number of USB ports in the server is limited, and users need to distinguish between the host and the BMC USB port, which reduces the user experience.

Method used

Create a mirror file for the accessed physical storage device through BMC, and synchronize the data in the physical storage device to the mirror file, build a virtual storage device, realize the host's reading and writing of the physical storage device, use BMC for bidirectional synchronization, and expand the USB port Count and unify USB port control.

Benefits of technology

It realizes the host's use of physical storage devices with connected USB ports, expands the number of USB ports, improves the user experience, and avoids the need to distinguish the controllers to which the USB port belongs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088318A_ABST
    Figure CN119088318A_ABST
Patent Text Reader

Abstract

The invention discloses a storage device management method, device and equipment and a computer readable storage medium, and belongs to the field of servers. A BMC in the application can determine a mirror image file for an entity storage device connected to a USB port of the BMC and synchronize data in the entity storage device to the mirror image file; then the mirror image file is used as the content of a virtual storage device, the virtual storage device is constructed for a host of the server through a virtual USB storage function, so that the host reads and writes the mirror image file, and the update content in the entity storage device and the mirror image file is bidirectionally synchronized through the BMC; therefore, the host can use the entity storage device connected to the USB port of the BMC, on one hand, the number of the USB ports of the host is increased, and on the other hand, the USB port of the BMC can be used as the USB port of the host, so that a user does not need to distinguish the controller to which the USB port belongs, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of servers, and in particular to a storage device management method, device, equipment and computer-readable storage medium. Background Art

[0002] In a server, the host and BMC (Board Management Controller) are each equipped with an external USB (Universal Serial Bus) port. The USB port can be used to connect various peripheral devices that support the USB protocol, such as storage devices, keyboards, mice, and network cards. However, on the one hand, the number of USB ports provided by the host is relatively small, which may not meet the user's demand for the number of USB ports of the host. On the other hand, the USB ports belong to different controllers. When using the USB ports, the user needs to distinguish whether the USB port belongs to the BMC or the host, which reduces the user experience.

[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. Summary of the invention

[0004] The purpose of the present invention is to provide a storage device management method, apparatus, device and computer-readable storage medium. The BMC can determine a mirror file for a physical storage device connected to its own USB port and synchronize the data in the physical storage device to the mirror file, and then use the mirror file as the content of a virtual storage device. A virtual storage device is constructed for the host of the server through the virtual USB storage function. Through the BMC's two-way synchronization of the physical storage device and the updated content in the mirror file, the host can use the "physical storage device connected to the USB port of the BMC".

[0005] In order to solve the above technical problems, the present invention provides a storage device management method, which is applied to a baseboard management controller, comprising:

[0006] When its universal serial bus port is connected to the physical storage device, a mirror file corresponding to the physical storage device is determined;

[0007] Synchronize the data in the physical storage device to the mirror file;

[0008] The image file is used as the content of the virtual storage device, and a virtual storage device is constructed for the host of the server through a virtual universal serial bus storage function, so that the host can read and write the image file;

[0009] For the physical storage device and the mirror file, the updated content of the party generating the content update is synchronized to the other party.

[0010] On the other hand, for the physical storage device and the mirror file, synchronizing the updated content of the party generating the content update to the other party includes:

[0011] When data in the mirror file is updated, synchronizing the updated content in the mirror file to the physical storage device;

[0012] When data in the physical storage device is updated, synchronizing the updated content in the physical storage device to the mirror file;

[0013] When data in the mirror file is updated, synchronizing the updated content in the mirror file to the physical storage device includes:

[0014] When the host generates a write operation to the mirror file, determining the difference data of the mirror file relative to the physical storage device;

[0015] Overwrite the distinguishing data on the physical storage device.

[0016] On the other hand, when the host generates a write operation to the image file, determining the difference data of the image file relative to the physical storage device includes:

[0017] When the host generates a write operation to the image file, determining whether a current check value of the image file is consistent with a standard check value, wherein the standard check value refers to: a check value of the image file that was most recently updated;

[0018] If they are inconsistent, the difference data of the image file relative to the physical storage device is determined.

[0019] On the other hand, determining the difference data of the image file relative to the physical storage device includes:

[0020] For any sub-file in the image file, determining whether a target file exists in the physical storage device;

[0021] Wherein, the target file refers to a file with the same name as the sub-file;

[0022] If the target file exists in the physical storage device, determining whether the check value of the target file is the same as the check value of the sub-file;

[0023] If the checksum of the target file is different from the checksum of the sub-file, the sub-file is used as a difference file;

[0024] If the checksum of the target file is the same as the checksum of the sub-file, then the process ends;

[0025] If the target file does not exist in the physical storage device, the sub-file is used as a difference file;

[0026] Controlling the display to display information of each of the difference files;

[0027] In response to a selection instruction received through the human-machine interface, the selected difference file is used as the difference data.

[0028] On the other hand, controlling the display to display the information of each of the difference files includes:

[0029] For any of the difference files, if there is a file with the same name as the difference file in the physical storage device, the preset type information of the difference file and the preset type information of the file with the same name as the difference file in the physical storage device are used as the information to be displayed of the difference file;

[0030] For any of the difference files, if there is no file with the same name as the difference file in the physical storage device, using information of the preset type of the difference file as the information to be displayed for the difference file;

[0031] The display is controlled to display the information to be displayed of each of the difference files.

[0032] On the other hand, after using the image file as the content of the virtual storage device and constructing a virtual storage device for the host of the server through the virtual universal serial bus storage function, the storage device management method further includes:

[0033] When the first trigger condition or the second trigger condition is met, deleting the virtual storage device of the host of the server and stopping updating the image file corresponding to the virtual storage device;

[0034] The first trigger condition refers to: the physical storage device connected to the universal serial bus port corresponding to the image file of the virtual storage device is disconnected, and the second trigger condition refers to: receiving a closing instruction of the port sharing function through the human-machine interface.

[0035] On the other hand, when the host generates a write operation to the image file, after determining the difference data of the image file relative to the physical storage device, the difference data is overwritten before the physical storage device, and the storage device management method further includes:

[0036] The distinguishing data is encrypted using a preset encryption algorithm.

[0037] In order to solve the above technical problems, the present invention further provides a storage device management device, comprising:

[0038] A first determination module, configured to determine a mirror file corresponding to the physical storage device when its universal serial bus port is connected to the physical storage device;

[0039] A first synchronization module, used for synchronizing the data in the physical storage device to the mirror file;

[0040] A first construction module is used to use the image file as the content of the virtual storage device and construct a virtual storage device for the host of the server through a virtual universal serial bus storage function so that the host can read and write the image file;

[0041] The second synchronization module is used to synchronize the updated content of the party generating the content update to the other party, with respect to the physical storage device and the mirror file.

[0042] In order to solve the above technical problems, the present invention further provides a storage device management device, comprising:

[0043] Memory for storing computer programs;

[0044] A processor is used to implement the steps of the storage device management method as described above when executing the computer program.

[0045] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the storage device management method described above are implemented.

[0046] Beneficial effect: The present invention provides a storage device management method. Considering that the baseboard management controller can simulate the universal serial bus device of the host, the BMC in the present application can determine a mirror file for the physical storage device connected to its own USB port and synchronize the data in the physical storage device to the mirror file, and then use the mirror file as the content of the virtual storage device. Through the virtual USB storage function, a virtual storage device is constructed for the host of the server so that the host can read and write the mirror file. Through the two-way synchronization of the physical storage device and the updated content in the mirror file by the BMC, the host can use the "physical storage device connected to the USB port of the BMC". On the one hand, the number of USB ports of the host is expanded, and on the other hand, the "BMC's USB port" can be used as the "host's USB port", so that the user does not need to distinguish the controller to which the USB port belongs, thereby improving the user experience.

[0047] The present invention also provides a storage device management apparatus, equipment and computer-readable storage medium, which have the same beneficial effects as the above storage device management method. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the relevant technologies and the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0049] Figure 1 A schematic diagram of a flow chart of a storage device management method provided by the present invention;

[0050] Figure 2 A schematic diagram of the structure of a storage device management system provided by the present invention;

[0051] Figure 3 A schematic diagram of a flow chart of another storage device management method provided by the present invention;

[0052] Figure 4 A flowchart of another storage device management method provided by the present invention;

[0053] Figure 5 A flowchart of another storage device management method provided by the present invention;

[0054] Figure 6 A schematic diagram of the structure of a storage device management device provided by the present invention;

[0055] Figure 7 A schematic diagram of the structure of a storage device management device provided by the present invention;

[0056] Figure 8 A schematic diagram of the structure of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0057] The core of the present invention is to provide a storage device management method, apparatus, device and computer-readable storage medium. The BMC can determine a mirror file for a physical storage device connected to its own USB port and synchronize the data in the physical storage device to the mirror file, and then use the mirror file as the content of the virtual storage device. A virtual storage device is built for the host of the server through the virtual USB storage function. Through the BMC's two-way synchronization of the physical storage device and the updated content in the mirror file, the host can use the "physical storage device connected to the USB port of the BMC".

[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] Please refer to Figure 1 , Figure 1 A flowchart of a storage device management method provided by the present invention is provided, and the storage device management method includes:

[0060] S101: after its own universal serial bus port is connected to a physical storage device, a mirror file corresponding to the physical storage device is determined;

[0061] Specifically, considering the technical problems in the above background technology, and considering that the baseboard management controller can simulate the universal serial bus device of the host, the BMC in the embodiment of the present invention intends to use the "image file of the physical storage device connected to the USB port of the BMC" as the content of the virtual storage device to build a virtual storage device for the host, so as to realize the host's read and write operations on the image file, and then the BMC performs two-way synchronization between the image file and the physical storage device, so as to realize the host's use of the physical storage device. Therefore, in the embodiment of the present invention, the BMC can determine a mirror file corresponding to the physical storage device after its own universal serial bus port is connected to the physical storage device, and the mirror file can be used as the data basis for subsequent steps.

[0062] After the physical storage device is inserted into the USB port of the BMC, the BMC can automatically enumerate the physical storage device and register it as a SCSI (Small Computer System Interface) device. At this time, the BMC has the ability to read and write the physical storage device and can use the physical storage device normally.

[0063] S102: Synchronize the data in the physical storage device to the mirror file;

[0064] Specifically, after the image file is determined, in order to simulate the image file as a virtual storage device and provide it to the host for use, content synchronization can be performed first. In this step, data in the physical storage device can be synchronized to the image file.

[0065] S103: Using the image file as the content of the virtual storage device, a virtual storage device is constructed for the host of the server through the virtual universal serial bus storage function, so that the host can read and write the image file;

[0066] Specifically, after synchronizing the data in the physical storage device to the mirror file, in order to enable the host to smoothly read and write the mirror file as the content of the virtual storage device, the mirror file can be used as the content of the virtual storage device in this step, and a virtual storage device can be built for the host of the server through the virtual USB storage function, so that the host can read and write the mirror file.

[0067] Specifically, in order to better illustrate the embodiments of the present invention, please refer to Figure 2 , Figure 2 A structural schematic diagram of a storage device management system provided by the present invention, in which a physical storage device can be connected to a USB port of a BMC, and the BMC can enumerate relevant information of the physical storage device through a USB storage function based on a USB physical link and use the physical storage device, and then determine a mirror file, and use the mirror file as the content of a virtual storage device. Based on the USB physical link between the host and the host, a virtual storage device is simulated for the host through a virtual USB storage function, so that the host can enumerate relevant information of a "virtual storage device with a mirror file as content" and use the virtual storage device (i.e., read and write the mirror file).

[0068] Among them, the BMC can have multiple physical ports, and there can also be multiple USB physical links between the BMC and the host. When there are sufficient USB physical links between the BMC and the host, corresponding virtual storage devices can be constructed for the "physical storage devices connected to the USB ports of the BMC" and provided to the host for use.

[0069] S104: For the physical storage device and the mirror file, synchronize the updated content of the party generating the content update to the other party.

[0070] Specifically, since the host's reading and writing of the mirror file simulates the host's use of the physical storage device, in order to ensure the use effect, in the embodiment of the present invention, for the physical storage device and the mirror file, the updated content of the party that generates the content update can be synchronized to the other party, that is, data synchronization between the two can be achieved, so that the host can truly read and write the physical storage device.

[0071] The present invention provides a storage device management method. Considering that a baseboard management controller can simulate a universal serial bus device of a host, the BMC in the present application can determine a mirror file for a physical storage device connected to its own USB port and synchronize the data in the physical storage device to the mirror file. Then, the mirror file is used as the content of a virtual storage device. A virtual storage device is constructed for a host of a server through a virtual USB storage function so that the host can read and write the mirror file. Through the two-way synchronization of the physical storage device and the updated content in the mirror file by the BMC, the host can use the "physical storage device connected to the USB port of the BMC". On the one hand, the number of USB ports of the host is expanded. On the other hand, the "BMC's USB port" can be used as the "host's USB port", so that the user does not need to distinguish the controller to which the USB port belongs, thereby improving the user experience.

[0072] Based on the above embodiments:

[0073] In addition, as an optional embodiment, when the universal serial bus port is connected to the physical storage device, determining an image file corresponding to the physical storage device includes:

[0074] When its universal serial bus port is connected to the physical storage device, the capacity of the physical storage device is determined;

[0075] Determine a target capacity corresponding to the capacity of the physical storage device, wherein the target capacity is not greater than the capacity of the physical storage device;

[0076] Determine an image file with a target capacity corresponding to the physical storage device;

[0077] Synchronizing data in a physical storage device to a mirror file includes:

[0078] Determining the data to be synchronized in the physical storage device, wherein the amount of the data to be synchronized is not greater than the target capacity;

[0079] Synchronize the data to be synchronized in the physical storage device to the mirror file.

[0080] Specifically, considering that even if the physical storage device is provided to the host for use, the user may still have the need to "hide some data", therefore, in an embodiment of the present invention, first, when determining the mirror file for the physical storage device, a target capacity can be set, and the target capacity is not greater than the capacity of the physical storage device. Then, the data to be synchronized in the physical storage device can be determined (the amount of data to be synchronized is not greater than the target capacity). That is, not only can the capacity of the mirror file be set, but also the data to be synchronized to the mirror file can be selected.

[0081] The target capacity may be set by the user in real time, and the data to be synchronized may also be selected by the user in real time, which is not limited in the embodiment of the present invention.

[0082] To better illustrate the embodiments of the present invention, please refer to Figure 3 , Figure 3 A flowchart of another storage device management method provided by the present invention is shown below. Figure 3 The physical storage device in the USB flash drive is a USB flash drive. When the physical USB flash drive is inserted, an image file of the same size can be prepared according to the capacity of the USB flash drive, and then the image file can be mounted to the specified mount point for data synchronization. If there is an encrypted file in the physical USB flash drive, the decryption method (including encryption method and key) can be obtained and the encrypted file can be decrypted, and then the data in the USB flash drive can be copied to the mount point. If there is no encrypted file in the physical USB flash drive, the data in the USB flash drive can be directly copied to the mount point, and then the image file can be unmounted, and then the checksum of the image file can be calculated for backup, and then the virtual USB storage function can be enabled, and a virtual USB flash drive can be built for the host based on the image file. After the host enumerates the virtual USB flash drive, it can read and write the image file.

[0083] As an optional embodiment, for the physical storage device and the mirror file, synchronizing the updated content of the party generating the content update to the other party includes:

[0084] When the image file is updated, the updated content in the image file is synchronized to the physical storage device;

[0085] When data in the physical storage device is updated, the updated content in the physical storage device is synchronized to the mirror file;

[0086] When the image file is updated, synchronizing the updated content in the image file to the physical storage device includes:

[0087] When the host generates a write operation to the image file, determining the difference data of the image file relative to the physical storage device;

[0088] Overwrite the distinguishing data on the physical storage device.

[0089] Specifically, when bidirectional synchronization is performed between the physical storage device and the mirror file, on the one hand, when the mirror file is updated, the updated content in the mirror file can be synchronized to the physical storage device, and on the other hand, when the physical storage device is updated, the updated content in the physical storage device can be synchronized to the mirror file. The data of the physical storage device can be actively updated, which can be understood as the user's active change of the content in the physical storage device (such as a USB flash drive). Since the mirror file can be read and written by the host, the host's write action can update the data of the mirror file. Therefore, when the host generates a write operation on the mirror file, the difference data of the mirror file relative to the physical storage device can be determined, and then the difference data can be overwritten on the physical storage device.

[0090] As an optional embodiment, determining the difference data of the image file relative to the physical storage device includes:

[0091] When the host generates a write operation to the image file, it is determined whether the current checksum of the image file is consistent with the standard checksum, wherein the standard checksum refers to: the checksum of the image file most recently updated;

[0092] If they are inconsistent, the difference data of the image file relative to the physical storage device is determined.

[0093] Specifically, considering that the host's write operation on the mirror file does not necessarily cause the mirror file to be updated (for example, writing old data as the same new data), in an embodiment of the present invention, when the host generates a write operation on the mirror file, it can determine whether the current check value of the mirror file is consistent with the standard check value. If they are inconsistent, the difference data of the mirror file relative to the physical storage device can be determined. If they are consistent, the action of "determining the difference data of the mirror file relative to the physical storage device" can be omitted, thereby reducing unnecessary synchronization actions and saving computing resources.

[0094] As an optional embodiment, determining the difference data of the image file relative to the physical storage device includes:

[0095] For any sub-file in the image file, determine whether the target file exists in the physical storage device;

[0096] Among them, the target file refers to the file with the same name as the subfile;

[0097] If the target file exists in the physical storage device, determine whether the checksum of the target file is the same as the checksum of the sub-file;

[0098] If the checksum of the target file is different from the checksum of the sub-file, the sub-file is used as a difference file;

[0099] If the checksum of the target file is the same as the checksum of the sub-file, then end;

[0100] If the target file does not exist in the physical storage device, the subfile is used as a difference file;

[0101] Control the display to display the information of each difference file;

[0102] In response to a selection instruction received through the human-machine interface, the selected difference file is used as the difference data.

[0103] Specifically, considering that when the data to be synchronized in the physical storage device is synchronized to the mirror file for the first time, any sub-file in the mirror file has a corresponding file with the same name in the storage device, and the host's write operation on the mirror file may change the content of a sub-file without changing its name, or may directly change the name of a sub-file, therefore, in the embodiment of the present invention, for any sub-file in the mirror file, it can be determined whether there is a target file (a file with the same name as the sub-file) in the physical storage device, and if so, it is determined whether the check value of the target file is the same as the check value of the sub-file, and if the check values ​​are different, the sub-file can be used as a difference file, and if the target file does not exist in the physical storage device, the sub-file can be directly used as a difference file, so that the difference file of the mirror file relative to the physical storage device can be efficiently and accurately found.

[0104] Among them, the comparison of the check values ​​can determine whether the "two compared" are the same. The check value can be of multiple types, for example, it can be a check value of a cyclic redundancy check, etc., and the embodiment of the present invention is not limited here.

[0105] Specifically, considering that the user may have an "asynchronous" requirement for the difference file, that is, not synchronizing the difference file from the mirror file to the physical storage device, the embodiment of the present invention can control the display to display the information of each difference file, and can respond to the selection instruction received through the human-computer interface and use the selected difference file as the difference data, thereby satisfying the user's selection requirement for the difference file.

[0106] The information for distinguishing files may be information of a preset type, and the preset type may be set independently, for example, may include file type, file size, and update time, etc., which is not limited in the embodiment of the present invention.

[0107] Specifically, there may be many specific ways to control the display to perform display, for example, display may be performed through a WEB (World Wide Web) page, etc., which is not limited in the embodiment of the present invention.

[0108] As an optional embodiment, controlling the display to display information of each difference file includes:

[0109] For any difference file, if there is a file with the same name as the difference file in the physical storage device, the preset type information of the difference file and the preset type information of the file with the same name as the difference file in the physical storage device are used as the information to be displayed of the difference file;

[0110] For any difference file, if there is no file with the same name as the difference file in the physical storage device, the information of the preset type of the difference file is used as the information to be displayed for the difference file;

[0111] The display is controlled to display the information to be displayed of each difference file.

[0112] Specifically, considering that when the file name of the difference file has not been changed, the user can more conveniently determine whether synchronization is required by comparing the "relevant information of the file with the same name as the difference file" in the physical storage device. Therefore, in the embodiment of the present invention, for any difference file, if there is a file with the same name as the difference file in the physical storage device, the preset type information of the difference file and the preset type information of the file with the same name as the difference file in the physical storage device are used as the to-be-displayed information of the difference file. For any difference file, if there is no file with the same name as the difference file in the physical storage device, the preset type information of the difference file is used as the to-be-displayed information of the difference file, and then the display is controlled to display the to-be-displayed information of each difference file. In other words, the user can obtain the preset type information of two files with the same name "with different check values" in the physical storage device and the mirror file through the display, so as to conveniently carry out comparison of updated files with the same name, which is conducive to improving user experience.

[0113] As an optional embodiment, after using the image file as the content of the virtual storage device and constructing a virtual storage device for the host of the server through the virtual universal serial bus storage function, the storage device management method further includes:

[0114] When the first trigger condition or the second trigger condition is met, deleting the virtual storage device of the host of the server and stopping updating the image file corresponding to the virtual storage device;

[0115] The first trigger condition refers to: the physical storage device connected to the universal serial bus port corresponding to the image file of the virtual storage device is disconnected, and the second trigger condition refers to: receiving a closing instruction of the port sharing function through the human-machine interface.

[0116] Specifically, considering that as an additional function, the user may have the need to stop providing the virtual storage device to the host, the embodiment of the present invention can delete the virtual storage device of the server host and stop updating the image file corresponding to the virtual storage device when the first trigger condition or the second trigger condition is met, wherein the first trigger condition refers to: the physical storage device connected to the universal serial bus port corresponding to the image file of the virtual storage device is disconnected, and the second trigger condition refers to: receiving a port sharing function shutdown instruction through the human-machine interface, that is, the user can stop providing the virtual storage device corresponding to the physical storage device to the host by actively disconnecting the physical storage device, and the user can also turn off the port sharing function. In this case, no matter which USB port of the BMC is connected to the physical storage device, the BMC will not provide the corresponding virtual storage device to the host.

[0117] To better illustrate the embodiments of the present invention, please refer to Figure 4 , Figure 4 A flowchart of another storage device management method provided by the present invention is shown below.

[0118] As an optional embodiment, when the host generates a write operation to the mirror file, after determining the difference data of the mirror file relative to the physical storage device, before overwriting the difference data in the physical storage device, the storage device management method further includes:

[0119] The distinguishing data is encrypted using a preset encryption algorithm.

[0120] To better illustrate the embodiments of the present invention, please refer to Figure 5 , Figure 5 A flow chart of another storage device management method provided by the present invention is provided. After the host writes the image file, the BMC can sense the host's write transaction, and then calculate the current check value of the image file. When the current check value is the same as the standard check value, no task processing can be performed. When the current check value is different from the standard check value, the image file can be remounted to the mount point, and then a prompt is given that the data in the USB flash drive needs to be updated. Then, the file list in the mount point is read and displayed to the user. The distinguished files therein can be marked and information on the preset types of the distinguished files can be displayed. Then, the files to be synchronized can be determined through the human-machine interface (that is, the files to be synchronized selected by the user through the human-machine interface are received), and then after the files to be synchronized are encrypted, the files to be synchronized can be overwritten to the USB flash drive.

[0121] Specifically, considering that the data output by the host usually has a higher security level, that is, the data output by the host cannot be viewed by any user at will, the embodiment of the present invention can encrypt the difference data through a preset encryption algorithm, and then the encrypted difference file can be overwritten on the physical storage device, and the authorized user's demand for data use can be realized by "providing the decryption key to the authorized user", which can improve the security of the host data.

[0122] Among them, the preset encryption algorithm can be of various types, for example, it can be the national encryption SM1, SM2, SM3 or SM4 algorithm, etc., and the embodiment of the present invention is not limited here.

[0123] Please refer to Figure 6 , Figure 6 A schematic diagram of the structure of a storage device management device provided by the present invention, the storage device management device comprising:

[0124] A first determination module 61 is used to determine an image file corresponding to the physical storage device when its own universal serial bus port is connected to the physical storage device;

[0125] A first synchronization module 62, used to synchronize data in the physical storage device to the mirror file;

[0126] A first construction module 63 is used to use the image file as the content of the virtual storage device and construct a virtual storage device for the host of the server through the virtual universal serial bus storage function so that the host can read and write the image file;

[0127] The second synchronization module 64 is used to synchronize the updated content of the party generating the content update to the other party with respect to the physical storage device and the mirror file.

[0128] As an optional embodiment, the second synchronization module 64 includes:

[0129] A first synchronization submodule, used for synchronizing the updated content in the mirror file to the physical storage device when the mirror file is updated;

[0130] A second synchronization submodule is used to synchronize the updated content in the physical storage device to the mirror file when data is updated in the physical storage device;

[0131] The first synchronization submodule includes:

[0132] A second determination module is used to determine the difference data of the image file relative to the physical storage device when the host generates a write operation to the image file;

[0133] The first action module is used to overwrite the distinguishing data on the physical storage device.

[0134] As an optional embodiment, the second determining module includes:

[0135] A first determination module is used to determine whether the current check value of the image file is consistent with the standard check value when the host generates a write operation on the image file, wherein the standard check value refers to: the check value of the image file last updated, if they are inconsistent, triggering the first determination submodule;

[0136] The first determination submodule is used to determine the difference data of the image file relative to the physical storage device.

[0137] As an optional embodiment, the first determining submodule includes:

[0138] A second judgment module is used to judge whether a target file exists in the physical storage device for any sub-file in the image file, wherein the target file refers to a file with the same name as the sub-file. If the target file exists in the physical storage device, the third judgment module is triggered. If the check value of the target file is the same as the check value of the sub-file, the end module is triggered;

[0139] End module, used for ending;

[0140] A third judgment module is used to judge whether the check value of the target file is the same as the check value of the sub-file. If the check value of the target file is different from the check value of the sub-file, the second action module is triggered; if the target file does not exist in the physical storage device, the third action module is triggered;

[0141] The second action module is used to use the sub-file as a distinguished file;

[0142] A third action module is used to use the sub-file as a distinguished file;

[0143] A fourth action module is used to control the display to display information of each difference file;

[0144] The fifth action module is used to respond to the selection instruction received through the human-machine interface and use the selected difference file as the difference data.

[0145] As an optional embodiment, the fourth action module includes:

[0146] The first action submodule is used for, for any difference file, if there is a file with the same name as the difference file in the physical storage device, using the information of the preset type of the difference file and the information of the preset type of the file with the same name as the difference file in the physical storage device as the information to be displayed of the difference file;

[0147] The second action submodule is used for, for any difference file, if there is no file with the same name as the difference file in the physical storage device, using the preset type information of the difference file as the information to be displayed for the difference file;

[0148] The third action submodule is used to control the display to display the information to be displayed of each different file.

[0149] As an optional embodiment, the storage device management apparatus further includes:

[0150] A disconnection module, used to delete the virtual storage device of the server host and stop updating the image file corresponding to the virtual storage device when the first trigger condition or the second trigger condition is met;

[0151] The first trigger condition refers to: the physical storage device connected to the universal serial bus port corresponding to the image file of the virtual storage device is disconnected, and the second trigger condition refers to: receiving a closing instruction of the port sharing function through the human-machine interface.

[0152] As an optional embodiment, the storage device management apparatus further includes:

[0153] The encryption module is used to encrypt the distinguishing data using a preset encryption algorithm.

[0154] For an introduction to the storage device management apparatus provided in an embodiment of the present invention, please refer to the aforementioned embodiment of the storage device management method, and the embodiment of the present invention will not be described in detail here.

[0155] Please refer to Figure 7 , Figure 7 A schematic diagram of the structure of a storage device management device provided by the present invention, the storage device management device comprises:

[0156] A memory 71, used for storing computer programs;

[0157] The processor 72 is used to implement the steps of the storage device management method in the above-mentioned embodiment when executing the computer program.

[0158] For an introduction to the storage device management device provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the storage device management method, and the embodiment of the present invention will not be described in detail here.

[0159] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer-readable storage medium provided by the present invention. A computer program 82 is stored on the computer-readable storage medium 81. When the computer program 82 is executed by a processor, the steps of the storage device management method in the aforementioned embodiment are implemented.

[0160] For an introduction to the computer-readable storage medium provided in the embodiment of the present invention, please refer to the aforementioned embodiment of the storage device management method, and the embodiment of the present invention will not be described in detail here.

[0161] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the storage device management method in the above-mentioned embodiment when the computer program / instruction is executed by a processor.

[0162] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the storage device management method, and the embodiment of the present invention will not be described in detail here.

[0163] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0164] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0165] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A storage device management method, characterized in that: Applicable to baseboard management controllers, including: When its universal serial bus port is connected to the physical storage device, a mirror file corresponding to the physical storage device is determined; Synchronize the data in the physical storage device to the mirror file; The image file is used as the content of the virtual storage device, and a virtual storage device is constructed for the host of the server through a virtual universal serial bus storage function, so that the host can read and write the image file; For the physical storage device and the mirror file, the updated content of the party generating the content update is synchronized to the other party.

2. The storage device management method according to claim 1, characterized in that: For the physical storage device and the mirror file, synchronizing the updated content of the party generating the content update to the other party includes: When data in the mirror file is updated, synchronizing the updated content in the mirror file to the physical storage device; When data in the physical storage device is updated, synchronizing the updated content in the physical storage device to the mirror file; When data in the mirror file is updated, synchronizing the updated content in the mirror file to the physical storage device includes: When the host generates a write operation to the mirror file, determining the difference data of the mirror file relative to the physical storage device; Overwrite the distinguishing data on the physical storage device.

3. The storage device management method according to claim 2, characterized in that: When the host generates a write operation to the image file, determining the difference data of the image file relative to the physical storage device includes: When the host generates a write operation to the image file, determining whether a current checksum of the image file is consistent with a standard checksum, wherein the standard checksum refers to: a checksum of the image file that was most recently updated; If they are inconsistent, the difference data of the image file relative to the physical storage device is determined.

4. The storage device management method according to claim 3, characterized in that: Determining the difference data between the image file and the physical storage device includes: For any sub-file in the image file, determining whether a target file exists in the physical storage device; Wherein, the target file refers to a file with the same name as the sub-file; If the target file exists in the physical storage device, determining whether the check value of the target file is the same as the check value of the sub-file; If the checksum of the target file is different from the checksum of the sub-file, the sub-file is used as a difference file; If the checksum of the target file is the same as the checksum of the sub-file, then the process ends; If the target file does not exist in the physical storage device, the sub-file is used as a difference file; Controlling the display to display information of each of the difference files; In response to a selection instruction received through the human-machine interface, the selected difference file is used as the difference data.

5. The storage device management method according to claim 4, characterized in that: Controlling the display to display the information of each of the difference files includes: For any of the difference files, if there is a file with the same name as the difference file in the physical storage device, the preset type information of the difference file and the preset type information of the file with the same name as the difference file in the physical storage device are used as the information to be displayed of the difference file; For any of the difference files, if there is no file with the same name as the difference file in the physical storage device, using information of the preset type of the difference file as the information to be displayed for the difference file; The display is controlled to display the information to be displayed of each of the difference files.

6. The storage device management method according to claim 1, characterized in that: After using the image file as the content of the virtual storage device and constructing a virtual storage device for the host of the server through the virtual universal serial bus storage function, the storage device management method further includes: When the first trigger condition or the second trigger condition is met, deleting the virtual storage device of the host of the server and stopping updating the image file corresponding to the virtual storage device; The first trigger condition refers to: the physical storage device connected to the universal serial bus port corresponding to the image file of the virtual storage device is disconnected, and the second trigger condition refers to: receiving a closing instruction of the port sharing function through the human-machine interface.

7. The storage device management method according to any one of claims 2 to 6, characterized in that: When the host generates a write operation to the image file, after determining the difference data of the image file relative to the physical storage device, the difference data is overwritten before the physical storage device, and the storage device management method further includes: The distinguishing data is encrypted using a preset encryption algorithm.

8. A storage device management device, characterized in that: include: A first determination module, configured to determine a mirror file corresponding to the physical storage device when its universal serial bus port is connected to the physical storage device; A first synchronization module, used for synchronizing the data in the physical storage device to the mirror file; A first construction module is used to use the image file as the content of the virtual storage device and construct a virtual storage device for the host of the server through a virtual universal serial bus storage function so that the host can read and write the image file; The second synchronization module is used to synchronize the updated content of the party generating the content update to the other party, with respect to the physical storage device and the mirror file.

9. A storage device management device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the storage device management method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the storage device management method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Data synchronization method and device, electronic equipment, storage medium and program product

    CN120744010A

  • Data synchronization methods, devices, electronic equipment, storage media, and software products

    CN120744010B