CN107220191A - A kind of storage device port configuration method and device - Google Patents

A kind of storage device port configuration method and device Download PDF

Info

Publication number
CN107220191A
CN107220191A CN201710391790.4A CN201710391790A CN107220191A CN 107220191 A CN107220191 A CN 107220191A CN 201710391790 A CN201710391790 A CN 201710391790A CN 107220191 A CN107220191 A CN 107220191A
Authority
CN
China
Prior art keywords
information
hba cards
storage device
hba
configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710391790.4A
Other languages
Chinese (zh)
Other versions
CN107220191B (en
Inventor
李大生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710391790.4A priority Critical patent/CN107220191B/en
Publication of CN107220191A publication Critical patent/CN107220191A/en
Application granted granted Critical
Publication of CN107220191B publication Critical patent/CN107220191B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • G06F13/102Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • G06F13/1694Configuration of memory controller to different memory types

Abstract

The invention discloses a kind of storage device port configuration method and device, this method includes:The information of the HBA cards in storage device is extracted using perl language;The information of HBA cards is matched with configuration file;If the match is successful, determine that HBA cards are supported by software, start initialization program to meet the normal running conditions of software.This method realizes flexible configuration port.

Description

A kind of storage device port configuration method and device
Technical field
The present invention relates to technical field of memory, more particularly to a kind of storage device port configuration method and device.
Background technology
At present, in storage device, being connected with applied host machine needs to use polytype HBA cards, and applied host machine passes through These HBA cards transfer data to storage, realize that port is configured by C language code, but need after being the increase in HBA Card Types The problem of changing code, it is impossible to reach flexible configuration port.Because user's scene is various, in order to meet the applied field that client is different Scape is flexibly matched somebody with somebody, it is necessary to realize that quick-replaceable hardware configuration need not update software and can support the solution of multiple network agreement Put port.
The content of the invention
It is an object of the invention to provide a kind of storage device port configuration method and device, to realize flexible configuration port.
In order to solve the above technical problems, the present invention provides a kind of storage device port configuration method, this method includes:
The information of the HBA cards in storage device is extracted using perl language;
The information of HBA cards is matched with configuration file;
If the match is successful, determine that HBA cards are supported by software, start initialization program to meet the normal work bar of software Part.
It is preferred that, the use perl language is extracted before the information of the HBA cards in storage device, in addition to:
The parsing of configuration file is completed using perl language, the configuration file after parsing is preserved into configuration Hash table.
It is preferred that, the use perl language extracts the information of the HBA cards in storage device, including:
The supplier ID of HBA cards, the triplet information of device id and pci bus are obtained using perl language and are stored in In actual Hash table.
It is preferred that, methods described also includes:
If matching is unsuccessful, warning information is sent, points out to change HBA cards.
The present invention also provides a kind of storage device port configuration device, for realizing the above method, including:
Extraction module, the information for extracting the HBA cards in storage device using perl language;
Matching module, for the information of HBA cards to be matched with configuration file;
Starting module, if for the match is successful, determining that HBA cards are supported by software, starts initialization program soft to meet The normal running conditions of part.
It is preferred that, extraction module also includes:
Resolution unit, for using perl language complete configuration file parsing, by the configuration file after parsing preserve to Configure in Hash table.
It is preferred that, the matching module specifically for using perl language obtain the supplier ID of HBA cards, device id and The triplet information of pci bus is simultaneously stored in actual Hash table.
It is preferred that, described device also includes:Alarm module, if unsuccessful for matching, sends warning information, points out to change HBA cards.
A kind of storage device port configuration method and device provided by the present invention, storage device is extracted using perl language On HBA cards information;The information of HBA cards is matched with configuration file;If the match is successful, determine HBA cards by software institute Support, start initialization program to meet the normal running conditions of software.It can be seen that, when changing network environment, change corresponding After HBA cards, then new port type can quickly be recognized by this method, carry out the quick switching for realizing client network environment, keep away Increase the problem of modification code is needed after HBA Card Types when having exempted to realize by C language code, realize flexible configuration port, it is real Software need not now be updated with regard to quick-replaceable hardware configuration can be reached.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are only this The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of flow chart of storage device port configuration method provided by the present invention;
Fig. 2 is the schematic diagram that flexible port configuration is realized using perl language and resolution file;
Fig. 3 is a kind of structural representation of storage device port configuration side provided by the present invention device.
Embodiment
The core of the present invention is to provide a kind of storage device port configuration method and device, to realize flexible configuration port.
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Term is explained as follows:
PCI (Peripheral Component Interconnect) represents external equipment interconnection bus.
Fig. 1 is refer to, Fig. 1 is a kind of flow chart of storage device port configuration method provided by the present invention, this method Including:
S11:The information of the HBA cards in storage device is extracted using perl language;
S12:The information of HBA cards is matched with configuration file;
S13:If the match is successful, determine that HBA cards are supported by software, start initialization program to meet the normal work of software Make condition.
It can be seen that, when changing network environment, change after corresponding HBA cards, then can quickly be recognized by this method new Port type, carry out the quick switching for realizing client network environment, it is to avoid increases HBA Card Types when being realized by C language code After need modification code the problem of, realize flexible configuration port, realization need not update software with regard to that can reach that quick-replaceable hardware is matched somebody with somebody Put.
Based on the above method, further, in step S11, the use perl language extracts the HBA cards in storage device Information before, in addition to:The parsing of configuration file is completed using perl language, the configuration file after parsing is preserved to configuration In Hash table.
Further, step S12 process is specially:Use perl language obtain the supplier ID of HBA cards, device id with And pci bus triplet information and be stored in actual Hash table.
Further, methods described also includes:If matching is unsuccessful, warning information is sent, points out to change HBA cards.
This method completes the information extraction of actual HBA cards in place by using perl language, and according to configuration file Contrast, to match whether actual HBA cards in place are supported by software, then start corresponding initialization program soft to meet The normal running conditions of part.When changing network environment, change after corresponding HBA cards, then flexible configuration is reached by this method Port, can quickly recognize new port type, carry out the quick switching for realizing client network environment.It can be met using this method Client is switched fast to different network environments, to save the equipment purchase cost and time cost of client.
This method using perl language and configuration file combination, it is possible to increase the flexibility of software, it is to avoid pass through C languages The problem of needing modification code after increase HBA Card Types when speech code is realized, the flexibility of software can improve the flexibility of product. Fig. 2 is the schematic diagram that flexible port configuration is realized using perl language and resolution file.
In more detail, this method comprises the following steps:
Step one:The parsing of configuration file is completed using perl language;
Wherein, configuration file includes the supported HBA cards of hba.config and description PCI slot position of description HBA card informations The slot.config of type information;Perl language will be saved in a name for config_ after these configuration file dissection process In hash configuration Hash table;
Step 2:The acquisition of HBA card informations in storage system is completed using perl language, includes the supplier ID of HBA cards And device id, and pci bus triplet information, i.e. bus/device/function.
Wherein, the collection of PCI information is obtained by inquiry/sys file system.One is saved in after the completion of information gathering Individual name is in actual_hash actual Hash table;
Step 3:By the HBA Card Types in comparative arrangement Hash table and actual Hash table, PCI triplet informations come true Specific HBA Card Types on fixed some PCI slot position;, can be by actual matching result and HBA Card Types, PCI tri- if the match is successful Tuple information is saved in a file;
Step 4:If it fails to match with the corresponding informance in actual Hash table for the configuration Hash table in step 3, it can remember The record mark that it fails to match is into file, to facilitate software to provide warning information after obtaining, to point out user to change HBA cards.
This method completes the information extraction of actual HBA cards in place using perl language, and according to pair with configuration file Than to match whether actual HBA cards in place are supported by software.Change storage product and HBA cards flexibly end is realized using C language The mode of mouth, is combined with configuration file using perl language, improves the flexibility of software, while also improving the flexible of product Property.
Fig. 3 is a kind of structural representation of storage device port configuration side provided by the present invention device, and the device is used for The above method is realized, the device includes:
Extraction module 101, the information for extracting the HBA cards in storage device using perl language;
Matching module 102, for the information of HBA cards to be matched with configuration file;
Starting module 103, if for the match is successful, determining that HBA cards are supported by software, starts initialization program to meet The normal running conditions of software.
It can be seen that, when changing network environment, change after corresponding HBA cards, then can quickly be recognized by the present apparatus new Port type, carry out the quick switching for realizing client network environment, it is to avoid increases HBA Card Types when being realized by C language code After need modification code the problem of, realize flexible configuration port, realization need not update software with regard to that can reach that quick-replaceable hardware is matched somebody with somebody Put.
Based on said apparatus, further, extraction module also includes:Resolution unit, for completing to match somebody with somebody using perl language The parsing of file is put, the configuration file after parsing is preserved into configuration Hash table.
Further, the matching module specifically for use perl language obtain the supplier ID of HBA cards, device id with And pci bus triplet information and be stored in actual Hash table.
Further, described device also includes:Alarm module, if unsuccessful for matching, sends warning information, points out more Change HBA cards.
The embodiment of each in this specification is described by the way of progressive, what each embodiment was stressed be with it is other Between the difference of embodiment, each embodiment same or similar part mutually referring to.For being filled disclosed in embodiment For putting, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is referring to method part Explanation.
Professional further appreciates that, with reference to the unit of each example of the embodiments described herein description And algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware and The interchangeability of software, generally describes the composition and step of each example according to function in the above description.These Function is performed with hardware or software mode actually, depending on the application-specific and design constraint of technical scheme.Specialty Technical staff can realize described function to each specific application using distinct methods, but this realization should not Think beyond the scope of this invention.
Directly it can be held with reference to the step of the method or algorithm that the embodiments described herein is described with hardware, processor Capable software module, or the two combination are implemented.Software module can be placed in random access memory (RAM), internal memory, read-only deposit Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology In any other form of storage medium well known in field.
A kind of storage device port configuration method and device provided by the present invention are described in detail above.Herein In apply specific case the principle and embodiment of the present invention be set forth, the explanation of above example is only intended to side The method and its core concept of the assistant solution present invention.It should be pointed out that for those skilled in the art, not On the premise of departing from the principle of the invention, some improvement and modification can also be carried out to the present invention, these are improved and modification is also fallen into In the protection domain of the claims in the present invention.

Claims (8)

1. a kind of storage device port configuration method, it is characterised in that including:
The information of the HBA cards in storage device is extracted using perl language;
The information of HBA cards is matched with configuration file;
If the match is successful, determine that HBA cards are supported by software, start initialization program to meet the normal running conditions of software.
2. the method as described in claim 1, it is characterised in that the use perl language extracts the HBA cards in storage device Information before, in addition to:
The parsing of configuration file is completed using perl language, the configuration file after parsing is preserved into configuration Hash table.
3. method as claimed in claim 2, it is characterised in that the use perl language extracts the HBA cards in storage device Information, including:
The supplier ID of HBA cards, the triplet information of device id and pci bus are obtained using perl language and reality is stored in In Hash table.
4. method as claimed in claim 3, it is characterised in that also include:
If matching is unsuccessful, warning information is sent, points out to change HBA cards.
5. a kind of storage device port configuration device, it is characterised in that for realizing such as any one institute in Claims 1-4 The method stated, including:
Extraction module, the information for extracting the HBA cards in storage device using perl language;
Matching module, for the information of HBA cards to be matched with configuration file;
Starting module, if for the match is successful, determining that HBA cards are supported by software, starts initialization program to meet software Normal running conditions.
6. device as claimed in claim 5, it is characterised in that extraction module also includes:
Resolution unit, the parsing for being completed configuration file using perl language, the configuration file after parsing is preserved to configuration In Hash table.
7. device as claimed in claim 6, it is characterised in that the matching module using perl language specifically for being obtained The supplier ID of HBA cards, the triplet information of device id and pci bus are simultaneously stored in actual Hash table.
8. device as claimed in claim 7, it is characterised in that also include:Alarm module, if unsuccessful for matching, sends Warning information, points out to change HBA cards.
CN201710391790.4A 2017-05-27 2017-05-27 Storage device port configuration method and device Active CN107220191B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710391790.4A CN107220191B (en) 2017-05-27 2017-05-27 Storage device port configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710391790.4A CN107220191B (en) 2017-05-27 2017-05-27 Storage device port configuration method and device

Publications (2)

Publication Number Publication Date
CN107220191A true CN107220191A (en) 2017-09-29
CN107220191B CN107220191B (en) 2020-10-20

Family

ID=59946979

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710391790.4A Active CN107220191B (en) 2017-05-27 2017-05-27 Storage device port configuration method and device

Country Status (1)

Country Link
CN (1) CN107220191B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7085877B1 (en) * 2002-03-26 2006-08-01 Adaptec, Inc. Method and apparatus for combination host bus adapter
CN101667134A (en) * 2009-09-23 2010-03-10 中兴通讯股份有限公司 Method for constructing compiling system, compiling system and constructing device thereof
CN103412769A (en) * 2013-07-25 2013-11-27 华为技术有限公司 External card parameter configuration method, equipment and system
CN104765664A (en) * 2014-01-08 2015-07-08 鸿富锦精密工业(深圳)有限公司 PCI (Peripheral Component Interface) equipment detection system and method
CN105988943A (en) * 2015-01-28 2016-10-05 青岛海信移动通信技术股份有限公司 Method and device for driving wireless adapter

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7085877B1 (en) * 2002-03-26 2006-08-01 Adaptec, Inc. Method and apparatus for combination host bus adapter
CN101667134A (en) * 2009-09-23 2010-03-10 中兴通讯股份有限公司 Method for constructing compiling system, compiling system and constructing device thereof
CN103412769A (en) * 2013-07-25 2013-11-27 华为技术有限公司 External card parameter configuration method, equipment and system
CN104765664A (en) * 2014-01-08 2015-07-08 鸿富锦精密工业(深圳)有限公司 PCI (Peripheral Component Interface) equipment detection system and method
CN105988943A (en) * 2015-01-28 2016-10-05 青岛海信移动通信技术股份有限公司 Method and device for driving wireless adapter

Also Published As

Publication number Publication date
CN107220191B (en) 2020-10-20

Similar Documents

Publication Publication Date Title
CN104040516B (en) Method, apparatus and system for data deduplication
CN106850746B (en) The method and device of smooth service upgrading
AU2014235300B2 (en) Multi-layered storage administration for flexible placement of data
CN104954451B (en) The access control method of USB device under a kind of virtualized environment
CN105183410B (en) Information displaying method, displaying server, social networking application client and system
CN106789363A (en) A kind of method and device to virtual machine configuration network interface card
CN106598692A (en) Method for creating mirror image file in logical volume and starting virtual machine, and server
CN104182299A (en) Software rejuvenation system and method for electronic equipment
CN102546756A (en) Data processing method, cloud server and terminal
CN110083379A (en) A kind of server component upgrade method and relevant apparatus
CN112363935A (en) Data joint debugging method and device, electronic equipment and storage medium
CN108600184A (en) A kind of equipment authentication method of embedded chip certificate
CN108737487B (en) Data synchronization method and device, storage medium and electronic device
CN107220191A (en) A kind of storage device port configuration method and device
CN106685708A (en) Determining method, device and system of service relationship
CN108427947A (en) A kind of image-recognizing method and electronic equipment
CN105991791A (en) Message forwarding method and device
CN108459960A (en) Method of automatic configuration, device, equipment and the storage medium of test environment
CN103870478B (en) A kind of method and device for restoring synchrodata
CN115469964A (en) Method and device for determining mapping relation between block device and virtual machine disk character
CN107105021A (en) A kind of data read-write method and device
CN114781517A (en) Risk identification method and device and terminal equipment
CN114168074A (en) Mirror image storage method, device, storage medium and electronic equipment
CN110995574B (en) User information management method, acquisition method and system
CN108270609B (en) Method and device for updating configuration file of website server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200918

Address after: 215100 No. 1 Guanpu Road, Guoxiang Street, Wuzhong Economic Development Zone, Suzhou City, Jiangsu Province

Applicant after: SUZHOU LANGCHAO INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: 450018 Henan province Zheng Dong New District of Zhengzhou City Xinyi Road No. 278 16 floor room 1601

Applicant before: ZHENGZHOU YUNHAI INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant