A method, device, equipment and medium for managing identity identification codes of computer system interfaces
By automatically generating and verifying identity identification codes in the storage system, the problem of SCSI ID conflicts in the existing technology is solved, efficient management in various mapping scenarios is achieved, and diverse user needs are met.
Patent Information
- Application Number
- CN202411980124.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-29
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-12-29
AI Technical Summary
In the prior art, conflicts are prone to occur when storage systems manage the identity identification codes of computer system interfaces, and the existing management methods are difficult to adapt to various mapping scenarios, resulting in poor management efficiency and quality, and unable to meet the diverse needs of users.
By determining the host group and volume group to be mapped, comparing and assigning unique identification codes, it ensures that each volume generates a unique SCSI ID in the host group. An automatic generation and verification mechanism is used to avoid conflicts. It is applicable to host groups of different mapping types.
It realizes efficient and accurate management of identity identification codes, is applicable to various mapping scenarios, meets the diverse needs of users, and ensures the uniqueness of SCSI IDs and the efficient and accurate management.
Smart Images

Figure CN119902999B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and computer-readable storage medium for managing identity identification codes of computer system interfaces. Background Art
[0002] Current storage systems are usually multi-controller systems. Multiple controllers form a cluster to provide services to the outside world. Hosts connected to the storage system can provide services to customers. When customers use the storage system, they create LUNs (Logical Unit Numbers) in the storage system and map the LUNs to hosts. Alternatively, users create volume groups in the storage system and add the volumes they use to a volume group. On the host side, multiple hosts are clustered to form a host group, and the volume group is mapped to the host group. The mapping diagram is shown below. Figure 1 shown.
[0003] A volume mapped to a host generates a SCSI (Small Computer System Interface) device on the host side. A host can map multiple volumes, which generates multiple SCSI devices on the host side. Each SCSI device is assigned a SCSI ID (Identity Document). Therefore, how to allocate and manage the mapped SCSI IDs is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide a method, device, electronic device and computer-readable storage medium for managing identity identification codes of computer system interfaces, which can achieve efficient and accurate management of identity identification codes, are not limited to application scenarios, and can better meet user needs.
[0005] To solve the above technical problems, an embodiment of the present invention provides a method for managing identity codes of computer system interfaces, comprising:
[0006] Determine the host group and volume group to be mapped;
[0007] For the current volume in the volume group, a first comparison step is performed; the first comparison step includes: comparing the current first identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current first identity identification code to be verified is within a preset identity identification code range;
[0008] When the current first identity identification code to be verified is different from all identity identification codes, a first assignment step is performed; the first assignment step includes: assigning the current first identity identification code to be verified to the current volume as the identity identification codes corresponding to the computer system interfaces of all hosts in the host group mapped to the current volume; wherein the host generates a corresponding computer system interface for each volume mapped to the host;
[0009] Repeat the following steps: use the next volume in the volume group as the current volume, update the current first identity identification code to be verified, perform the first comparison step, and perform the first assignment step if the current first identity identification code to be verified is different from all identity identification codes; until it is determined that all volumes in the volume group are mapped to the identity identification codes corresponding to the computer system interfaces of all hosts in the host group.
[0010] In one embodiment, it further includes:
[0011] If the current first identity identification code to be verified is identical to at least one of all the identity identification codes, incrementing the current first identity identification code to be verified by one to obtain a new current first identity identification code to be verified;
[0012] Repeat the first comparison step, and if the current first identity identification code to be verified is different from all the identity identification codes, perform the first assignment step, or if the current first identity identification code to be verified is the same as at least one of all the identity identification codes, add one to the current first identity identification code to obtain a new current first identity identification code to be verified, until all volumes in the volume group are mapped to the identity identification codes corresponding to the computer system interfaces of all hosts in the host group.
[0013] In one embodiment, after determining that all volumes in the volume group are mapped to the identification codes corresponding to the computer system interfaces of all hosts in the host group, the method further includes:
[0014] For each volume, record the correspondence between volume group, volume, host group and identity code;
[0015] All recorded correspondences between volume groups, volumes, host groups, and identification codes are stored in each host in the host group.
[0016] In one embodiment, it further includes:
[0017] Determine whether there are hosts in the host group to be mapped that have joined other host groups;
[0018] If there is a host that has joined other host groups among the hosts in the host group to be mapped, the first target host and other host groups that have joined other host groups are determined;
[0019] Determine the target volume group that has been mapped by other host groups;
[0020] If the first target host is not mapped to the target volume group, for each target volume in the target volume group, obtaining an identity code corresponding to a computer system interface of another host in another host group that the target volume is mapped to, and using the identity code as an identity code corresponding to the computer system interface of the first target host that the target volume is mapped to;
[0021] Record the correspondence between the target volume group, target volume, other host groups, the first target host, and the corresponding identification code;
[0022] All recorded correspondences among the target volume group, the target volume, other host groups, the first target host, and the identification codes corresponding to the target volume are stored in the first target host.
[0023] In one embodiment, it further includes:
[0024] Determine whether there is a host with a single volume mapped among the hosts in the host group to be mapped;
[0025] If there is a host mapped to the single volume, determining a second target host mapped to the single volume and the corresponding target single volume;
[0026] Determining a current second identity identification code to be verified and executing a second comparison step; the second comparison step comprising: comparing the current second identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current second identity identification code to be verified is within a preset identity identification code range;
[0027] When the current second identity identification code to be verified is different from all the identity identification codes, a second assignment step is performed; the second assignment step includes: assigning the current second identity identification code to be verified as the identity identification code corresponding to the computer system interface of the second target host mapped to the target single volume;
[0028] If the current second identity identification code to be verified is identical to at least one of all the identity identification codes, adding one to the current second identity identification code to be verified to obtain a new current second identity identification code to be verified;
[0029] Repeating the second comparison step and, if the current second identity identification code to be verified is different from all the identity identification codes, performing the second assignment step, or if the current second identity identification code to be verified is the same as at least one of all the identity identification codes, incrementing the current second identity identification code to be verified by one to obtain a new current second identity identification code to be verified; until the identity identification code corresponding to the computer system interface of the second target host mapped to the target single volume is determined;
[0030] The corresponding relationship among the target volume, the host group, the second target host and the identity code is recorded, and the corresponding relationship among the target volume, the host group, the second target host and the identity code is stored in the second target host.
[0031] In one embodiment, it further includes:
[0032] When a host joining request is detected, determining a host to be joined and a target host group to be joined according to the host joining request;
[0033] Obtain the identity identification codes corresponding to the respective computer system interfaces mapped to the host to be added;
[0034] Obtaining the identity codes corresponding to the computer system interfaces of all volume groups mapped to the target host group;
[0035] Compare the identity identification codes corresponding to the computer system interfaces mapped to the host to be added with the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group;
[0036] If the identity identification codes corresponding to the computer system interfaces mapped to the host to be added are different from the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group, adding the host to be added to the target host group to be added;
[0037] For each volume group of the target host group and each volume in each volume group, the correspondence between the target host group, volume group, volume, host to be added and the corresponding identity identification code is recorded, and the recorded correspondence between the target host group, volume group, volume, host to be added and the corresponding identity identification code is stored in the host to be added.
[0038] In one embodiment, it further includes:
[0039] If the identity identification codes corresponding to the computer system interfaces mapped to the host to be added are identical to at least one of the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group to be added, the host to be added is refused to be added to the target host group, and a prompt for refusing to add is returned.
[0040] Another embodiment of the present invention provides a device for managing identity codes of computer system interfaces, including:
[0041] A first determining module is used to determine the host group and volume group to be mapped;
[0042] A first comparison module is configured to perform a first comparison step for a current volume in the volume group; the first comparison step comprising: comparing a current first identity identification code to be verified with identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current first identity identification code to be verified is determined from a preset range of identity identification codes;
[0043] The second determining module is configured to execute a first assignment step when the current first identity identification code to be verified is different from all identity identification codes; the first assignment step includes: assigning the current first identity identification code to be verified to the current volume as the identity identification code corresponding to the computer system interfaces of all hosts in the host group mapped to the current volume;
[0044] The first return module is used to take the next volume in the volume group as the current volume and update the current first identity identification code to be verified, triggering the first comparison module and the second determination module until it is determined that all volumes in the volume group are mapped to the identity identification codes corresponding to the respective computer system interfaces of all hosts in the host group.
[0045] Another embodiment of the present invention provides an electronic device, including:
[0046] Memory for storing computer programs;
[0047] The processor is configured to execute a computer program to implement the steps of the method for managing the identity identification code of the computer system interface.
[0048] Another aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for managing the identity identification code of the computer system interface as described above are implemented.
[0049] It can be seen from the above technical solution that the beneficial effects of the present invention are:
[0050] An embodiment of the present invention provides a method for managing identity identification codes of computer system interfaces. For a host group and volume group to be mapped, a current first identity identification code to be verified within a preset identity identification code range can be determined for each volume in the volume group, and the current first identity identification code to be verified can be compared with the identity identification codes corresponding to all computer system interfaces mapped to all hosts in the host group. If the current first identity identification code to be verified is different from all the identity identification codes, it means that the current first identity identification code to be verified does not conflict with other mapped identity identification codes. Therefore, the current first identity identification code to be verified can be assigned to the current volume as the identity identification code corresponding to the computer system interfaces of all hosts in the host group mapped by the current volume. After the current first identity identification code to be verified is updated, the above comparison and assignment processes are repeated to determine the identity identification codes corresponding to the computer system interfaces of each host in the host group mapped to all volumes in the volume group. The present invention can automatically generate identity identification codes that are uniquely corresponding to host groups and volumes in volume groups, and does not limit the mapping type of the host group. Regardless of whether the hosts in the host group have mapped a single volume or a volume group, a unique SCSI ID can be allocated to the computer system interface of each host in the host group for each volume in the volume group. The present invention is applicable to more scenarios, helps to better meet user needs, and ensures efficient and accurate management.
[0051] In addition, the present invention also provides corresponding implementation devices, electronic devices and computer-readable storage media for the management method of the identity identification code of the computer system interface, which further makes the method more practical, and the devices, electronic devices and computer-readable storage media have corresponding advantages. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. 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 any creative work.
[0053] Figure 1 A schematic diagram of a host group and volume group mapping, and a host and volume mapping in the related art;
[0054] Figure 2 A flowchart of a method for managing identity codes of a computer system interface provided by an embodiment of the present invention;
[0055] Figure 3 A flowchart of a method for managing an identity code of a computer system interface provided by an embodiment of the present invention
[0056] Figure 4A flowchart of a method for managing identity codes of a computer system interface provided by an embodiment of the present invention;
[0057] Figure 5 A flowchart of adding a shared mapping provided by an embodiment of the present invention;
[0058] Figure 6 A schematic diagram of a mapping relationship between a host group and multiple volume groups provided by an embodiment of the present invention;
[0059] Figure 7 A flowchart of a host joining a host group provided by an embodiment of the present invention;
[0060] Figure 8 A relationship diagram of a host joining a host group provided by an embodiment of the present invention;
[0061] Figure 9 A schematic diagram of the structure of a device for managing identity codes of a computer system interface provided by an embodiment of the present invention;
[0062] Figure 10 A schematic structural diagram of an electronic device provided by an embodiment of the present invention;
[0063] Figure 11 A schematic structural diagram of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0065] The terms "including" and "having," as used in the present description and accompanying drawings, and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements and may include steps or elements that are not listed.
[0066] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0067] It's important to note that storage systems typically feature multiple controllers, forming a cluster that provides services. If one controller fails, the remaining controllers continue to provide services. Hosts connected to the storage system and providing services to clients can provide services individually or as a cluster. For example, a group of servers can act as a whole to provide resources to clients. If a node (a single server) providing resources fails, the remaining nodes in the cluster can take over and continue providing resources to clients.
[0068] Customers typically create LUNs (Logical Unit Numbers) in the storage system and then map them to hosts. Some users also create volume groups in the storage system, add used volumes to these volume groups, create clusters with multiple hosts, and map these volume groups to the host clusters. Volumes mapped to a host generate SCSI devices on the host side. A host can map multiple volumes, resulting in multiple SCSI devices on the host side. SCSI devices are typically identified using SCSI IDs; each device in a SCSI domain has an ID.
[0069] In the related art, most storage systems support volume-host and volume-group-host-group mapping. In order to prevent conflicts between host and volume mapping, storage systems often restrict the mapping scenarios between host groups, volume groups, hosts and volumes. For example, the host in the host group is restricted from mapping other single volumes (that is, volumes that are not added to the volume group); a host cannot be added to multiple host groups; a single host cannot be mapped to a volume group, etc., so as to facilitate the management of SCSI IDs. In the related art, the next SCSI ID can be manually generated linearly based on the existing SCSI IDs in the host group, or the next SCSI ID can be generated linearly by the system. When a SCSI ID is generated incorrectly, it may cause a SCSI ID conflict. However, the related art does not check whether the generated SCSI ID already exists, making it difficult to ensure that the SCSI ID does not conflict, resulting in poor management efficiency and quality.
[0070] like Figure 1 As shown in the figure, since host host3 is already in the host group, host host3 cannot map single volume LUN0; host host3 is already in the host group, so host host3 cannot be added to other host groups; host host0 cannot map LUN groups. This restriction method makes it easy to manage SCSI IDs. In other words, SCSI IDs only need to be generated linearly. For example, the detailed SCSI IDs mapped between host Host0 and each single volume LUN0, LUN1, LUN2, LUN3, LUN4, and LUN5 are shown in Table 1 below:
[0071] Table 1 SCSI IDs mapped between hosts and volumes
[0072]
[0073] The mapping type between the host and each volume in Table 1 is private mapping.
[0074] The SCSI IDs mapped between host groups and volume groups are detailed in Table 2 below:
[0075] Table 2 SCSI ID mapping between host group and volume group
[0076]
[0077] In Table 2, the host group includes hosts Host0 and Host1, the volume group includes LUN0, LUN1, and LUN2, and the mapping type is shared mapping (ie, Shared mapping).
[0078] Related technical solutions impose restrictions on the mapping of hosts and volumes. For example, one restriction prevents a host from mapping other volumes after joining a host group. This can hinder resource utilization for clients with limited host resources. Another restriction prevents a host from joining multiple host groups, which also limits resource reuse. Another restriction prevents hosts from mapping LUN groups, which is unfriendly for clients with limited host resources or those who prefer centralized LUN management. Current mapping types and scenarios are limited. With the increasing number of SCSI devices supported by hosts, current management methods are not adaptable to multiple scenarios and struggle to meet user needs.
[0079] Please refer to Figure 2 , Figure 2 A flowchart of a method for managing an identity code of a computer system interface provided by an embodiment of the present invention, the method comprising:
[0080] S110: Determine the host group and volume group to be mapped;
[0081] It should be noted that in an embodiment of the present invention, based on the mapping request input by the user, the mapping request may include the identification information or number of the host group and the identification information or number of the volume group, so that the corresponding host group and volume group to be mapped can be determined based on the mapping request.
[0082] S120: For the current volume in the volume group, compare the current first identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current first identity identification code to be verified is within a preset identity identification code range;
[0083] It is understood that after determining the volume group, the first volume in the volume group can be used as the current volume. The SCSI IDs of all computer system interfaces mapped to each host in the host group are then obtained. The current first identity code to be verified is then compared with the SCSI IDs of all hosts in the host group. In practical applications, for each new mapping request, the current first identity code to be verified can be verified starting with the minimum preset identity code in a preset range of identity codes, for example, starting at 1. During the processing of each volume group corresponding to the host group, the first current first identity code to be verified can be the same or different.
[0084] S130: If the current first identity identification code to be verified is different from all identity identification codes, execute S140;
[0085] S140: Assigning the current first identity code to be verified to the current volume in the volume group as the identity code corresponding to the computer system interfaces of all hosts in the host group mapped to the current volume; wherein the host generates a corresponding computer system interface for each volume mapped to the host;
[0086] It should be noted that if the current first identity identification code to be verified is different from all identity identification codes, it means that the current first identity identification code to be verified does not conflict with the SCSI IDs mapped to all hosts in the host group. It can be determined that the current first identity identification code to be verified is a valid identity identification code. At this time, the current first identity identification code to be verified can be assigned to the current volume in the volume group, and the current first identity identification code to be verified can be used as the identity identification code corresponding to the computer system interfaces of all hosts in the host group mapped to the current volume. That is, when the current volume is mapped to all hosts in the host group, a computer system interface SCSI will be generated on each host side, and each SCSI corresponding to an identity identification code is the current first identity identification code to be verified. In other words, for a current volume in the same volume group, the SCSI ID of the computer system interface of each host in the host group mapped to the current volume is consistent, and the SCSI ID of each host in the host group for the current volume is the current first identity identification code to be verified.
[0087] S150: Repeat the following steps: set the next volume in the volume group as the current volume, update the current first identity code to be verified, and execute steps S120 to S140; until it is determined that all volumes in the volume group are mapped to the identity codes corresponding to the computer system interfaces of all hosts in the host group.
[0088] It is understandable that it is necessary to identify whether all volumes in the volume group have corresponding identity identification codes. If not, the next volume in the volume group with an undetermined identity identification code is determined as the current volume. In practical applications, identity identification codes can be assigned to each volume one by one starting from the first volume in the volume group. Therefore, after determining whether the current volume is the last volume in the volume group, if it is not the last volume, the next volume after the current volume is used as the current volume, and the current first identity identification code to be verified is updated. For example, one can be added to the current first identity identification code to obtain an updated current first identity identification code to be verified, and steps S120 to S140 are repeated until each volume in the volume group has its SCSI identity identification code mapped to each host in the host group, thereby obtaining the SCSI ID of each volume in the volume group mapped to each host in the host group. If the current volume is the last volume in the volume group, it means that the SCSI ID mapped to each host in the host group has been determined for each volume. For each host in the host group, when the host group maps a volume group, the SCSI ID mapped to each host in the host group by a volume in the volume group is the same.
[0089] During implementation, the present invention does not limit the mapping type of the host group. Regardless of whether the hosts in the host group are privately mapped (i.e., the host maps a single volume) or shared mapped (i.e., the host group maps a volume group), a unique corresponding SCSI ID can be assigned to each volume in the volume group when mapping. This is applicable to more scenarios and helps to better meet user needs.
[0090] Thus, it can be seen that in the embodiment of the present invention, for the host group and volume group to be mapped, the current first identity identification code to be verified within the preset identity identification code range can be determined for each volume in the volume group, and the current first identity identification code to be verified can be compared with the identity identification codes corresponding to all computer system interfaces mapped to all hosts in the host group. If the current first identity identification code to be verified is different from all the identity identification codes, it means that the current first identity identification code to be verified does not conflict with other mapped identity identification codes. Therefore, the current first identity identification code to be verified can be assigned to the current volume as the identity identification code corresponding to the computer system interfaces of all hosts in the host group mapped by the current volume. After the current first identity identification code to be verified is updated, the above comparison process and assignment process are repeated to determine the identity identification codes corresponding to the computer system interfaces of each host in the host group mapped to all volumes in the volume group. The present invention can automatically generate identity identification codes that are uniquely corresponding to host groups and volumes in volume groups, and does not limit the mapping type of the host group. Regardless of whether the hosts in the host group have mapped a single volume or a volume group, a unique SCSI ID can be allocated to the computer system interface of each host in the host group for each volume in the volume group. The present invention is applicable to more scenarios, helps to better meet user needs, and ensures efficient and accurate management.
[0091] Based on the above embodiments, the embodiments of the present invention further illustrate and introduce the technical solutions. Figure 3 , Figure 3 A flowchart of another method for managing identity codes of a computer system interface provided by an embodiment of the present invention, the method comprising:
[0092] S210: Determine the host group and volume group to be mapped;
[0093] S220: For the current volume in the volume group, compare the current first identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current first identity identification code to be verified is within a preset identity identification code range;
[0094] S230: If the current first identity identification code to be verified is different from all identity identification codes, execute S240;
[0095] S240: Assigning the current first identity code to be verified to the current volume in the volume group as the identity code corresponding to the computer system interfaces of all hosts in the host group mapped to the current volume; wherein the host generates a corresponding computer system interface for each volume mapped to the host;
[0096] S250: Repeat the following steps: set the next volume in the volume group as the current volume, increment the current first identity code to be verified by one to obtain a new current first identity code to be verified, and execute steps S220 to S240 until all volumes in the volume group are mapped to the identity codes corresponding to the computer system interfaces of all hosts in the host group.
[0097] It should be noted that S210 to S250 in the embodiment of the present invention respectively correspond to S110 to S150 in the above embodiment. For the relevant introduction of S210 to S250, please refer to S110 to S150 in the above embodiment, and the present invention will not repeat them here.
[0098] S260: When the current first identity identification code to be verified is identical to at least one of all the identity identification codes, the current first identity identification code to be verified is incremented by one to obtain a new current first identity identification code to be verified, and the process returns to S220.
[0099] It should be noted that, when the current first identity identification code to be verified is the same as at least one of all the identity identification codes, it means that the current first identity identification code to be verified has been occupied. In order to ensure the uniqueness of the SCSI ID, the current first identity identification code to be verified can be updated at this time, for example, one is added to the current first identity identification code to be verified, so as to obtain an updated current first identity identification code to be verified, and the updated current first identity identification code to be verified is used as the new current first identification code to be verified, and the process returns to execute S220, so as to realize the determination of the SCSI ID of the host group mapped to each volume in the volume group, and make the determined SCSI ID unique among all SCSIIDs of the host group.
[0100] Of course, in practical applications, such as Figure 4As shown, after obtaining a current volume in the volume group, for the current volume, the current first identity identification code to be verified (can start from 1) is used to obtain a host from the host group (starting from the first host), determine all SCSI IDs mapped by the host, and then determine whether there is a SCSI ID consistent with the current first identity identification code to be verified among all SCSI IDs mapped by the host. If so, it means that the current first identity identification code to be verified has been occupied (the current first SCSI ID to be verified is invalid). At this time, it can be determined whether the current first SCSI ID to be verified is the last SCSI ID in the preset SCSI ID range. If not, the SCSI ID is added 1 to obtain a new SCSI ID, and the new current first identity identification code to be verified is re-verified. If no SCSI ID that matches the current first SCSI ID to be verified exists among all the SCSI IDs mapped by the host, it is determined whether there are other hosts in the host group that have not been compared. If so, all SCSI IDs mapped by the next host are obtained and compared with the current first SCSI ID to be verified. If it is still not occupied, all SCSI IDs allocated by the next host are obtained. After all SCSI IDs allocated by all hosts in the host group have been compared, it is determined that no allocated SCSI ID matches the current first SCSI ID to be verified, indicating that the current first SCSI ID to be verified is not occupied (i.e., it is a valid SCSI ID). At this time, the current first SCSI ID to be verified can be determined as the unique SCSI ID mapped to the host group by the current volume in the volume group. Then, the next volume in the volume group is traversed until all volumes have been traversed.
[0101] In one embodiment, after determining that all volumes in the volume group are mapped to the identity identification codes corresponding to the computer system interfaces of all hosts in the host group, the method may further include:
[0102] For each volume, record the correspondence between volume group, volume, host group and identity code;
[0103] All recorded correspondences between volume groups, volumes, host groups, and identification codes are stored in each host in the host group.
[0104] It should be noted that after obtaining the SCSI IDs of the current volumes in the volume group mapped to all hosts in the host group, the corresponding relationships among the volume group, volume, host group, and IDs can be further recorded. Specifically, this information can be stored in a SCSI ID list corresponding to the host group. After obtaining the IDs of all volumes in the volume group mapped to all hosts in the host group, the SCSI ID of each volume in the volume group relative to each host in the host group can be obtained. Then, corresponding shared mappings can be added for each host in the host group and each volume in the volume group.
[0105] like Figure 5 As shown, when adding a shared mapping (i.e., a mapping corresponding to a volume group), you can obtain the SCSI IDs of all volumes in the volume group that are mapped to the host group. You can then add the host member mappings in the host group starting from the first volume in the volume group. After adding all hosts in the host group for that volume, the SCSI IDs corresponding to all hosts in the host group mapped to that volume are stored in the volume and also in the corresponding hosts. Then, you obtain the next volume in the volume group and repeat the above process until all volumes have been mapped.
[0106] It should be noted that the hosts in the host group are added only to this host group, or even if they are added to other host groups but no volumes are mapped to other host groups, in this scenario the SCSI ID lists mapped to all hosts in the host group are the same. Figure 6 As shown in the figure, all hosts in host group 0 have mapped all volumes in LUN group 0. The SCSI ID list of each host in host group 0 is host0[1,2,3], host1[1,2,3], and host2[1,2,3]. If host group 0[host0,host1,host2] maps a new volume group (such as LUN group 1) with three member volumes, the new SCSI IDs assigned to the host group are [4,5,6]. The SCSI ID list of each host is host0[1,2,3,4,5,6], host1[1,2,3,4,5,6], and host2[1,2,3,4,5,6]. Of course, if host group 0[host0,host1,host2] maps a new volume group with three member volumes, the new SCSI IDs assigned to the host group are [7,8,9].
[0107] In order to further meet the user's usage needs in multiple scenarios, the method in the embodiment of the present invention may further include:
[0108] Determine whether there are hosts in the host group to be mapped that have joined other host groups;
[0109] If there is a host that has joined other host groups among the hosts in the host group to be mapped, the first target host and other host groups that have joined other host groups are determined;
[0110] Determine the target volume group that has been mapped by other host groups;
[0111] If the first target host is not mapped to the target volume group, for each target volume in the target volume group, obtaining an identity code corresponding to a computer system interface of another host in another host group that the target volume is mapped to, and using the identity code as an identity code corresponding to the computer system interface of the first target host that the target volume is mapped to;
[0112] Record the correspondence between the target volume group, target volume, other host groups, the first target host, and the corresponding identification code;
[0113] All recorded correspondences among the target volume group, the target volume, other host groups, the first target host, and the identification codes corresponding to the target volume are stored in the first target host.
[0114] It should be noted that when there are hosts that have joined other host groups among the hosts in the host group, the first target host and other host groups that have joined other host groups can be further determined. For example, host group 0 includes host0, host1, and host2. Host group 0 maps LUN group 0 (including LUN0, LUN1, and LUN2). Then the SCSI ID list of each host in host group 0 is host0[1,2,3], host1[1,2,3], and host2[1,2,3]. If the host host0 is also joined to another host group 1 at the same time, the host host0 is determined to be the first target host, and the host group 1 is another host group, and the target volume group mapped by the host group 1 is further determined. For example, the target volume group is LUN group 1 (including LUN3, LUN4 and LUN5), LUN3 in the target volume group is mapped to the SCSI ID of host group 1 as 4, LUN4 in the target volume group is mapped to the SCSI ID of host group 1 as 5, and LUN5 in the target volume group is mapped to the SCSI ID of host group 1 as 6. It can be determined by obtaining the SCSI ID list stored by the first target host that if the first target host does not map the target volume group LUN4, it means that the mapping of the first target host was omitted in the process of mapping volume groups by other host groups. Therefore, 4 can be used as the volume LUN3 in the target volume group LUN group 1 to be mapped to the SCSI ID of the host host0 in host group 1, and 5 can be used as the volume LUN4 in the target volume group LUN group 1 to be mapped to the SCSI The target volume group LUN group 1 has an ID, and 6 is used as the volume LUN4 in the target volume group LUN group 1 to be mapped to the SCSI ID of the host host0 in the host group 1. Therefore, the host host0 list will store the corresponding relationship between the target volume group (LUN group 1), volume LUN3, host group 1, host host0, and 4; the corresponding relationship between the target volume group (LUN group 1), volume LUN4, host group 1, host host0, and 5; and the corresponding relationship between the target volume group (LUN group 1), volume LUN5, host group 1, host host0, and 6. The method provided in the embodiment of the present invention can further verify whether there is a host group that has missed the mapping of the volume group to the host when the host in the host group joins different host groups, and can further ensure the integrity of the mapping of the volume groups of different host groups to the host, which is conducive to better meeting user needs.
[0115] In one embodiment, to further meet the user's multi-scenario usage needs, the method may further include:
[0116] Determine whether there is a host with a single volume mapped among the hosts in the host group to be mapped;
[0117] If there is a host mapped to the single volume, determining a second target host mapped to the single volume and the corresponding target single volume;
[0118] Determining a current second identity identification code to be verified and performing a second comparison step; the second comparison step comprising: comparing the current second identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current second identity identification code to be verified is within a preset identity identification code range;
[0119] If the current second identity identification code to be verified is different from all the identity identification codes, a second assignment step is performed; the second assignment step includes: assigning the current second identity identification code to be verified to the target volume as the identity identification code corresponding to the computer system interface of the target volume mapped to the second target host;
[0120] If the current second identity identification code to be verified is identical to at least one of all the identity identification codes, incrementing the current second identity identification code to be verified by one to obtain a new current second identity identification code to be verified;
[0121] Repeating the second comparison step and, if the current second identity identification code to be verified is different from all the identity identification codes, performing the second assignment step, or if the current second identity identification code to be verified is the same as at least one of all the identity identification codes, incrementing the current second identity identification code to be verified by one to obtain a new current second identity identification code to be verified; until the identity identification code corresponding to the computer system interface of the second target host mapped to the target single volume is determined;
[0122] The corresponding relationship among the target volume, the host group, the second target host and the identity code is recorded, and the corresponding relationship among the target volume, the host group, the second target host and the identity code is stored in the second target host.
[0123] It should be noted that, in the embodiment of the present invention, the second target host and the target single volume mapped in the host group can also be determined. To avoid SCSI ID conflicts, a current second identity code to be verified can be determined. The current second identity code to be verified can start from the minimum preset identity code, or the maximum SCSI ID can be determined from all SCSI IDs mapped by all hosts in the host group. The maximum SCSI ID is then incremented by one as the current second identity code to be verified. Of course, all the determined current second identity codes to be verified are within the preset identity code range. If the current second identity code to be verified is not identical to all SCSI IDs mapped by each host in the host group, the current second identity code to be verified is determined as the identity code mapped from the target single volume to the second target host in the host group, and the corresponding relationship between the target single volume, the host group, the second target host, and the identity code is recorded and stored in the second target host. If the current second identity code to be verified is identical to at least one of all the identity codes, it indicates that there is a conflict between the current second identity code to be verified and the assigned identity code. In this case, the current second identity code to be verified may be incremented by one to obtain a new current second identity code to be verified. The process then returns to the step of comparing the current identity code to be verified with the identity codes corresponding to all computer system interfaces mapped to each host in the host group. If the current second identity code to be verified is different from all the identity codes, the current second identity code to be verified is assigned to the target volume as the identity code corresponding to the computer system interface mapped to the second target host. This process continues until the identity code (i.e., the SCSI ID) corresponding to the computer system interface mapped to the second target host is determined. The corresponding relationship between the target volume, the host group, the second target host, and the identity code is stored in the second target host, thereby completing the mapping of the target volume to the second target host.
[0124] For example, if host group 0 maps LUN group 0 (including LUN0, LUN1, and LUN2), the SCSI ID list for each host in host group 0 is host0[1,2,3], host1[1,2,3], and host2[1,2,3]. If host host1 in the host group maps single volume LUN3, and host host2 in the host group maps single volume LUN4, the SCSI ID list for each host in the host group is:
[0125] host0[1,2,3], host1[1,2,3,4], host2[1,2,3,5].
[0126] In one embodiment, to further meet the user's multi-scenario usage needs, the method may further include:
[0127] When a host joining request is detected, determining a host to be joined and a target host group to be joined according to the host joining request;
[0128] Obtain the identity identification codes corresponding to the respective computer system interfaces mapped to the host to be added;
[0129] Obtaining the identity codes corresponding to the computer system interfaces of all volume groups mapped to the target host group;
[0130] Compare the identity identification codes corresponding to the computer system interfaces mapped to the host to be added with the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group to be added;
[0131] If the identity identification codes corresponding to the computer system interfaces mapped to the host to be added are different from the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group to be added, adding the host to be added to the target host group to be added;
[0132] For each volume group of the target host group and each volume in each volume group, record the correspondence between the target host group, volume group, volume, host to be added and the corresponding identity identification code, and store each recorded correspondence between the target host group, volume group, volume, host to be added and the corresponding identity identification code in the host to be added;
[0133] If the identity identification codes corresponding to the computer system interfaces mapped to the host to be added are identical to at least one of the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group to be added, the host to be added is refused to be added to the target host group, and a prompt for refusing to add is returned.
[0134] It should be noted that, in an embodiment of the present invention, when a user needs to add a host to a specified host group, a host joining request can be initiated. The host joining request can include the identification information of the host to be added and the identification information of the target host group, so that the host to be added and the target host group to be added can be determined based on the host joining request. All shared mappings of the host group to be added are obtained, and the shared mappings include the identity identification codes corresponding to each computer system interface of all volume groups mapped by the target host group, and all the identity identification codes mapped by the host to be added are obtained. For each identity identification code in the target host group, it is determined whether there are all the identity identification codes mapped by the host group among all the identity identification codes mapped by the host to be added. If there is at least one identity identification code mapped by the host group, it means that the mapping conflict occurs, and the host to be added can be rejected from joining the target host group. If there is no identity identification code mapped by any target host group among all the identity identification codes mapped by the host to be added, it means that there is no conflict, and the host to be added can be added to the target host group. After the host to be added is added to the target host group, for example, for volumes LUN7, LUN8, and LUN9 in the volume group LUN0 group that has been mapped to the target host group, the SCSI ID of volume LUN7 mapped to each host in the target host group is 8, the SCSI ID of volume LUN8 mapped to each host in the target host group is 9, and the SCSI ID of volume LUN9 mapped to each host in the target host group is 10, then 8 can be used as volume LUN7 to map to the SCSI ID of the host to be added, 9 can be used as volume LUN8 to map to the SCSI ID of the host to be added, and 10 can be used as volume LUN9 to map to the SCSI ID of the host to be added. In this way, the correspondence between the target host group, volume group, volume, host to be added, and the corresponding identity identification code can be recorded, and the corresponding correspondence between each recorded target host group, volume group, volume, host to be added, and the corresponding identity identification code can be stored in the host to be added, completing the mapping between each volume group mapped by the target host group and the host to be added after the host to be added is added to the target host group.
[0135] In other words, if Figure 7As shown, (1) all shared mappings of the host group to be added are obtained and all mappings are temporarily stored in the shared_map_scsi_id array; (2) starting from the first shared_map_scsi_id[0] recorded, all mappings of the target host are traversed to find whether there is a mapping scsi_id equal to shared_map_scsi_id[0]. If it is found, it indicates a conflict. If no mapping is found after traversing all mappings of the target host, it indicates that there is no conflict with shared_map_scsi_id[0]; (3) Continue to traverse the next shared_map_scsi_id[1]. The same as step (2) until all members in the shared_map_scsi_id array are traversed. As long as the SCSI ID occupied by the existing mapping of the host can be found in the shared mapping, the SCSI ID conflict occurs and the host is not allowed to be added to the host group; (4) If there is no conflict, the addition is allowed and all shared mappings of the host group are added to the host to be added.
[0136] For example, the hosts are shown in Table 3 below:
[0137] Table 3 SCSI ID list of different hosts
[0138]
[0139] Please refer to Figure 8 , the SCSI ID of host 0 is 1, and the SCSI IDs mapped to host group 0 are [1,2,3]. All of them are 1, resulting in a conflict. Therefore, host 0 is not allowed to join host group 0.
[0140] If the host to be added can be added to the target host group, all shared mapping LUNs in the target host group are obtained. For example, all shared mappings in the target host group can be obtained by finding the first existing host in the host group and finding all shared mappings of the first host. Then, the volume ID and corresponding SCSI ID of each shared mapping can be saved, and the host to be added can be mapped to all recorded shared mappings, thereby completing the addition and mapping of the host to the host group.
[0141] In one embodiment, the method may further include:
[0142] Get unmap request;
[0143] Determine the host group and volume group to be released according to the release mapping request;
[0144] Determine the identity codes of all computer system interfaces corresponding to the volume group to be released from each host in the host group to be released;
[0145] The identity identification codes of all computer system interfaces corresponding to the volume group to be released are deleted from each host in the host group to be released, so as to release the corresponding identity identification codes.
[0146] It should be noted that, in order to further meet user needs in the embodiment of the present invention, the mapping relationship can also be released according to user instructions. When the user needs to release the mapping of a host group and volume group, the user can input a release request, which may include the identification information of the host group to be released and the identification information of the volume group to be released. Thus, the host group to be released and the volume group to be released can be determined according to the release request, and then all SCSI IDs corresponding to the volume group to be released can be determined from all SCSI IDs mapped to the host group to be released. Then, these SCSI IDs are deleted from each host in the host group to be released, and all SCSI IDs corresponding to the host group to be released can also be deleted from the volume group to be released, thereby realizing the release of the mapped SCSI IDs of the host group to be released and the volume group to be released.
[0147] In addition, the released SCSI IDs are in a released state. If the host group to be released needs to map other volume groups later, these released SCSI IDs can still be reallocated.
[0148] In addition, the method provided by the present invention proposes a method for effectively allocating SCSI IDs and detecting SCSI ID conflicts in mixed mapping scenarios such as supporting mapping between volumes and hosts, volume groups and host groups, hosts joining multiple host groups, hosts in a host group mapping to another single volume, and hosts mapping to volume groups, which can better meet the diverse needs of different users and greatly improve usability.
[0149] It should also be noted that if the SCSI IDs occupied by different hosts in a host group differ significantly, the host group may not be able to find a valid SCSI ID when mapping the volume group again, which will indirectly affect the overall specifications. Assuming that a single host can map a maximum of 2048 volumes, that is, the preset identity code range is [0,2048], if the SCSI IDs occupied by the hosts in the host group are as follows:
[0150] host0[1,2,3,…,512], host1[512,…,1024], host2[1024,…,2048]. At this point, all SCSI IDs have been indirectly occupied, and no valid SCSI IDs are available for the host group to map to the volume group. Therefore, to ensure the effectiveness and accuracy of SCSI ID allocation for each host in the host group, in actual applications, reasonable usage scenarios can be planned to ensure support for mixed mapping scenarios without affecting usage specifications.
[0151] The present invention also provides a corresponding device for the method for managing the identity identification code of the computer system interface, which further makes the method more practical. Among them, the device can be explained from the perspective of functional modules and hardware. The following is an introduction to the device for managing the identity identification code of the computer system interface provided by the present invention. The device is used to implement the method for managing the identity identification code of the computer system interface provided by the present invention. In this embodiment, the device for managing the identity identification code of the computer system interface may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to complete the method for managing the identity identification code of the computer system interface disclosed in the above embodiment. The program module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of the device for managing the identity identification code of the computer system interface in the storage medium than the program itself. The following description will specifically introduce the functions of each program module of this embodiment. The device for managing the identity identification code of the computer system interface described below and the method for managing the identity identification code based on the computer system interface described above can refer to each other.
[0152] From the perspective of functional modules, see Figure 9 , Figure 9 This is a structural diagram of a device for managing identity codes of a computer system interface provided by the present invention. The device may include:
[0153] A first determining module 11 is used to determine the host group and volume group to be mapped;
[0154] The first comparison module 12 is configured to perform a first comparison step for the current volume in the volume group. The first comparison step includes comparing the current first identity code to be verified with the identity codes corresponding to all computer system interfaces mapped to each host in the host group. The current first identity code to be verified is within a preset identity code range.
[0155] The second determining module 13 is configured to execute a first assignment step when the current first identity identification code to be verified is different from all identity identification codes. The first assignment step includes: assigning the current first identity identification code to be verified to the current volume as the identity identification codes corresponding to the computer system interfaces of all hosts in the host group mapped to the current volume; wherein the host generates a corresponding computer system interface for each volume mapped to the host;
[0156] The first return module 14 is used to repeatedly execute the following steps: taking the next volume in the volume group as the current volume, updating the current first identity identification code to be verified, and executing the first comparison step, and executing the first assignment step when the current first identity identification code to be verified is different from all identity identification codes, until it is determined that all volumes in the volume group are respectively mapped to the identity identification codes corresponding to the respective computer system interfaces of all hosts in the host group.
[0157] In one embodiment, it further includes:
[0158] a second returning module configured to, when the current first identity identification code to be verified is identical to at least one identity identification code among all the identity identification codes, increment the current first identity identification code to be verified by one to obtain a new current first identity identification code to be verified;
[0159] The first execution module is configured to repeatedly execute the first comparison step and, if the current first identity identification code to be verified is different from all the identity identification codes, execute the first assignment step, or, if the current first identity identification code to be verified is the same as at least one of all the identity identification codes, increment the current first identity identification code to be verified by one to obtain a new current first identity identification code to be verified, until all volumes in the volume group are mapped to the identity identification codes corresponding to the computer system interfaces of all the hosts in the host group.
[0160] In one embodiment, it further includes:
[0161] A first recording module is used to record, for each volume, the corresponding relationship between the volume group, the volume, the host group and the identification code;
[0162] The first storage module is used to store all recorded correspondences among volume groups, volumes, host groups and identification codes in each host of the host group.
[0163] In one embodiment, it further includes:
[0164] The first judgment module is used to judge whether there is a host that has joined other host groups among the hosts in the host group to be mapped;
[0165] A third determining module is configured to determine the first target host and other host groups that have joined other host groups if there are hosts that have joined other host groups among the hosts in the host group to be mapped;
[0166] A fourth determining module, configured to determine target volume groups mapped to other host groups;
[0167] A first acquisition module is used to acquire, for a current target volume in a target volume group, an identification code that is mapped to another host group by the current target volume;
[0168] a fifth determining module configured to, if the first target host has not mapped the target volume group, obtain, for each target volume in the target volume group, an identity identification code corresponding to a computer system interface of another host in another host group that the target volume is mapped to, and use the identity identification code as an identity identification code corresponding to the computer system interface of the first target host that the target volume is mapped to;
[0169] The second recording module is used to record the corresponding relationship between the target volume group, the target volume, other host groups, the first target host and the corresponding identity code;
[0170] The second storage module is used to store all recorded correspondences among target volume groups, target volumes, other host groups, the first target host and the identification codes corresponding to the target volumes in the first target host.
[0171] In one embodiment, it further includes:
[0172] The second judgment module is used to judge whether there is a host with a single volume mapped among the hosts in the host group to be mapped;
[0173] a sixth determining module, configured to determine a second target host and a corresponding target volume mapped to the single volume if a host mapped to the single volume exists;
[0174] a seventh determination module, configured to determine a current second identity identification code to be verified and perform a second comparison step; the second comparison step comprising: comparing the current second identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current second identity identification code to be verified is within a preset identity identification code range;
[0175] an eighth determining module, configured to execute a second assigning step if the current second identity identification code to be verified is different from all identity identification codes; the second assigning step comprising: assigning the current second identity identification code to be verified to the target volume as the identity identification code corresponding to the computer system interface of the second target host mapped to the target volume;
[0176] A fourth returning module is configured to, when the current second identity identification code to be verified is identical to at least one of all the identity identification codes, increment the current second identity identification code to be verified by one to obtain a new current second identity identification code to be verified;
[0177] a second execution module, configured to repeatedly perform the second comparison step and, if the current second identity identification code to be verified is different from all the identity identification codes, perform the second assignment step, or, if the current second identity identification code to be verified is the same as at least one of all the identity identification codes, increment the current second identity identification code to be verified by one to obtain a new current second identity identification code to be verified, until the identity identification code corresponding to the computer system interface of the second target host mapped to the target single volume is determined;
[0178] The third storage module is used to record the correspondence between the target volume, the host group, the second target host and the identity code, and store the correspondence between the target volume, the host group, the second target host and the identity code in the second target host.
[0179] In one embodiment, it further includes:
[0180] A ninth determining module, configured to, upon detecting a host joining request, determine a host to be joined and a target host group to be joined according to the host joining request;
[0181] The second acquisition module is used to obtain the identity identification codes corresponding to the computer system interfaces mapped by the host to be added;
[0182] The third acquisition module is used to obtain the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group to be added;
[0183] The second comparison module is used to compare the identity identification codes corresponding to the computer system interfaces mapped to the host to be added with the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group to be added;
[0184] a joining module for adding the host to be added to the target host group to be added, if the identity identification codes corresponding to the respective computer system interfaces mapped to the host to be added are different from the identity identification codes corresponding to the respective computer system interfaces of all volume groups mapped to the target host group to be added;
[0185] The fourth storage module is used to record the correspondence between the target host group, volume group, volume, host to be added and corresponding identity identification code for each volume group of the target host group and each volume in each volume group, and store the recorded correspondence between the target host group, volume group, volume, host to be added and corresponding identity identification code in the host to be added.
[0186] In one embodiment, it further includes:
[0187] The prompt module is used to refuse the host to be added from being added to the target host group and return a prompt for refusing to add when at least one identity identification code corresponding to each computer system interface mapped to the host to be added is the same as the identity identification code corresponding to each computer system interface of all volume groups mapped to the target host group to be added.
[0188] It should be noted that the management device for the identity identification code of the computer system interface provided in the embodiment of the present invention has the same beneficial effects as the management method for the identity identification code of the computer system interface provided in the above embodiment, and for the specific introduction to the management method for the identity identification code of the computer system interface involved in the embodiment of the present invention, please refer to the above embodiment, and the present invention will not repeat it here.
[0189] The above-mentioned device for managing the identity code of the computer system interface is described from the perspective of a functional module. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Figure 10 A structural diagram of an electronic device provided by an embodiment of the present invention, such as Figure 10 As shown, the electronic equipment includes:
[0190] Memory 20, for storing computer programs;
[0191] The processor 21 is configured to implement the steps of the method for managing the identity code of the computer system interface of the above embodiment when executing a computer program.
[0192] The electronic device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0193] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0194] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In some embodiments, the memory 20 may be an internal storage unit of an electronic device, such as a hard disk of a server. In other embodiments, the memory 20 may also be an external storage device of an electronic device, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Furthermore, the memory 20 may also include both an internal storage unit of an electronic device and an external storage device. The memory 20 can not only be used to store application software installed in the electronic device and various types of data, such as the code of the program in the process of executing the method for managing the identity identification code of the computer system interface, but can also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 20 is used to store at least the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the method for managing the identity identification code of the computer system interface disclosed in any of the aforementioned embodiments. In addition, the resources stored in memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent. Operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include, but is not limited to, a set offset (data corresponding to the management result of the identity code of the computer system interface).
[0195] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26. Among them, the display screen 22 and the input / output interface 23, such as a keyboard, are user interfaces, and the optional user interface may also include a standard wired interface, a wireless interface, and the like. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, and the like. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface. The communication interface 24 may optionally include a wired interface and / or a wireless interface, such as a WI-FI interface, a Bluetooth interface, and the like, which are generally used to establish a communication connection between the electronic device and other electronic devices. The communication bus 26 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, and the like. The bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Figure 10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0196] Those skilled in the art will understand that Figure 10 The structure shown in the figure does not limit the electronic device and may include more or fewer components than shown in the figure.
[0197] It is understandable that if the method for managing the identity code of the computer system interface in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium and executes all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0198] Based on this, Figure 11As shown, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program 31 is stored. When the computer program 31 is executed by a processor, the steps of the method for managing the identity identification code of the computer system interface as described above are implemented.
[0199] Based on the above embodiment, an embodiment of the present invention further provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method for managing the identity identification code of the computer system interface as described above.
[0200] The above describes in detail the method, device, electronic device, and computer-readable storage medium for managing the identity code of a computer system interface provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to in conjunction with 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 section.
[0201] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0202] The above is a detailed introduction to the management method, device, electronic device and computer-readable storage medium for the identity identification code of a computer system interface provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for managing the identity code of a computer system interface, characterized in that: include: Determine the host group and volume group to be mapped; For the current volume in the volume group, performing a first comparison step; The first comparison step includes: comparing the current first identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current first identity identification code to be verified is within a preset identity identification code range; When the current first identity identification code to be verified is different from all the identity identification codes, a first assignment step is performed; the first assignment step includes: assigning the current first identity identification code to be verified to the current volume as identity identification codes corresponding to the computer system interfaces of all hosts in the host group mapped to the current volume; wherein the host generates a corresponding computer system interface for each volume mapped to the host; Repeat the following steps: using the next volume in the volume group as the current volume, updating the current first identity identification code to be verified, and executing the first comparison step; and executing the first assignment step if the current first identity identification code to be verified is different from all the identity identification codes; until it is determined that all volumes in the volume group are respectively mapped to the identity identification codes corresponding to the respective computer system interfaces of all hosts in the host group.
2. The method for managing the identity code of a computer system interface according to claim 1, characterized in that: Also includes: If the current first identity identification code to be verified is identical to at least one of all the identity identification codes, incrementing the current first identity identification code to be verified by one to obtain a new current first identity identification code to be verified; Repeating the first comparison step and executing the first assignment step if the current first identity identification code to be verified is different from all the identity identification codes; or if the current first identity identification code to be verified is the same as at least one of all the identity identification codes, incrementing the current first identity identification code to be verified by one to obtain a new current first identity identification code to be verified; until it is determined that all volumes in the volume group are respectively mapped to the identity identification codes corresponding to the computer system interfaces of all hosts in the host group.
3. The method for managing the identity code of a computer system interface according to claim 2, characterized in that: After determining that all volumes in the volume group are respectively mapped to identity identification codes corresponding to computer system interfaces of all hosts in the host group, the method further includes: For each volume, record the correspondence between the volume group, the volume, the host group, and the identity code; All recorded correspondences among the volume group, the volume, the host group, and the identification code are stored in each host of the host group.
4. The method for managing the identity code of a computer system interface according to claim 3, characterized in that: Also includes: Determine whether there is a host that has joined other host groups among the hosts in the host group to be mapped; If there is a host that has joined other host groups among the hosts in the host group to be mapped, determining the first target host that has joined other host groups and other host groups; Determine the target volume group mapped by the other host group; If the first target host is not mapped to the target volume group, obtaining, for each target volume in the target volume group, an identity code corresponding to a computer system interface of another host in the other host group that the target volume is mapped to, and using the identity code as an identity code corresponding to the computer system interface of the first target host that the target volume is mapped to; Record the correspondence between the target volume group, target volume, other host groups, the first target host, and the corresponding identification code; All recorded correspondences among target volume groups, target volumes, other host groups, the first target host, and the identification codes corresponding to the target volumes are stored in the first target host.
5. The method for managing the identity code of a computer system interface according to claim 3, characterized in that: Also includes: Determine whether there is a host mapping a single volume among the hosts in the host group to be mapped; If there is a host mapped to the single volume, determining a second target host mapped to the single volume and the corresponding target single volume; Determine the current second identity identification code to be verified, and perform a second comparison step; The second comparison step includes: comparing the current second identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current second identity identification code to be verified is within the preset identity identification code range; If the current second identity identification code to be verified is different from all the identity identification codes, a second assignment step is performed; the second assignment step includes: assigning the current second identity identification code to be verified to the target volume as the identity identification code corresponding to the computer system interface of the target volume mapped to the second target host; If the current second identity identification code to be verified is identical to at least one of all the identity identification codes, adding one to the current second identity identification code to be verified to obtain a new current second identity identification code to be verified; Repeating the second comparing step and, if the current second identity identification code to be verified is different from all the identity identification codes, performing the second assigning step, or, if the current second identity identification code to be verified is the same as at least one of all the identity identification codes, incrementing the current second identity identification code to be verified by one to obtain a new current second identity identification code to be verified; until the identity identification code corresponding to the computer system interface of the second target host mapped to the target single volume is determined; The correspondence between the target volume, the host group, the second target host and the identity code is recorded, and the correspondence between the target volume, the host group, the second target host and the identity code is stored in the second target host.
6. The method for managing the identity code of a computer system interface according to any one of claims 2 to 5, characterized in that: Also includes: When a host joining request is detected, determining a host to be joined and a target host group to be joined according to the host joining request; Obtaining the identity identification codes corresponding to the respective computer system interfaces mapped to the host to be added; Obtaining the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group; Comparing the identity identification codes corresponding to the computer system interfaces mapped to the host to be added with the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group; If the identity identification codes corresponding to the computer system interfaces mapped to the host to be added are different from the identity identification codes corresponding to the computer system interfaces of all volume groups mapped to the target host group to be added, adding the host to be added to the target host group to be added; For each volume group of the target host group and each volume in each volume group, the correspondence between the target host group, volume group, volume, host to be added and the corresponding identity identification code is recorded, and the recorded correspondence between the target host group, volume group, volume, host to be added and the corresponding identity identification code is stored in the host to be added.
7. The method for managing the identity code of a computer system interface according to claim 6, characterized in that: Also includes: If the identity identification codes corresponding to the respective computer system interfaces mapped to the host to be added are identical to at least one of the identity identification codes corresponding to the respective computer system interfaces of all volume groups mapped to the target host group to be added, the host to be added is refused to be added to the target host group, and a prompt for refusing to add is returned.
8. A device for managing identity codes of computer system interfaces, characterized in that: include: A first determining module is used to determine the host group and volume group to be mapped; A first comparison module, configured to perform a first comparison step on a current volume in the volume group; The first comparison step includes: comparing the current first identity identification code to be verified with the identity identification codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current first identity identification code to be verified is within a preset identity identification code range; a second determining module configured to execute a first assigning step if the current first identity identification code to be verified is different from all the identity identification codes; the first assigning step comprising: assigning the current first identity identification code to be verified to the current volume as identity identification codes corresponding to the computer system interfaces of all hosts in the host group mapped to the current volume; wherein the host generates a corresponding computer system interface for each volume mapped to the host; The first return module is configured to take the next volume in the volume group as the current volume, update the current first identity identification code to be verified, and trigger the first comparison module and the second determination module until it is determined that all volumes in the volume group are respectively mapped to the identity identification codes corresponding to the respective computer system interfaces of all hosts in the host group.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the method for managing the identity identification code of a computer system interface as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for managing the identity identification code of the computer system interface according to any one of claims 1 to 7.
Citation Information
Patent Citations
Apparatus, system, and method for booting using an external disk through a virtual scsi connection
CN101206581A
Volume mapping method and device of distributed block storage system based on iSCSI
CN112269539A