Method, device and equipment for managing identification code of computer system interface and medium
By gradually comparing and allocating unique identity codes in a multi-controller storage system, the problem of inefficient identity code management in the prior art is solved, efficient and accurate management is achieved, and applicable to various scenarios.
Patent Information
- Application Number
- CN202411980124.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-29
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-29
AI Technical Summary
The prior art is difficult to efficiently and accurately manage the identity identification code of the computer system interface, especially in multi-controller storage systems, which can easily lead to identity identification code conflicts and inefficient management.
By determining the host group and volume group to be mapped, the unique identity code is gradually compared and allocated to ensure that the identity code of each volume in the host group does not conflict, and the corresponding relationship is stored in each host of the host group.
It realizes efficient and accurate management of identity identification codes, ensuring that each volume has a unique identity identification code in the host group, which is suitable for a variety of scenarios, meets user needs, and improves management efficiency and accuracy.
Smart Images

Figure CN119902999A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic equipment and computer-readable storage medium for managing identity 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 the hosts. Alternatively, users create volume groups in the storage system and add the volumes to be used to a volume group. Multiple hosts on the host side are clustered to form a host group, and the volume group is mapped to the host group. The mapping diagram is shown in the figure below. Figure 1 shown.
[0003] The volume mapped by the host will generate a SCSI (Small Computer System Interface) device on the host side. A host can map multiple volumes, and multiple SCSI devices will be generated on the host side. Each SCSI device is assigned a SCSI ID (Identity documen). Therefore, how to allocate and manage the mapped SCSIID is a problem that those skilled in the art need to solve. 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 a computer system interface, which can achieve efficient and accurate management of identity identification codes, and is not limited to application scenarios, and can better meet user needs.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a method for managing an identity code of a computer system interface, 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] The first assignment step is performed when the current first identity identification code to be verified is different from all the 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; wherein the host generates a corresponding computer system interface for each volume mapped to the host;
[0009] Repeat the following steps: take the next volume in the volume group as the current volume, update the current first identity identification code to be verified, and execute the first comparison step, and execute 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 computer system interfaces of all hosts in the host group.
[0010] In one embodiment, it also includes:
[0011] If the current first identity identification code to be verified is the same as at least one of all the identity identification codes, adding one to the current first identity identification code to be verified to obtain a new current first identity identification code to be verified;
[0012] Repeat the first comparison step, and when the current first identity identification code to be verified is different from all the identity identification codes, perform the first assignment step, or when 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 be verified 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 the hosts in the host group.
[0013] In one embodiment, after determining that all volumes in the volume group are respectively mapped to the identity 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] The correspondence between all recorded volume groups, volumes, host groups and identification codes is stored in each host of the host group.
[0016] In one embodiment, it also includes:
[0017] Determine whether there is a host that has joined other host groups among the hosts in the host group to be mapped;
[0018] If there is a host that has joined other host groups among the hosts in the host group to be mapped, determine the first target host that has joined other host groups and other host groups;
[0019] Determine the target volume group that has been mapped by other host groups;
[0020] In the case that 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 other hosts in other host groups that the target volume is mapped to, and using the identity code as an identity code corresponding to a computer system interface of the first target host that the target volume is mapped to;
[0021] Record the correspondence between the target volume group, the target volume, other host groups, the first target host and the corresponding identity 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 also includes:
[0024] Determine whether there is a host mapping a single volume among the hosts in the host group to be mapped;
[0025] If there is a host mapped to the single volume, determine a second target host mapped to the single volume and a corresponding target single volume;
[0026] 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 a preset identity identification code range;
[0027] The second assignment step is performed when the current second identity identification code to be verified is different from all the identity identification codes; 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 target single volume mapped to the second target host;
[0028] When 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] Repeat 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, add one to the current second identity identification code to be verified 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 target single volume mapped to the second target host is determined;
[0030] The correspondence between the target single volume, the host group, the second target host and the identity code is recorded, and the correspondence between the target single volume, the host group, the second target host and the identity code is stored in the second target host.
[0031] In one embodiment, it also 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 codes corresponding to the computer system interfaces mapped by 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 codes corresponding to the computer system interfaces mapped by the host to be added with the identity codes corresponding to the computer system interfaces of all volume groups mapped by the target host group;
[0036] When the identity identification codes respectively corresponding to the computer system interfaces mapped by the host to be added are different from the identity identification codes respectively corresponding to the computer system interfaces of all volume groups mapped by 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 code is recorded, and the recorded correspondence between the target host group, volume group, volume, host to be added and the corresponding identity code is stored in the host to be added.
[0038] In one embodiment, it also includes:
[0039] If the identity identification codes corresponding to the computer system interfaces mapped by 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 by 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 aspect of the present invention provides a device for managing an identity code of a computer system interface, comprising:
[0041] A first determination module, used to determine the host group and volume group to be mapped;
[0042] A first comparison module is used to perform a first comparison step for the 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 determined from a preset identity identification code range;
[0043] The second determination module is used to execute the first assignment step when the current first identity identification code to be verified is different from all the 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 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 respectively mapped to the identity codes corresponding to the computer system interfaces of all hosts in the host group.
[0045] Another aspect of the present invention provides an electronic device, including:
[0046] Memory for storing computer programs;
[0047] The processor is used to execute a computer program to implement the steps of the method for managing the identity code of the computer system interface as described above.
[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 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 a volume group to be mapped, a current first identity identification code to be verified that is 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 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 identity identification codes, it means that there is no conflict between the current first identity identification code to be verified and 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 repeatedly performed to determine the identity identification codes corresponding to the computer system interfaces of all hosts in the host group mapped to all volumes in the volume group. The present invention can automatically generate an identity code uniquely corresponding to a host group and a volume in a volume group, 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, is conducive to better meeting user needs, and has efficient and accurate management.
[0051] In addition, the present invention also provides a corresponding implementation device, electronic device and computer-readable storage medium for the management method of the identity identification code of the computer system interface, which further makes the method more practical, and the device, electronic device and computer-readable storage medium have corresponding advantages. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces 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 paying 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 an identity code 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 an identity code of a computer system interface provided by an embodiment of the present invention;
[0057] Figure 5 A flow chart 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] Fig. 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] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0063] Fig.11 A schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0066] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0067] It should be noted that storage systems are usually multi-controller systems. Multiple controllers form a cluster to provide services to the outside world. When one controller fails, the remaining controllers can still provide services. Hosts connected to the storage system and providing services to customers can provide services individually or in a cluster. For example, a group of servers can provide resources to customers as a whole. When a node (a single server) that provides resources to the outside world fails, the remaining nodes in the cluster can take over the resources and continue to provide resources to customers.
[0068] Customers usually create LUNs (Logical Unit Numbers) in the storage system and then map the LUNs to the host. Some users create volume groups in the storage system, add the volumes to be used to a volume group, create a cluster of multiple hosts on the host side, and map the volume group to the host cluster. The volumes mapped by the host will generate SCSI devices on the host side. A host can map multiple volumes, and multiple SCSI devices will be generated on the host side. SCSI IDs are usually used to identify SCSI devices. Each device in the 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, such as restricting hosts in a host group from mapping other single volumes (that is, volumes that are not added to a 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 one of the SCSI IDs 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 can no longer map single volume LUN0; host host3 is already in the host group, so host host3 can no longer join other host groups; host host0 can not map LUN groups. This restriction method makes it easy to manage SCSI IDs, that is, SCSI IDs only need to be generated linearly. For example, the SCSI IDs mapped between host Host0 and each single volume LUN0, LUN1, LUN2, LUN3, LUN4, and LUN5 are detailed in Table 1 below:
[0071] Table 1 SCSI IDs for host and volume mapping
[0072]
[0073] The mapping type between the host and each volume in Table 1 is private mapping.
[0074] The SCSI ID details of the host group and volume group mapping are shown in Table 2 below:
[0075] Table 2 SCSI IDs mapped between host groups and volume groups
[0076]
[0077] In Table 2, the host group includes host Host0 and host Host1, the volume group includes LUN0, LUN1 and LUN2, and the mapping type is shared mapping (ie, Shared mapping).
[0078] Related technical solutions restrict the mapping between hosts and volumes. For example, one restriction is that after a host joins a host group, it cannot map other single volumes again. For customers with insufficient host resources, this restriction will limit the full utilization of resources by customers. Another restriction is that a host cannot join multiple host groups, which will also limit the reuse of host resources. Another restriction is that a host cannot map a LUN group, which is very unfriendly to customers with limited host resources or customers who want to manage LUNs in a unified manner. The current mapping types and scenarios are relatively simple. With more and more hosts supporting SCSI devices, the current management method cannot be applied to multiple scenarios and is difficult 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 the 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 understandable that after determining the volume group, the first volume in the volume group can be used as the current volume, and then the identity identification codes SCSI IDs of all computer system interfaces mapped to each host in the host group are obtained, and then the current first identity identification code to be verified is compared with the SCSI IDs of all hosts in the host group. In practical applications, for each new mapping request, the current first identity identification code to be verified can be verified starting from the minimum preset identity identification code in the preset identity identification code range, for example, starting from 1. In the processing process of each volume group corresponding to the host group, the first current first identity identification code to be verified can be the same or different.
[0084] S130: When 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 by all hosts in the host group, and 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 corresponds to an identity identification code, which 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 by 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: take 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 determined the corresponding identity identification codes. If not, the next volume in the volume group whose identity identification code has not been determined is determined as the current volume. In practical applications, the 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 be verified, so as to obtain the updated current first identity identification code to be verified, and steps S120 to S140 are repeated until each volume in the volume group has determined the identity identification code of the SCSI mapped to each host in the host group, so as to obtain 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 from a volume in the volume group to each host in the host group is the same.
[0089] During the implementation of the present invention, the mapping type of the host group is not limited. 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 allocated to the host group when mapping each volume in the volume group. This is applicable to more scenarios and helps to better meet user needs.
[0090] 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 updating the current first identity identification code, the above comparison process and assignment process are repeatedly performed to determine the identity identification codes corresponding to the computer system interfaces of all hosts in the host group mapped to all volumes in the volume group. The present invention can automatically generate an identity code uniquely corresponding to a host group and a volume in a volume group, 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, is conducive to better meeting user needs, and has efficient and accurate management.
[0091] Based on the above embodiments, the embodiments of the present invention further illustrate and introduce the technical solution. Figure 3 , Figure 3 A flowchart of another method for managing an identity code 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: When 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: take the next volume in the volume group as the current volume, and add 1 to the current first identity code to be verified to obtain a new current first identity code to be verified, and execute steps S220 to S240; until it is determined that all volumes in the volume group are respectively 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 be repeated here.
[0098] S260: When the current first identity identification code to be verified is the same as 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, by adding one 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 identification code to be verified is used as the new current first identification code to be verified, and return 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 obtained, a host is obtained from the host group (starting from the first host), all SCSI IDs mapped by the host are determined, and then it is determined 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 there is no SCSI ID consistent with the current first identity code to be verified among all the SCSI IDs mapped by the host, it can be determined whether there are other hosts in the host group that have not been compared. If there are, then all the SCSI IDs mapped by the next host are further obtained, and these SCSI IDs are compared with the current first SCSI ID to be verified. If it is still not occupied, then all the SCSI IDs allocated by the next host are continuously obtained until all the SCSI IDs allocated by all the hosts in the host group are compared, and it is determined that no allocated SCSI ID is consistent with the current first SCSI ID to be verified, which means that the current first SCSI ID to be verified is not occupied (that is, 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 from the current volume in the volume group to the host group. Then continue to traverse the next volume in the volume group until all volumes are traversed.
[0101] In one embodiment, after determining that all volumes in the volume group are respectively mapped to the identity 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] The correspondence between all recorded volume groups, volumes, host groups and identification codes is stored in each host of the host group.
[0104] It should be noted that after obtaining the SCSI IDs of the current volumes in the volume group mapped to the identification codes of all hosts in the host group, the corresponding relationship between the volume group, volume, host group and identification code can be further recorded. Specifically, this information can be stored in the SCSI ID list corresponding to the host group. After obtaining the identification codes of all volumes in the volume group mapped to all hosts in the host group, the SCSIID 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 to 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., the mapping corresponding to the volume group), the SCSI IDs of all volumes in the volume group mapped to the host group can be obtained, and the host member mapping in the host group can be added from the first volume in the volume group. After all hosts in the host group are added for the volume, the SCSI IDs corresponding to all hosts in the host group mapped to the volume are stored in the volume and in the corresponding hosts. Then the next volume in the volume group is obtained, and the above process is repeated until all the mappings corresponding to the volumes are added.
[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 by all hosts in the host group are the same. Figure 6 As shown, all hosts in host group 0 have mapped the 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], host2[1,2,3]. If host group 0[host0,host1,host2] maps a new volume group (such as LUN group 1), and the volume group has three member volumes, the new SCSI ID allocated to the host group is [4,5,6], and the SCSI ID list of each host is host0[1,2,3,4,5,6], host1[1,2,3,4,5,6], host2[1,2,3,4,5,6]. Of course, if host group 0[host0,host1,host2] maps a new volume group, and the volume group has three member volumes, the new SCSI ID allocated to the host group is [7,8,9].
[0107] In order to further meet the user's usage requirements in multiple scenarios in the embodiment of the present invention, the method may further include:
[0108] Determine whether there is a host that has joined other host groups among the hosts in the host group to be mapped;
[0109] If there is a host that has joined other host groups among the hosts in the host group to be mapped, determine the first target host that has joined other host groups and other host groups;
[0110] Determine the target volume group that has been mapped by other host groups;
[0111] In the case that 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 other hosts in other host groups that the target volume is mapped to, and using the identity code as an identity code corresponding to a computer system interface of the first target host that the target volume is mapped to;
[0112] Record the correspondence between the target volume group, the target volume, other host groups, the first target host and the corresponding identity 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 added to another host group 1, then 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), and the SCSI ID of LUN3 in the target volume group is mapped to host group 1 is 4, the SCSI ID of LUN4 in the target volume group is mapped to host group 1 is 5, and the SCSI ID of LUN5 in the target volume group is mapped to host group 1 is 6. It can be determined by obtaining the SCSI ID list stored in 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 is 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 ID of the host host0 in host group 1. 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 correspondence between the target volume group (LUN group 1), volume LUN3, host group 1, host host0, 4, the correspondence between the target volume group (LUN group 1), volume LUN4, host group 1, host host0, 5, and the correspondence between the target volume group (LUN group 1), volume LUN5, host group 1, host host0, 6. The method provided in the embodiment of the present invention can further verify whether there is a host group that misses 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 group of different host groups to the host, which is conducive to better meeting the user's use requirements.
[0115] In one embodiment, in order to further meet the user's usage requirements in multiple scenarios, the method may further include:
[0116] Determine whether there is a host mapping a single volume among the hosts in the host group to be mapped;
[0117] If there is a host mapped to the single volume, determine a second target host mapped to the single volume and a corresponding target single volume;
[0118] Determine the current second identity code to be verified, and perform a second comparison step; the second comparison step includes: comparing the current second identity code to be verified with the identity codes corresponding to all computer system interfaces mapped to each host in the host group; wherein the current second identity code to be verified is within a preset identity code range;
[0119] The second assignment step is performed when the current second identity identification code to be verified is different from all the identity identification codes; the second assignment step includes: assigning the current second identity identification code to be verified to the target single volume as the identity identification code corresponding to the computer system interface of the target single 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, adding one to the current second identity identification code to be verified to obtain a new current second identity identification code to be verified;
[0121] Repeat 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, add one to the current second identity identification code to be verified 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 target single volume mapped to the second target host is determined;
[0122] The correspondence between the target single volume, the host group, the second target host and the identity code is recorded, and the correspondence between the target single 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. In order to avoid SCSI ID conflicts, the current second identity identification code to be verified can be determined. The current second identity identification code to be verified can start from the minimum preset identity identification code, or the largest SCSI ID can be determined from all SCSI IDs mapped by all hosts in the host group, and then the largest SCSI ID plus one is used as the current second identity identification code to be verified. Of course, all the current second identity identification codes to be verified are within the preset identity identification code range. In the case that the current second identity identification code to be verified is not the same as all SCSI IDs mapped by each host in the host group, the current second identity identification code to be verified is determined as the identity identification code of the target single volume mapped 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 identification code is recorded, and the corresponding relationship is stored in the second target host. When the current second identity identification code to be verified is identical to at least one of all the identity identification codes, it indicates that there is a conflict between the current second identity identification code to be verified and the assigned identity identification code. In this case, the current second identity identification code to be verified may be increased by one to obtain a new current second identity identification code to be verified, and the process returns to the step of comparing the current identity identification code to be verified with the identity identification codes corresponding to all the computer system interfaces mapped to each host in the host group, and when the current second identity identification code to be verified is different from all the identity identification codes, the current second identity identification code to be verified is assigned to the target volume as the identity identification code corresponding to the computer system interface mapped from the target volume to the second target host, until the identity identification code (i.e., SCSI ID) corresponding to the computer system interface mapped from the target volume to the second target host is determined, and the corresponding relationship between the target volume, the host group, the second target host, and the identity identification code is stored in the second target host, thereby completing the mapping from the target volume to the second target host.
[0124] For example, 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], host2[1,2,3]. Host host1 in the host group maps single volume LUN3, and host host2 in the host group maps single volume LUN4, then the SCSI ID list of 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, in order to further meet the user's usage requirements in multiple scenarios, 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 codes corresponding to the computer system interfaces mapped by 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 by the host to be added with the identity identification codes corresponding to the computer system interfaces of all volume groups mapped by the target host group to be added;
[0131] When the identity identification codes respectively corresponding to the computer system interfaces mapped by the host to be added are different from the identity identification codes respectively corresponding to the computer system interfaces of all volume groups mapped by 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 code, and store each recorded correspondence between the target host group, volume group, volume, host to be added and the corresponding identity code in the host to be added;
[0133] If the identity identification codes corresponding to the computer system interfaces mapped by 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 by 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 the embodiment of the present invention, when a user needs to add a certain host to a specified host group, a host joining request can be initiated, and 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 according to the host joining request. All shared mappings of the host group to be added are obtained, and the shared mapping includes 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 refused to join the target host group. If there is no identity identification code mapped by any of the target host groups 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 mapped to the target host group, the SCSI ID of volume LUN7 mapped to each host of the target host group is 8, the SCSI ID of volume LUN8 mapped to each host of the target host group is 9, and the SCSI ID of volume LUN9 mapped to each host of 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 corresponding relationship between the target host group, volume group, volume, host to be added and the corresponding identity code can be recorded, and the corresponding relationship between each recorded target host group, volume group, volume, host to be added and the corresponding identity code is 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, Figure 7As shown, (1) obtain all shared mappings of the host group to be added, and temporarily store all mappings in the shared_map_scsi_id array; (2) starting from the first shared_map_scsi_id[0] recorded, traverse all mappings of the target host to find whether there is a mapping scsi_id equal to shared_map_scsi_id[0]. If it is found, it means a conflict. If it is not found after traversing all mappings of the target host, it means 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 is not allowed, and the host is not allowed to be added to the host group; (4) If there is no conflict, it is allowed to be added, 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 List of SCSI IDs 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 to be released and the volume group to be released according to the release mapping request;
[0144] Determine the identification 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 embodiments 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 a volume group, the user can input a release request, and the release request can include the identification information of the host group to be released and the identification information of the volume group to be released, so that 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 according to all SCSI IDs mapped to the host group to be released, and then these SCSI IDs are deleted from each host of the host group to be released, and all SCSI IDs corresponding to the host group to be released can also be deleted in 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 ID is 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 while supporting mixed mapping scenarios such as mapping between volumes and hosts, volume groups and host groups, hosts joining multiple host groups, hosts in a host group mapping another single volume, and hosts mapping volume groups, which can better meet the diverse needs of different users and greatly improve ease of use.
[0149] It should also be noted that if the SCSI IDs occupied by different hosts in the host group are very different, the host group may not be able to find a valid SCSI ID when mapping the volume group again, which indirectly affects the overall specifications. Assuming that a single host maps 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 time, the SCSIID has been indirectly occupied, and there is no valid SCSI ID available for the host group to map the volume group. Therefore, in order to ensure the effectiveness and accuracy of the SCSI ID allocation mapped to each host in the host group, in actual applications, the use scenario can be reasonably planned so as not to affect the use specifications while ensuring support for mixed mapping scenarios.
[0151] The present invention also provides a corresponding device for the management method of the identity identification code of the computer system interface, which further makes the method more practical. Among them, the device can be described from the perspective of the functional module and the perspective of the hardware. The following is an introduction to the management device of the identity identification code of the computer system interface provided by the present invention. The device is used to implement the management method of the identity identification code of the computer system interface provided by the present invention. In this embodiment, the management device of 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 management method of 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 management device of 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 management device of the identity identification code of the computer system interface described below and the management method of the identity identification code based on the computer system interface described above can be referred to each other.
[0152] From the perspective of functional modules, see Fig. 9 , Fig. 9 A structural diagram of a device for managing an identity code of a computer system interface provided by the present invention, the device may include:
[0153] A first determination module 11 is used to determine a host group and a volume group to be mapped;
[0154] The first comparison module 12 is used to perform a first comparison step for the 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;
[0155] The second determination module 13 is used to execute the first assignment step when the current first identity identification code to be verified is different from all the 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; 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 also includes:
[0158] A second returning module is used for, when the current first identity identification code to be verified is the same as at least one identity identification code among all the identity identification codes, adding one to the current first identity identification code to be verified to obtain a new current first identity identification code to be verified;
[0159] The first execution module is used to repeatedly execute the first comparison step, and execute the first assignment step when the current first identity identification code to be verified is different from all the identity identification codes, or when 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 be verified 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 the hosts in the host group.
[0160] In one embodiment, it also includes:
[0161] A first recording module, for recording, for each volume, a correspondence between a volume group, a volume, a host group, and an identity code;
[0162] The first storage module is used to store all recorded correspondences among volume groups, volumes, host groups and identity codes in each host of the host group.
[0163] In one embodiment, it also includes:
[0164] A 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 determination module is used 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 determination module is used to determine the target volume group mapped by other host groups;
[0167] A first acquisition module is used to acquire, for a current target volume in a target volume group, an identity code that is mapped to other host groups by the current target volume;
[0168] a fifth determination module, configured to obtain, for each target volume in the target volume group, an identity code corresponding to a computer system interface of other hosts in other host groups mapped with the target volume when the target volume group is not mapped to the first target host, and use the identity code as an identity code corresponding to a computer system interface of the first target host mapped with the target volume;
[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 the target volume group, the target volume, other host groups, the first target host and the identity code corresponding to the target volume in the first target host.
[0171] In one embodiment, it also includes:
[0172] The second judgment module is used to judge whether there is a host mapping a single volume among the hosts in the host group to be mapped;
[0173] a sixth determination module, configured to determine a second target host and a corresponding target single volume mapped to the single volume if a host mapped to the single volume exists;
[0174] The seventh determination module is used to 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 a preset identity identification code range;
[0175] an eighth determination module, configured to execute a second assignment step when the current second identity identification code to be verified is different from all identity identification codes; the second assignment step comprises: assigning the current second identity identification code to be verified to the target single volume as the identity identification code corresponding to the computer system interface of the target single volume mapped to the second target host;
[0176] a fourth returning module, configured to, when the current second identity identification code to be verified is identical to at least one of all the identity identification codes, add one to the current second identity identification code to be verified to obtain a new current second identity identification code to be verified;
[0177] a second execution module, configured to repeatedly execute the second comparison step and, if the current second identity identification code to be verified is different from all the identity identification codes, execute 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, add one to the current second identity identification code to be verified 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 target single volume mapped to the second target host is determined;
[0178] The third storage module is used to record the correspondence between the target single volume, the host group, the second target host and the identity code, and store the correspondence between the target single volume, the host group, the second target host and the identity code in the second target host.
[0179] In one embodiment, it also includes:
[0180] A ninth determination module, configured to determine a host to be added and a target host group to be added according to the host joining request when a host joining request is detected;
[0181] The second acquisition module is used to acquire the identity identification codes corresponding to the computer system interfaces mapped by the host to be added;
[0182] A third acquisition module is used to acquire the identity codes corresponding to the computer system interfaces of all volume groups mapped to the target host group to be added;
[0183] A second comparison module is used to compare the identity identification codes respectively corresponding to the computer system interfaces mapped by the host to be added with the identity identification codes respectively corresponding to the computer system interfaces of all volume groups mapped by the target host group to be added;
[0184] A joining module, used for adding the host to be added to the target host group to be added, when the identity identification codes respectively corresponding to the computer system interfaces mapped by the host to be added are different from the identity identification codes respectively corresponding to the computer system interfaces of all volume groups mapped by 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 the corresponding identity 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 the corresponding identity code in the host to be added.
[0186] In one embodiment, it also includes:
[0187] The prompt module is used to refuse the host to be added to join 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 by the host to be added is the same as the identity identification code corresponding to each computer system interface of all volume groups mapped by 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-mentioned embodiment, and for the specific introduction of 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-mentioned embodiment, and the present invention will not be repeated here.
[0189] The above-mentioned management device for the identity code of the computer system interface is described from the perspective of functional modules. Furthermore, the present invention also provides an electronic device, which is described from the perspective of hardware. Fig.10 A structural diagram of an electronic device provided by an embodiment of the present invention, such as Fig.10 As shown, the electronic equipment includes:
[0190] A memory 20, for storing computer programs;
[0191] The processor 21 is used to implement the steps of the method for managing the identity code of the computer system interface of the above embodiment when executing the 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 a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. The memory 20 may be an internal storage unit of an electronic device in some embodiments, such as a hard disk of a server. The memory 20 may also be an external storage device of an electronic device in other embodiments, such as a plug-in hard disk equipped on a server, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. Further, the memory 20 may also include both an internal storage unit of an electronic device and an external storage device. The memory 20 may not only be used to store application software and various types of data installed in the electronic device, such as: the code of the program in the process of executing the management method of the identity identification code of the computer system interface, but also may be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, the relevant steps of the management method of the identity identification code of the computer system interface disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The 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), etc.
[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, belong to the user interface, 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, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0196] Those skilled in the art will understand that Fig.10 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure.
[0197] It is understandable that if the management method of 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 such an understanding, the technical solution of the present invention is essentially 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 to execute 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 and other media that can store program codes.
[0198] Based on this, Fig.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 embodiments, 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 is a detailed introduction to a method, device, electronic device and computer-readable storage medium for managing an 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 each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[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 composition and steps of each example have been generally described in the above description according to function. 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 to be 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, several improvements and modifications can be made to the present invention, 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; In the case where the current first identity code to be verified is different from all the identity codes, a first assignment step is performed; the first assignment step includes: assigning the current first identity code to be verified to the current volume 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; Repeat the following steps: take the next volume in the volume group as the current volume, update the current first identity identification code to be verified, and execute the first comparison step, and execute the first assignment step when 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 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: In the case where the current first identity identification code to be verified is the same as at least one of all the identity identification codes, adding one to the current first identity identification code to be verified to obtain a new current first identity identification code to be verified; Repeat the first comparison step, and perform the first assignment step when the current first identity identification code to be verified is different from all the identity identification codes; or when 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 be verified 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 the identity codes corresponding to the 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, determine 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; In the case that 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 other hosts in the other host group mapped to the target volume, and using the identity code as an identity code corresponding to a computer system interface of the first target host mapped to the target volume; Record the correspondence between the target volume group, the target volume, other host groups, the first target host and the corresponding identity code; The correspondence between all recorded target volume groups, target volumes, other host groups, the first target host and the identification codes corresponding to the target volumes is 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, determine a second target host mapped to the single volume and a 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; When the current second identity code to be verified is different from all the identity codes, a second assignment step is performed; the second assignment step includes: assigning the current second identity code to be verified to the target single volume as the identity code corresponding to the computer system interface of the target single volume mapped to the second target host; In the case where 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 comparison step and performing the second assignment step when the current second identity identification code to be verified is different from all the identity identification codes, or when the current second identity identification code to be verified is the same as 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; until the identity identification code corresponding to the computer system interface of the target single volume mapped to the second target host is determined; The correspondence between the target single volume, the host group, the second target host and the identity code is recorded, and the correspondence between the target single 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: In the case where 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 codes corresponding to the computer system interfaces mapped by the host to be added; Obtaining the identity codes corresponding to the computer system interfaces of all volume groups mapped to the target host group; Compare the identity identification codes corresponding to the computer system interfaces mapped by the host to be added with the identity identification codes corresponding to the computer system interfaces of all volume groups mapped by the target host group; When the identity identification codes respectively corresponding to the computer system interfaces mapped by the host to be added are different from the identity identification codes respectively corresponding to the computer system interfaces of all volume groups mapped by 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 code is recorded, and the recorded correspondence between the target host group, volume group, volume, host to be added and the corresponding identity 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 respectively corresponding to the computer system interfaces mapped by the host to be added are the same as at least one of the identity identification codes respectively corresponding to the computer system interfaces of all volume groups mapped by 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 determination module, 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; The second determining module is used to perform a first assignment step when the current first identity identification code to be verified is different from all the 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; 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 respectively mapped to the identity identification codes corresponding to the 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 code of the 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 code of the computer system interface as claimed in 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
Information processor, method for evading duplication of scsi-id to be used for the processor, and recording medium recording its control program
JP2000112870A
Methods and apparatus for improving data integrity for small computer system interface (SCSI) devices
US20050246454A1
Using deterministic logical unit numbers to dynamically map data volumes
US20150134901A1