Hard disk upgrading method and device, electronic equipment and storage medium
By verifying the hard disk identity and manufacturer information, we ensure that the correct hard disk is selected for upgrade, which solves the problem of upgrading failure caused by the inability to find the system disk and unauthorized hard disk files during online upgrade of the storage system, and achieves the secure and accurate upgrade of the hard disk storage device.
Patent Information
- Application Number
- CN202410963474.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-12
AI Technical Summary
During the online upgrade of the storage system, the corresponding system disk cannot be found or the upgrade failed due to unauthorized hard disk files.
By obtaining the configuration file of the hard disk to be upgraded, verifying its hard disk identification and manufacturer information, ensuring that only the correct hard disk is selected for upgrade, preventing unauthorized hard disks from being connected to the system, thereby protecting the system from malware or hardware.
Effectively manage and upgrade hard disk storage devices, ensure operation security and accuracy, avoid hardware damage or data loss caused by misoperation, and ensure that only authorized hard disks can be upgraded.
Smart Images

Figure CN118939291A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a hard disk upgrade method, device, electronic equipment and storage medium. Background Art
[0002] The online upgrade function is an important part of storage development and testing, and is also an important indicator for measuring a storage product. The accuracy and reliability of online upgrades are necessary support for the normal operation of the software. When upgrading the storage system in related technologies, the system disk corresponding to the storage device cannot be found, and the subsequent online upgrade process cannot be performed, resulting in upgrade failure. In addition, upgrades based on unauthorized hard disk files may cause system errors. Summary of the invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a hard disk upgrade method, device, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.
[0004] In order to solve the above problems, the present invention discloses a hard disk upgrade method, which comprises:
[0005] Obtaining a configuration file of the hard disk to be upgraded; the configuration file includes a hard disk identification and first manufacturer information of the hard disk to be upgraded;
[0006] According to the configuration file of the hard disk to be upgraded, determining whether the hard disk to be upgraded is stored in a hard disk storage device;
[0007] If the hard disk to be upgraded is stored in the hard disk storage device, obtaining second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded and recorded by the hard disk storage device;
[0008] Determining whether the first manufacturer information matches the second manufacturer information;
[0009] If the first manufacturer information matches the second manufacturer information, the hard disk in the hard disk storage device is upgraded according to the configuration file.
[0010] Optionally, the acquiring the second manufacturer information recorded by the hard disk storage device and corresponding to the hard disk identifier of the hard disk to be upgraded includes:
[0011] Obtain a first mapping table; the first mapping table includes mapping relationships between multiple hard disk identifiers and manufacturer information;
[0012] The second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded is queried from the first mapping table.
[0013] Optionally, the method further comprises:
[0014] If the hard disk to be upgraded is not stored in the hard disk storage device, obtaining the hard disk identifier recorded in the expansion cabinet;
[0015] Determine whether the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifier recorded in the expansion cabinet;
[0016] If the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifiers recorded in the expansion cabinet, the hard disk corresponding to the hard disk identifier to be upgraded in the expansion cabinet is upgraded.
[0017] Optionally, the method further comprises:
[0018] When it is detected that a target hard disk is inserted into the hard disk storage device, obtaining a hard disk identification of the target hard disk;
[0019] Acquire a second mapping table, wherein the second mapping table includes mapping relationships between multiple hard disk identifiers and drivers;
[0020] According to the hard disk identifier of the target hard disk, determining whether a driver corresponding to the hard disk identifier of the target hard disk exists in the second mapping table;
[0021] If a driver corresponding to the hard disk identifier of the target hard disk exists in the second mapping table, the driver is loaded, and the manufacturer information of the target hard disk is obtained, and the mapping relationship between the hard disk identifier of the target hard disk and the manufacturer information is stored in the first mapping table;
[0022] If the driver corresponding to the hard disk identifier of the target hard disk does not exist in the second mapping table, obtain the protocol address of the target hard disk, obtain the driver program of the target hard disk according to the protocol address of the target hard disk, load the driver program, and obtain the manufacturer information of the target hard disk, and store the mapping relationship between the hard disk identifier of the target hard disk and the manufacturer information in the first mapping table; store the mapping relationship between the driver program of the target hard disk and the hard disk identifier of the target hard disk in the second mapping table.
[0023] Optionally, the method further comprises:
[0024] When the hard disk storage device is loaded through the pre-start execution environment server, the hard disk connected to the hard disk storage device is scanned to obtain the hard disk loaded in the hard disk storage device and the corresponding manufacturer information;
[0025] Naming the hard disks installed in the hard disk storage device according to a preset naming rule to obtain hard disk identification information of the multiple installed hard disks;
[0026] The hard disk identification information and manufacturer information of the multiple installed hard disks are stored in the first mapping table in a one-to-one correspondence.
[0027] Optionally, before upgrading the hard disk in the hard disk storage device according to the configuration file, the method further includes:
[0028] Verifying the version number of the upgrade file of the hard disk to be upgraded;
[0029] The step of upgrading the hard disk to be upgraded according to the configuration file includes:
[0030] If the version number of the upgrade file of the hard disk to be upgraded is verified, the hard disk in the hard disk storage device is upgraded according to the configuration file.
[0031] Optionally, the configuration file further includes a version number of an upgrade file of the hard disk to be upgraded, and the verifying the version number of the upgrade file of the hard disk to be upgraded includes:
[0032] Obtain the current version number of the hard disk to be upgraded, and determine whether the version number of the upgrade file is greater than the current version number;
[0033] If the version number of the upgrade file is greater than the current version number, it is determined that the version number verification of the upgrade file of the hard disk to be upgraded has passed.
[0034] The present invention also discloses a hard disk upgrade device, which comprises:
[0035] A first acquisition module, used to acquire a configuration file of the hard disk to be upgraded; the configuration file includes a hard disk identification and first manufacturer information of the hard disk to be upgraded;
[0036] A first judgment module, used for judging whether the hard disk to be upgraded is stored in a hard disk storage device according to the configuration file of the hard disk to be upgraded;
[0037] a second acquisition module, which acquires second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded and recorded by the hard disk storage device if the hard disk to be upgraded is stored in the hard disk storage device;
[0038] A second judgment module, used to judge whether the first manufacturer information matches the second manufacturer information;
[0039] The first upgrade module is used to upgrade the hard disk in the hard disk storage device according to the configuration file if the first manufacturer information matches the second manufacturer information.
[0040] Optionally, the second acquisition module includes:
[0041] An acquisition unit, configured to acquire a first mapping table; the first mapping table includes mapping relationships between multiple hard disk identifiers and manufacturer information;
[0042] The query unit is used to query the second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded from the first mapping table.
[0043] Optionally, the device further comprises:
[0044] A third acquisition module, configured to acquire a hard disk identifier recorded in an expansion cabinet if the hard disk to be upgraded is not stored in the hard disk storage device;
[0045] A third judgment module is used to judge whether the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifier recorded in the expansion cabinet;
[0046] The second upgrading module is used for upgrading the hard disk corresponding to the hard disk identifier to be upgraded in the expansion cabinet if the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifier recorded in the expansion cabinet.
[0047] Optionally, the device further comprises:
[0048] A fourth acquisition module, configured to acquire a hard disk identifier of the target hard disk when detecting that the target hard disk is inserted into the hard disk storage device;
[0049] A mapping table acquisition module, used to acquire a second mapping table, wherein the second mapping table includes a mapping relationship between multiple hard disk identifiers and drivers;
[0050] A fourth judgment module, configured to judge whether there is a driver corresponding to the hard disk identifier of the target hard disk in the second mapping table according to the hard disk identifier of the target hard disk;
[0051] a first loading module, configured to load the driver corresponding to the hard disk identifier of the target hard disk if the second mapping table contains the driver corresponding to the hard disk identifier of the target hard disk, obtain the manufacturer information of the target hard disk, and store the mapping relationship between the hard disk identifier of the target hard disk and the manufacturer information in the first mapping table;
[0052] The second loading module is used to obtain the protocol address of the target hard disk, obtain the driver program of the target hard disk according to the protocol address of the target hard disk, load the driver program, and obtain the manufacturer information of the target hard disk, if the driver program corresponding to the hard disk identifier of the target hard disk does not exist in the second mapping table, and store the mapping relationship between the hard disk identifier of the target hard disk and the manufacturer information in the first mapping table; and store the mapping relationship between the driver program of the target hard disk and the hard disk identifier of the target hard disk in the second mapping table.
[0053] Optionally, the device further comprises:
[0054] A scanning module, used for scanning the hard disk connected to the hard disk storage device when the hard disk storage device is loaded through the pre-start execution environment server, to obtain the hard disk loaded in the hard disk storage device and the corresponding manufacturer information;
[0055] A naming module, used to name the hard disks installed in the hard disk storage device according to a preset naming rule, and obtain hard disk identification information of multiple installed hard disks;
[0056] The storage module is used to store the hard disk identification information and manufacturer information of the multiple installed hard disks in the first mapping table according to a one-to-one correspondence.
[0057] Optionally, the first upgrade module is further used to verify the version number of the upgrade file of the hard disk to be upgraded;
[0058] The first upgrade module includes:
[0059] The verification submodule is used to upgrade the hard disk in the hard disk storage device according to the configuration file if the version number of the upgrade file of the hard disk to be upgraded is verified to be passed.
[0060] Optionally, the configuration file further includes a version number of an upgrade file of the hard disk to be upgraded, and the first upgrade module includes:
[0061] A version number acquisition submodule is used to acquire the current version number of the hard disk to be upgraded, and determine whether the version number of the upgrade file is greater than the current version number;
[0062] The comparison submodule is used to determine that the version number verification of the upgrade file of the hard disk to be upgraded has passed if the version number of the upgrade file is greater than the current version number.
[0063] The present invention also discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the hard disk upgrade method as described above when executed by the processor.
[0064] The present invention also discloses a non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the hard disk upgrade method described above are implemented.
[0065] The embodiments of the present invention include the following advantages:
[0066] The present invention discloses a hard disk upgrade method. The present invention ensures that only a correct hard disk is selected for upgrade by verifying the hard disk identification and manufacturer information, thereby avoiding hardware damage or data loss caused by misoperation. By matching the manufacturer information, unauthorized or counterfeit hard disks can be prevented from accessing the system for upgrade, thereby protecting the system from malware or hardware infringement, ensuring that only authorized hard disks can be upgraded, and effectively managing and upgrading hard disk storage devices while ensuring the safety and accuracy of operations. The obtained configuration file is checked to avoid the problem of upgrade failure due to not being able to find the corresponding hard disk. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 is a flowchart of the steps of a hard disk upgrade method provided by an embodiment of the present invention;
[0068] Figure 2 It is a flowchart of a hard disk upgrade method provided by an embodiment of the present invention;
[0069] Figure 3 It is a structural block diagram of a hard disk upgrade device provided by an embodiment of the present invention;
[0070] Figure 4 is a structural block diagram of an electronic device provided by an embodiment of the present invention;
[0071] Figure 5 It is a structural block diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0072] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0073] One of the core concepts of the embodiment of the present invention is that the present invention ensures that only the correct hard disk is selected for upgrading by verifying the hard disk identification and manufacturer information, thereby avoiding hardware damage or data loss caused by misoperation. By matching the manufacturer information, unauthorized or counterfeit hard disks can be prevented from accessing the system for upgrading, thereby protecting the system from malware or hardware infringement, ensuring that only authorized hard disks can be upgraded, and being able to effectively manage and upgrade hard disk storage devices while ensuring the security and accuracy of operations; checking the obtained configuration files to avoid the problem of upgrade failure due to not being able to find the corresponding hard disk.
[0074] Reference Figure 1 , shows a flowchart of the steps of a hard disk upgrade method provided by an embodiment of the present invention, the method comprising:
[0075] Step 101, obtaining a configuration file of the hard disk to be upgraded; the configuration file includes a hard disk identification and first manufacturer information of the hard disk to be upgraded.
[0076] In the embodiment of the present invention, the configuration file of the hard disk to be upgraded can be obtained first, and then the hard disk identification and first manufacturer information of the hard disk to be upgraded can be obtained by parsing the configuration file, where the first manufacturer information is used to indicate the factory manufacturer information of the hard disk to be upgraded.
[0077] Step 102: judging whether the hard disk to be upgraded is stored in a hard disk storage device according to the configuration file of the hard disk to be upgraded.
[0078] In an embodiment of the present invention, the hard disk storage device has pre-recorded which storage hard disks are loaded, and it can be determined whether the hard disk identifier of the hard disk to be upgraded is included in the multiple hard disk identifiers corresponding to the loaded storage hard disks recorded by the hard disk storage device. If the hard disk identifier of the hard disk to be upgraded is included in the multiple hard disk identifiers, it means that the hard disk to be upgraded is stored in the hard disk storage device. If the hard disk identifier of the hard disk to be upgraded is not included in the multiple hard disk identifiers, it means that the hard disk to be upgraded is not stored in the hard disk storage device.
[0079] Step 103: If the hard disk to be upgraded is stored in a hard disk storage device, obtain second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded and recorded in the hard disk storage device.
[0080] In an embodiment of the present invention, the hard disk storage device pre-records the hard disk identification of the hard disk to be upgraded and the corresponding second manufacturer information. After obtaining the hard disk identification of the hard disk to be upgraded, the second manufacturer information can be queried, and then it is determined whether the first manufacturer information is consistent with the second manufacturer information.
[0081] In one embodiment of the present invention, obtaining the second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded recorded by the hard disk storage device includes: obtaining a first mapping table; the first mapping table includes a mapping relationship between multiple hard disk identifiers and manufacturer information; and querying the second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded from the first mapping table.
[0082] Step 104: determine whether the first manufacturer information matches the second manufacturer information.
[0083] Step 105: If the first manufacturer information matches the second manufacturer information, the hard disk in the hard disk storage device is upgraded according to the configuration file.
[0084] In an embodiment of the present invention, if it is determined that the first manufacturer information does not match the second manufacturer information, this indicates that the manufacturer information of the hard disk to be upgraded is inconsistent with the manufacturer information in the hard disk storage device, that is, the manufacturer information is unauthorized manufacturer information. When the second manufacturer information matches the first manufacturer information, the hard disk in the hard disk storage device can be upgraded according to the configuration file.
[0085] The present invention discloses a hard disk upgrade method. The present invention ensures that only a correct hard disk is selected for upgrade by verifying the hard disk identification and manufacturer information, thereby avoiding hardware damage or data loss caused by misoperation. By matching the manufacturer information, unauthorized or counterfeit hard disks can be prevented from accessing the system for upgrade, thereby protecting the system from malware or hardware infringement, ensuring that only authorized hard disks can be upgraded, and effectively managing and upgrading hard disk storage devices while ensuring the safety and accuracy of operations. The obtained configuration file is checked to avoid the problem of upgrade failure due to not being able to find the corresponding hard disk.
[0086] In one embodiment of the present invention, the method also includes: if the hard disk to be upgraded is not stored in the hard disk storage device, obtaining the hard disk identifier recorded in the expansion cabinet; determining whether the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifier recorded in the expansion cabinet; if the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifier recorded in the expansion cabinet, upgrading the hard disk corresponding to the hard disk identifier to be upgraded in the expansion cabinet.
[0087] In an embodiment of the present invention, multiple hard disk identifiers can be recorded in the expansion cabinet, indicating the hard disks already loaded in the expansion cabinet; if the hard disk to be upgraded is not stored in the hard disk storage device, it can be determined whether the hard disk identifier to be upgraded exists in the hard disk identifier recorded in the expansion cabinet. If it exists, it means that the hard disk corresponding to the hard disk identifier to be upgraded in the expansion cabinet can be upgraded according to the configuration file. If it does not exist, it is not allowed to upgrade the hard disk corresponding to the hard disk identifier to be upgraded in the expansion cabinet according to the configuration file. The present invention reduces rework and extra costs caused by erroneous upgrades and improves work efficiency through accurate hard disk identifier matching. When the acquired configuration file is not a file corresponding to the hard disk in the hard disk storage device, it can be determined whether the hard disk in the expansion cabinet is upgraded. It can adapt to different hard disk storage configurations, and both the hard disk storage device and the hard disk in the expansion cabinet can be effectively upgraded.
[0088] like Figure 2, showing a flow chart of a hard disk upgrade method provided by an embodiment of the present invention, the hard disk storage device can first obtain a configuration file, read the hard disk identifier of the hard disk to be upgraded from the configuration file, and then determine whether the hard disk to be upgraded exists in the hard disk storage device according to the hard disk identifier. If it exists, it can continue to determine whether the manufacturer information matches. If it matches, the hard disk corresponding to the hard disk identifier in the hard disk storage device can be upgraded according to the upgrade file in the configuration file; if the manufacturer information does not match, the upgrade is not allowed.
[0089] If the hard disk to be upgraded does not exist in the hard disk storage device, you can continue to determine whether it exists in the expansion cabinet. If it exists in the expansion cabinet, you can upgrade the hard disk corresponding to the hard disk identifier in the expansion cabinet according to the configuration file. If it does not exist in the expansion cabinet, the upgrade is not allowed.
[0090] In one embodiment of the present invention, the hard disks in the expansion cabinet and the hard disks in the hard disk storage device can be named according to different rules. When the identifier of the hard disk to be upgraded is obtained, it can be directly determined to which type the identifier of the hard disk to be upgraded belongs. For example, the hard disks in the hard disk storage device can be named as nvme0, nvme1..., and the hard disks in the expansion cabinet can be named as nvme-a, nvme-b..., thereby avoiding upgrade errors caused by the hard disks in the expansion cabinet and the hard disk storage device being named as the same type. Through different naming rules, the system can quickly and accurately identify the location of the hard disk, avoid errors caused by naming confusion, and facilitate troubleshooting and system optimization.
[0091] In one embodiment of the present invention, the method further includes:
[0092] When it is detected that a target hard disk is inserted into a hard disk storage device, the hard disk identification of the target hard disk is obtained; a second mapping table is obtained, the second mapping table including a mapping relationship between multiple hard disk identifications and drivers; based on the hard disk identification of the target hard disk, it is determined whether there is a driver corresponding to the hard disk identification of the target hard disk in the second mapping table; if there is a driver corresponding to the hard disk identification of the target hard disk in the second mapping table, the driver is loaded, and the manufacturer information of the target hard disk is obtained, and the mapping relationship between the hard disk identification of the target hard disk and the manufacturer information is stored in the first mapping table; if there is no driver corresponding to the hard disk identification of the target hard disk in the second mapping table, the protocol address of the target hard disk is obtained, the driver of the target hard disk is obtained based on the protocol address of the target hard disk, the driver is loaded, and the manufacturer information of the target hard disk is obtained, and the mapping relationship between the hard disk identification of the target hard disk and the manufacturer information is stored in the first mapping table; the mapping relationship between the driver of the target hard disk and the hard disk identification of the target hard disk is stored in the second mapping table.
[0093] In an embodiment of the present invention, when it is detected that a new target hard disk is inserted into a hard disk storage device, the hard disk identification of the target hard disk can be obtained first, and then the second mapping table can be queried to see whether the corresponding driver is included. If the second mapping table is queried to see whether the corresponding driver is included, the driver is directly loaded, and the manufacturer information of the target hard disk is obtained, and the mapping relationship between the hard disk identification of the target hard disk and the manufacturer information is stored in the first mapping table to update the information in the first mapping table; if the driver corresponding to the hard disk identification of the target hard disk does not exist in the second mapping table, the protocol address of the target hard disk can be used, and the protocol address refers to the official address of the target hard disk. The driver of the target hard disk can be obtained according to the protocol address of the target hard disk, and then the driver is loaded to read the data in the target hard disk, and the manufacturer information of the target hard disk is obtained at the same time, and the mapping relationship between the hard disk identification of the target hard disk and the manufacturer information is stored in the first mapping table, and the mapping relationship between the driver of the target hard disk and the hard disk identification of the target hard disk is stored in the second mapping table, so that the corresponding driver can be directly obtained from the second mapping table the next time it is loaded.
[0094] The present invention searches for the driver program through a mapping table, thereby ensuring that the loaded driver program matches the hard disk model and avoiding problems caused by driver incompatibility; when the driver program of the target hard disk does not exist in the mapping table, the system can obtain and load the driver program according to the protocol address and update the mapping table at the same time, thereby enhancing the flexibility and adaptability of the system.
[0095] In one embodiment of the present invention, the method also includes: when the hard disk storage device is loaded through the pre-start execution environment server, the hard disk connected to the hard disk storage device is scanned to obtain the hard disks loaded in the hard disk storage device and the corresponding manufacturer information; the hard disks loaded in the hard disk storage device are named according to a preset naming rule to obtain the hard disk identification information of multiple loaded hard disks; the hard disk identification information and manufacturer information of the multiple loaded hard disks are stored in a first mapping table in a one-to-one correspondence.
[0096] In the embodiment of the present invention, the hard disk storage device is also connected to the pre-boot execution environment server. When the hard disk storage device is filled by the pre-boot execution environment server, the KylinV10 deployed on the pre-boot execution environment server is pre-loaded. kernel kernel to initialize the environment, initialize the peripheral component interconnect subsystem, and then start to enumerate all devices connected to the peripheral component interconnect bus. The hard disk connected to the hard disk storage device can be scanned, so that the hard disk loaded in the hard disk storage device and the corresponding manufacturer information can be obtained. In an example, the hard disks loaded in the identified hard disk storage device include a first system disk, a second system disk, a third system disk, and a fourth system disk, wherein the first system disk, the second system disk, the third system disk, and the fourth system disk respectively store different operating systems. The first system disk, the second system disk, the third system disk, and the fourth system disk can be named nvme1, nvme2, nvme3, and nvme4 according to a preset naming rule, so as to distinguish them from the naming of the hard disks in the expansion cabinet; the manufacturer information A corresponding to nvme1, the manufacturer information B corresponding to nvme2, the manufacturer information C corresponding to nvme3, and the manufacturer information D corresponding to nvme4, and then the manufacturer information A corresponding to nvme1, the manufacturer information B corresponding to nvme2, the manufacturer information C corresponding to nvme3, and the manufacturer information D corresponding to nvme4 are stored in the first mapping table according to the corresponding relationship. The present invention reduces manual intervention and improves the efficiency of hard disk management by automatically scanning and naming hard disks; hard disks are named according to preset naming rules to ensure the consistency and standardization of hard disk identification, which is convenient for subsequent management and maintenance; when hard disk-related problems occur, specific hard disk and manufacturer information can be quickly located through the first mapping table, which is convenient for troubleshooting and repair.
[0097] In one embodiment of the present invention, before upgrading the hard disk in the hard disk storage device according to the configuration file, it also includes: verifying the version number of the upgrade file of the hard disk to be upgraded; upgrading the hard disk to be upgraded according to the configuration file, including: if the version number of the upgrade file of the hard disk to be upgraded passes the verification, then upgrading the hard disk in the hard disk storage device according to the configuration file.
[0098] In an embodiment of the present invention, before upgrading the hard disk in the hard disk storage device according to the configuration file, the version number of the upgrade file of the hard disk to be upgraded can be verified to determine whether the upgrade file of the hard disk to be upgraded is the latest upgrade file, thereby avoiding invalid upgrade; if the version number of the upgrade file of the hard disk to be upgraded is verified, it means that the upgrade file of the hard disk to be upgraded is the latest file, and the hard disk in the hard disk storage device can be upgraded according to the configuration file.
[0099] In one embodiment of the present invention, the configuration file also includes the version number of the upgrade file of the hard disk to be upgraded, and the version number of the upgrade file of the hard disk to be upgraded is verified, including: obtaining the current version number of the hard disk to be upgraded, and judging whether the version number of the upgrade file is greater than the current version number; if the version number of the upgrade file is greater than the current version number, it is determined that the version number verification of the upgrade file of the hard disk to be upgraded has passed; by comparing the version number of the upgrade file with the current version number of the hard disk to be upgraded, the present invention can ensure that the upgrade is only performed when the upgrade file contains updated content, thereby avoiding unnecessary upgrade operations, saving time and resources, and improving the efficiency, security and reliability of the hard disk upgrade process.
[0100] Prevent downgrade risks: The version number comparison mechanism prevents the risk of downgrading the hard disk to an old version, which is important for maintaining the system
[0101] In an embodiment of the present invention, the configuration file also includes the version number of the upgrade file of the hard disk to be upgraded. In one example, the current version number of the hard disk to be upgraded is v1, and the version number of the upgrade file of the hard disk to be upgraded is v2. It can be seen that the version number of v2 is higher than v1. At this time, it can be determined that the version number verification of the upgrade file of the hard disk to be upgraded has passed, and the hard disk in the hard disk storage device can be upgraded according to the upgrade file of the hard disk to be upgraded.
[0102] The present invention discloses a hard disk upgrade method. The present invention ensures that only a correct hard disk is selected for upgrade by verifying the hard disk identification and manufacturer information, thereby avoiding hardware damage or data loss caused by misoperation. By matching the manufacturer information, unauthorized or counterfeit hard disks can be prevented from accessing the system for upgrade, thereby protecting the system from malware or hardware infringement, ensuring that only authorized hard disks can be upgraded, and effectively managing and upgrading hard disk storage devices while ensuring the safety and accuracy of operations. The obtained configuration file is checked to avoid the problem of upgrade failure due to not being able to find the corresponding hard disk.
[0103] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0104] Reference Figure 3 , shows a structural block diagram of a hard disk upgrade device provided by an embodiment of the present invention, the device comprising:
[0105] The first acquisition module 201 is used to acquire a configuration file of the hard disk to be upgraded; the configuration file includes a hard disk identification and first manufacturer information of the hard disk to be upgraded;
[0106] The first judgment module 202 is used to judge whether the hard disk to be upgraded is stored in a hard disk storage device according to the configuration file of the hard disk to be upgraded;
[0107] The second acquisition module 203 acquires second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded and recorded by the hard disk storage device if the hard disk to be upgraded is stored in the hard disk storage device;
[0108] A second determination module 204 is used to determine whether the first manufacturer information matches the second manufacturer information;
[0109] The first upgrading module 205 is configured to upgrade the hard disk in the hard disk storage device according to the configuration file if the first manufacturer information matches the second manufacturer information.
[0110] The present invention discloses a hard disk upgrade device. The present invention ensures that only a correct hard disk is selected for upgrade by verifying the hard disk identification and manufacturer information, thereby avoiding hardware damage or data loss caused by misoperation. By matching the manufacturer information, unauthorized or counterfeit hard disks can be prevented from accessing the system for upgrade, thereby protecting the system from malware or hardware infringement, ensuring that only authorized hard disks can be upgraded, and effectively managing and upgrading hard disk storage devices while ensuring the safety and accuracy of operations; and checking the obtained configuration files to avoid the problem of upgrade failure due to not being able to find the corresponding hard disk.
[0111] In an embodiment of the present invention, the second acquisition module includes:
[0112] An acquisition unit, configured to acquire a first mapping table; the first mapping table includes mapping relationships between multiple hard disk identifiers and manufacturer information;
[0113] The query unit is used to query the second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded from the first mapping table.
[0114] In one embodiment of the present invention, the device further comprises:
[0115] A third acquisition module, configured to acquire a hard disk identifier recorded in an expansion cabinet if the hard disk to be upgraded is not stored in the hard disk storage device;
[0116] A third judgment module is used to judge whether the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifier recorded in the expansion cabinet;
[0117] The second upgrading module is used for upgrading the hard disk corresponding to the hard disk identifier to be upgraded in the expansion cabinet if the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifier recorded in the expansion cabinet.
[0118] In one embodiment of the present invention, the device further comprises:
[0119] A fourth acquisition module, configured to acquire a hard disk identifier of the target hard disk when detecting that the target hard disk is inserted into the hard disk storage device;
[0120] A mapping table acquisition module, used to acquire a second mapping table, wherein the second mapping table includes a mapping relationship between multiple hard disk identifiers and drivers;
[0121] A fourth judgment module, configured to judge whether there is a driver corresponding to the hard disk identifier of the target hard disk in the second mapping table according to the hard disk identifier of the target hard disk;
[0122] a first loading module, configured to load the driver corresponding to the hard disk identifier of the target hard disk if the second mapping table contains the driver corresponding to the hard disk identifier of the target hard disk, obtain the manufacturer information of the target hard disk, and store the mapping relationship between the hard disk identifier of the target hard disk and the manufacturer information in the first mapping table;
[0123] The second loading module is used to obtain the protocol address of the target hard disk, obtain the driver program of the target hard disk according to the protocol address of the target hard disk, load the driver program, and obtain the manufacturer information of the target hard disk, if the driver program corresponding to the hard disk identifier of the target hard disk does not exist in the second mapping table, and store the mapping relationship between the hard disk identifier of the target hard disk and the manufacturer information in the first mapping table; and store the mapping relationship between the driver program of the target hard disk and the hard disk identifier of the target hard disk in the second mapping table.
[0124] In one embodiment of the present invention, the device further comprises:
[0125] A scanning module, used for scanning the hard disk connected to the hard disk storage device when the hard disk storage device is loaded through the pre-start execution environment server, to obtain the hard disk loaded in the hard disk storage device and the corresponding manufacturer information;
[0126] A naming module, used to name the hard disks installed in the hard disk storage device according to a preset naming rule, and obtain hard disk identification information of multiple installed hard disks;
[0127] The storage module is used to store the hard disk identification information and manufacturer information of the multiple installed hard disks in the first mapping table according to a one-to-one correspondence.
[0128] In an embodiment of the present invention, the first upgrade module is further used to verify the version number of the upgrade file of the hard disk to be upgraded;
[0129] The first upgrade module includes:
[0130] The verification submodule is used to upgrade the hard disk in the hard disk storage device according to the configuration file if the version number of the upgrade file of the hard disk to be upgraded is verified to be passed.
[0131] In an embodiment of the present invention, the configuration file further includes a version number of an upgrade file of the hard disk to be upgraded, and the first upgrade module includes:
[0132] A version number acquisition submodule is used to acquire the current version number of the hard disk to be upgraded, and determine whether the version number of the upgrade file is greater than the current version number;
[0133] The comparison submodule is used to determine that the version number verification of the upgrade file of the hard disk to be upgraded has passed if the version number of the upgrade file is greater than the current version number.
[0134] The present invention discloses a hard disk upgrade device. The present invention ensures that only a correct hard disk is selected for upgrade by verifying the hard disk identification and manufacturer information, thereby avoiding hardware damage or data loss caused by misoperation. By matching the manufacturer information, unauthorized or counterfeit hard disks can be prevented from accessing the system for upgrade, thereby protecting the system from malware or hardware infringement, ensuring that only authorized hard disks can be upgraded, and effectively managing and upgrading hard disk storage devices while ensuring the safety and accuracy of operations; and checking the obtained configuration files to avoid the problem of upgrade failure due to not being able to find the corresponding hard disk.
[0135] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0136] like Figure 4 , showing a structural block diagram of an electronic device 30 provided in an embodiment of the present invention, including:
[0137] A processor 301, a memory 302, and a computer program 3021 stored in the memory 302 and capable of running on the processor 301. When the computer program 3021 is executed by the processor 301, each process of the above-mentioned hard disk upgrade method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0138] like Figure 5, shows a structural block diagram of a computer-readable storage medium 40 provided in an embodiment of the present invention. A computer program 401 is stored on the computer-readable storage medium 40. When the computer program 401 is executed by the processor, the various processes of the above-mentioned hard disk upgrade method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0139] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0140] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0141] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0142] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0144] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0145] Finally, it should be noted that, in this article, 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 "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal 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 terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0146] The hard disk upgrade method, device, equipment and storage medium provided by the present invention are introduced in detail above. The principle and implementation mode of the present invention are explained by using specific examples in this article. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A hard disk upgrade method, characterized in that: The method comprises: Obtaining a configuration file of the hard disk to be upgraded; the configuration file includes a hard disk identification and first manufacturer information of the hard disk to be upgraded; According to the configuration file of the hard disk to be upgraded, determining whether the hard disk to be upgraded is stored in a hard disk storage device; If the hard disk to be upgraded is stored in the hard disk storage device, obtaining second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded and recorded by the hard disk storage device; Determining whether the first manufacturer information matches the second manufacturer information; If the first manufacturer information matches the second manufacturer information, the hard disk in the hard disk storage device is upgraded according to the configuration file.
2. The method according to claim 1, characterized in that The obtaining the second manufacturer information recorded by the hard disk storage device and corresponding to the hard disk identification of the hard disk to be upgraded includes: Obtain a first mapping table; the first mapping table includes mapping relationships between multiple hard disk identifiers and manufacturer information; The second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded is queried from the first mapping table.
3. The method according to claim 1, characterized in that The method further comprises: If the hard disk to be upgraded is not stored in the hard disk storage device, obtaining the hard disk identifier recorded in the expansion cabinet; Determine whether the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifier recorded in the expansion cabinet; If the hard disk identifier of the hard disk to be upgraded is included in the hard disk identifiers recorded in the expansion cabinet, the hard disk corresponding to the hard disk identifier to be upgraded in the expansion cabinet is upgraded.
4. The method according to claim 2, characterized in that: The method further comprises: When it is detected that a target hard disk is inserted into the hard disk storage device, obtaining a hard disk identification of the target hard disk; Acquire a second mapping table, wherein the second mapping table includes mapping relationships between multiple hard disk identifiers and drivers; According to the hard disk identifier of the target hard disk, determining whether a driver corresponding to the hard disk identifier of the target hard disk exists in the second mapping table; If the second mapping table contains a driver corresponding to the hard disk identifier of the target hard disk, then Loading the driver, acquiring the manufacturer information of the target hard disk, and storing the mapping relationship between the hard disk identifier of the target hard disk and the manufacturer information in the first mapping table; If the driver corresponding to the hard disk identifier of the target hard disk does not exist in the second mapping table, then Obtaining the protocol address of the target hard disk, obtaining the driver of the target hard disk according to the protocol address of the target hard disk, loading the driver, and obtaining the manufacturer information of the target hard disk, The mapping relationship between the hard disk identification of the target hard disk and the manufacturer information is stored in the first mapping table; the mapping relationship between the driver program of the target hard disk and the hard disk identification of the target hard disk is stored in the second mapping table.
5. The method according to claim 2, characterized in that: The method further comprises: When the hard disk storage device is loaded through the pre-start execution environment server, the hard disk connected to the hard disk storage device is scanned to obtain the hard disk loaded in the hard disk storage device and the corresponding manufacturer information; Naming the hard disks installed in the hard disk storage device according to a preset naming rule to obtain hard disk identification information of the multiple installed hard disks; The hard disk identification information and manufacturer information of the multiple installed hard disks are stored in the first mapping table in a one-to-one correspondence.
6. The method according to claim 1, characterized in that Before upgrading the hard disk in the hard disk storage device according to the configuration file, the method further includes: Verifying the version number of the upgrade file of the hard disk to be upgraded; The step of upgrading the hard disk to be upgraded according to the configuration file includes: If the version number of the upgrade file of the hard disk to be upgraded is verified, the hard disk in the hard disk storage device is upgraded according to the configuration file.
7. The method according to claim 6, characterized in that The configuration file also includes the version number of the upgrade file of the hard disk to be upgraded, and the verifying the version number of the upgrade file of the hard disk to be upgraded includes: Obtain the current version number of the hard disk to be upgraded, and determine whether the version number of the upgrade file is greater than the current version number; If the version number of the upgrade file is greater than the current version number, it is determined that the version number verification of the upgrade file of the hard disk to be upgraded has passed.
8. A hard disk upgrade device, characterized in that: The device comprises: A first acquisition module, used to acquire a configuration file of the hard disk to be upgraded; the configuration file includes a hard disk identification and first manufacturer information of the hard disk to be upgraded; A first judgment module, used for judging whether the hard disk to be upgraded is stored in a hard disk storage device according to the configuration file of the hard disk to be upgraded; a second acquisition module, which acquires second manufacturer information corresponding to the hard disk identifier of the hard disk to be upgraded and recorded by the hard disk storage device if the hard disk to be upgraded is stored in the hard disk storage device; The second judgment module is used to judge whether the first manufacturer information matches the second manufacturer information; the upgrade module is used to upgrade the hard disk in the hard disk storage device according to the configuration file if the first manufacturer information matches the second manufacturer information.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the hard disk upgrade method according to any one of claims 1 to 7 are implemented.
10. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the hard disk upgrade method according to any one of claims 1 to 7 are implemented.
