WO2022089249A1 - 信息采集方法、装置、服务器及存储介质 - Google Patents

信息采集方法、装置、服务器及存储介质 Download PDF

Info

Publication number
WO2022089249A1
WO2022089249A1 PCT/CN2021/124641 CN2021124641W WO2022089249A1 WO 2022089249 A1 WO2022089249 A1 WO 2022089249A1 CN 2021124641 W CN2021124641 W CN 2021124641W WO 2022089249 A1 WO2022089249 A1 WO 2022089249A1
Authority
WO
WIPO (PCT)
Prior art keywords
attribute
information
attribute name
array card
name
Prior art date
Application number
PCT/CN2021/124641
Other languages
English (en)
French (fr)
Inventor
陈扬东
饶俊明
卢道和
郑晓腾
夏敏捷
刘生庆
魏江鑫
Original Assignee
深圳前海微众银行股份有限公司
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 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2022089249A1 publication Critical patent/WO2022089249A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Definitions

  • the embodiments of the present application relate to the technical field of financial technology (Fintech) servers, and in particular, to an information collection method, device, server, and storage medium.
  • Fetech financial technology
  • servers are usually used to analyze or process more and more financial business data. In the process of processing or analyzing financial data through a server, it is usually necessary to maintain the server.
  • the intelligent platform management interface Intelligent Platform Management Interface, IPMI
  • IPMI Intelligent Platform Management Interface
  • the data information obtained by the IPMI-based collection technology is physical machine code, which is poorly readable, resulting in low operation and maintenance efficiency.
  • the component information for example, the temperature of the processor, the remaining power of the battery
  • Personnel need to know the name and location of component information of different brands of servers in different data information, which increases the workload of operation and maintenance personnel and leads to low operation and maintenance efficiency.
  • Embodiments of the present application provide an information collection method, a device, a server, and a storage medium, which are used to reduce the workload of operation and maintenance personnel and improve the operation and maintenance efficiency of the server.
  • an embodiment of the present application provides an information collection method, including:
  • the first attribute information of the first component by collecting the application program, the first attribute information includes at least one first attribute name and a first attribute value corresponding to each first attribute name, and the first component is any component in the server;
  • the attribute list corresponding to the first component includes at least one second attribute name
  • obtaining the second attribute value corresponding to the second attribute name in the first attribute information includes:
  • the second attribute value corresponding to the second attribute name is obtained in the first attribute information.
  • an information string division process is performed on the first attribute information to obtain at least one information string, including:
  • the information string division processing is performed on the first attribute information to obtain at least one information string; wherein, one row of information in the first attribute information corresponds to one information string.
  • the number of at least one information string is M, and M is greater than or equal to 1
  • the attribute list further includes the target identifier of the collection application and at least one third attribute name corresponding to the target identifier, at least one third attribute name
  • the number of three attribute names is N, M is greater than or equal to N, and N is greater than or equal to 1, and a third attribute name in the attribute list corresponds to a second attribute name.
  • j is greater than or equal to 1 and less than or equal to N;
  • an information string division process is performed on the first attribute information to obtain at least one information string, including:
  • the number of at least one information string is N, and N is greater than or equal to 1
  • the attribute list further includes at least one application identifier and at least one third attribute name corresponding to each application identifier.
  • a third attribute name corresponds to a second attribute name
  • the number of at least one application identifier is M
  • M is greater than or equal to 1
  • the at least one application identifier includes the target identifier of the collection application.
  • j is greater than or equal to 1 and less than or equal to Y, where Y is the total number of the at least one second attribute name;
  • Hash conversion processing is performed on the N information strings respectively to obtain N first hash values and N first mapping relationships, wherein one information string corresponds to a first hash value, and a first hash value corresponds to a first hash value. a mapping relationship;
  • Hash conversion is performed on the M third attribute names corresponding to the jth second attribute name, respectively, to obtain M second hash values and M second mapping relationships, wherein a third attribute name corresponding to a third attribute name Two hash values, a second hash value corresponds to a second mapping relationship;
  • the j-th hash value is obtained from the first attribute information
  • the second attribute value corresponding to the second attribute name includes:
  • the third attribute value corresponding to the third attribute name corresponding to the second target value is obtained in the first attribute information, and the third attribute value is determined as the second attribute value corresponding to the jth second attribute name, wherein , the third attribute name corresponding to the second target value corresponds to the jth second attribute name.
  • the mapping information includes at least one three-dimensional coordinate; according to the mapping information, obtaining a third attribute value corresponding to the third attribute name corresponding to the second target value in the first attribute information, including:
  • the target identifier in the second column identifier of the attribute list it is determined whether there is a first coordinate in at least one three-dimensional coordinate, and the first coordinate includes The first column ID and the second column ID;
  • the first coordinate determine the first information string in the first attribute information, the position identification of the first information string in the first attribute information and the first coordinate except the first column identification and the second column identification
  • the coordinate values are the same; the attribute value corresponding to the second information string in the first attribute information is determined as the third attribute value corresponding to the third attribute name corresponding to the second target value, and the second information string is the first information string after the first information string. an information string.
  • a Linux operating system is installed in the server, and the collection application program is installed in the Linux operating system;
  • Acquiring the first attribute information of the first component by collecting the application program includes: in the Linux operating system, using an in-band information acquisition method to obtain the first attribute information of the first component through the collecting application program.
  • the server is provided with a basic data model corresponding to the first component, the basic data model includes at least one second attribute name, and the attribute list is pre-established and stored in the at least one second attribute name according to the name of the second attribute. list in the server.
  • the first component includes at least one array card and at least one hard disk, wherein at least one array card includes a virtual array card, and at least one hard disk includes a virtual hard disk.
  • the method before acquiring the first attribute information of the first component through the collection application, the method further includes:
  • the query information includes the query information of the first array card and the manufacturer information of the server; the target identifier of the acquisition application is determined according to the query information, including:
  • the first application identifier is determined as the target identifier.
  • the query information further includes query information of the second array card, and the method further includes:
  • the manufacturer ID of the server is determined not to be the preset ID according to the manufacturer information, if it is determined according to the query information of the second array card that the first array card supports the second array card If it is determined that the first array card does not support the second array card according to the query information of the second array card, the third application identifier is determined as the target identifier.
  • the query information further includes query information of the third array card; determining the target identifier of the collection application according to the query information, including:
  • the fourth application identifier is determined as the target identifier
  • the fifth application identifier is determined as the target identifier.
  • At least one array card further includes a first array card and/or a third array card, the first array card is an array card realized by hardware, and the third array card is an array card realized by software .
  • an information collection device including:
  • the first acquisition module is configured to acquire first attribute information of the first component through a collection application, where the first attribute information includes at least one first attribute name and a first attribute value corresponding to each first attribute name, and the first component is any part of the server;
  • the second obtaining module is configured to obtain the attribute list corresponding to the first component, where the attribute list includes at least one second attribute name;
  • the third obtaining module is configured to obtain the second attribute value corresponding to the second attribute name in the first attribute information
  • the filling module is used for filling the second attribute value into the attribute list to obtain the information collection result of the first component.
  • the third obtaining module is specifically used for:
  • the second attribute value corresponding to the second attribute name is obtained in the first attribute information.
  • the third obtaining module is specifically used for:
  • the information string division processing is performed on the first attribute information to obtain at least one information string; wherein, one row of information in the first attribute information corresponds to one information string.
  • the number of at least one information string is M, and M is greater than or equal to 1
  • the attribute list further includes the target identifier of the collection application and at least one third attribute name corresponding to the target identifier, at least one third attribute name
  • the number of three attribute names is N, M is greater than or equal to N, and N is greater than or equal to 1, and a third attribute name in the attribute list corresponds to a second attribute name.
  • j is greater than or equal to 1 and less than or equal to N;
  • the third acquisition module is specifically used for:
  • the third obtaining module is specifically used for:
  • the number of at least one information string is N, and N is greater than or equal to 1
  • the attribute list further includes at least one application identifier and at least one third attribute name corresponding to each application identifier.
  • a third attribute name corresponds to a second attribute name
  • the number of at least one application identifier is M
  • M is greater than or equal to 1
  • the at least one application identifier includes the target identifier of the collection application.
  • j is greater than or equal to 1 and less than or equal to Y, where Y is the total number of the at least one second attribute name;
  • the third acquisition module is specifically used for:
  • Hash conversion processing is performed on the N information strings respectively to obtain N first hash values and N first mapping relationships, wherein one information string corresponds to a first hash value, and a first hash value corresponds to a first hash value. a mapping relationship;
  • Hash conversion is performed on the M third attribute names corresponding to the jth second attribute name, respectively, to obtain M second hash values and M second mapping relationships, wherein a third attribute name corresponding to a third attribute name Two hash values, a second hash value corresponds to a second mapping relationship;
  • the third obtaining module is specifically used for:
  • the third attribute value corresponding to the third attribute name corresponding to the second target value is obtained in the first attribute information, and the third attribute value is determined as the second attribute value corresponding to the jth second attribute name, wherein , the third attribute name corresponding to the second target value corresponds to the jth second attribute name.
  • the mapping information includes at least one three-dimensional coordinate; the third acquisition module is specifically used for:
  • the target identifier in the second column identifier of the attribute list it is determined whether there is a first coordinate in at least one three-dimensional coordinate, and the first coordinate includes The first column ID and the second column ID;
  • the first coordinate determine the first information string in the first attribute information, the position identification of the first information string in the first attribute information and the first coordinate except the first column identification and the second column identification
  • the coordinate values are the same; the attribute value corresponding to the second information string in the first attribute information is determined as the third attribute value corresponding to the third attribute name corresponding to the second target value, and the second information string is the first information string after the first information string. an information string.
  • a Linux operating system is installed in the server, and a collection application program is installed in the Linux operating system; the first obtaining module is specifically used for:
  • the in-band information acquisition method is adopted to acquire the first attribute information of the first component through a collection application program.
  • the server is provided with a basic data model corresponding to the first component, the basic data model includes at least one second attribute name, and the attribute list is pre-established and stored in the at least one second attribute name according to the name of the second attribute. list in the server.
  • the first component includes at least one array card and at least one hard disk, wherein at least one array card includes a virtual array card, and at least one hard disk includes a virtual hard disk.
  • the information collection apparatus further includes: a query module and a determination module, wherein the query module is configured to query at least one array card before acquiring the first attribute information of the first component through the collection application, get query information;
  • the determining module is used for determining the target identifier of the collection application program according to the query information.
  • the query information includes the query information of the first array card and the manufacturer information of the server; the determining module is specifically used for:
  • the first application identifier is determined as the target identifier.
  • the query information further includes query information of the second array card
  • the determining module is further configured to:
  • the manufacturer ID of the server is determined not to be the preset ID according to the manufacturer information, if it is determined according to the query information of the second array card that the first array card supports the second array card If it is determined that the first array card does not support the second array card according to the query information of the second array card, the third application identifier is determined as the target identifier.
  • the query information further includes query information of the third array card; the determining module is further configured to:
  • the fourth application identifier is determined as the target identifier
  • the fifth application identifier is determined as the target identifier.
  • At least one array card further includes a first array card and/or a third array card, the first array card is an array card realized by hardware, and the third array card is an array card realized by software .
  • an embodiment of the present application provides a server, including: a memory and a processor;
  • memory stores instructions for execution by the computer
  • the processor executes computer-implemented instructions stored in the memory, causing the processor to perform the method of any one of the first aspects.
  • embodiments of the present application provide a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, any one of the methods in the first aspect is implemented.
  • the present application provides an information collection method, device, server and storage medium.
  • the information collection method includes: obtaining first attribute information of a first component through a collection application program, where the first attribute information includes at least one first attribute name and each The first attribute value corresponding to the first attribute name, the first part is any part in the server; the attribute list corresponding to the first part is obtained, and the attribute list includes at least one second attribute name; the second attribute name is obtained from the first attribute information.
  • the second attribute value corresponding to the attribute name is filled, and the second attribute value is filled into the attribute list to obtain the information collection result of the first component.
  • the second attribute value corresponding to the second attribute name is obtained from the first attribute information, and the second attribute value is filled into the attribute list to obtain the information collection result of the first component, so that the information collection result includes each The second attribute name and the second attribute value corresponding to each second attribute name, so as to realize the standardization and integrity of information collection, and it is convenient for the operation and maintenance personnel to diagnose, repair, and warn the server directly according to the information collection results, so as to reduce the operation and maintenance costs.
  • the workload of maintenance personnel is improved, and the operation and maintenance efficiency of the server is improved. .
  • FIG. 1 is a schematic diagram of an application scenario of an information collection method provided by an embodiment of the present application
  • FIG. 2 is a schematic flowchart 1 of an information collection method provided by an embodiment of the present application.
  • FIG. 3 is a second schematic flowchart of the information collection method provided by the embodiment of the present application.
  • FIG. 4 is a schematic flowchart of determining an application identifier according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a basic data model provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart three of the information collection method provided by the embodiment of the present application.
  • FIG. 7 is a fourth schematic flowchart of the information collection method provided by the embodiment of the present application.
  • FIG. 8 is a schematic structural diagram 1 of an information collection apparatus provided by an embodiment of the present application.
  • FIG. 9 is a second schematic structural diagram of an information collection apparatus provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a hardware structure of a server provided by an embodiment of the present application.
  • FIG. 1 is a schematic diagram of an application scenario of an information collection method provided by an embodiment of the present application. As shown in FIG. 1 , it includes: a server 10 .
  • the server 10 includes a memory and a display device.
  • the server 10 is installed with a linux system and at least one collection application program.
  • the server 10 may also be provided with a memory (memory), a processor (Central Processing Unit, CPU), array card (i.e. RAID card), hard disk (DISK) and basic data model, etc.
  • the memory can be used to store the attribute list and the first attribute information of the first part
  • the display device can be used to display the information collection result of the first part to the user
  • the basic data model can be used to construct the attribute list of the first part.
  • the basic data model refer to the embodiment in FIG. 5 .
  • the attribute list and first attribute information of the first part are firstly obtained, wherein the attribute list includes at least one attribute name corresponding to the first part;
  • the attribute value corresponding to each attribute name is obtained from the attribute information; the attribute value is then filled into the attribute list to obtain the information collection result of the first component.
  • at least one attribute name is a name readable by operation and maintenance personnel (for example, the attribute name is battery_state, that is, the English word combination corresponding to the battery state), and each attribute name and its corresponding attribute value are in the attribute list.
  • the location of the attribute name is fixed, and the name of at least one attribute name in the attribute list is fixed, which can reduce the workload of the operation and maintenance personnel and improve the operation and maintenance efficiency.
  • FIG. 2 is a schematic flowchart 1 of an information collection method provided by an embodiment of the present application. As shown in Figure 2, the information collection method provided by this embodiment includes:
  • the execution body of the embodiment of the present application may be a server, or may be an information collection apparatus disposed in the server, and the information collection apparatus may be implemented by a combination of software and/or hardware.
  • a Linux operating system is installed in the server, and a collection application program is installed in the Linux operating system.
  • the collection application may be a self-developed computer application, or may be any one of the MegaCli tool, the Lsiutil tool, the Hpacucli tool, the Mdadm tool, and the Smartmontools tool.
  • the collection application is an application matched with the server.
  • each collection application program has its own corresponding application identifier (for example, the application identifier of the MegaCli tool can be MegaCli). matching application.
  • the method for determining the target identifier may refer to S301 to S302 in the embodiment of FIG. 3 .
  • the first component may be a processor, a memory, etc., and may also be a component including any at least one of an array card, a hard disk, a virtual array card, a virtual hard disk, and the like.
  • the first attribute name is the name corresponding to the attribute keyword of the first component obtained by collecting the application program. It should be noted that the first attribute names corresponding to the same attribute keyword collected by different collection applications may be different.
  • the attribute keyword is the current cache policy
  • the first attribute name collected by the MegaCli tool is Current Cache (that is, the current cache policy)
  • the first attribute name obtained through the Lsiutil tool is Current Cache.
  • the method for obtaining the first attribute information of the first component by collecting an application program may specifically be: in a Linux operating system, in a way of obtaining in-band information, and obtaining the first component by collecting an application program The first attribute information of .
  • control data (ie, the first attribute information) of the server and the user service data information are transmitted on the same link, which can save the link resources of the server and improve the information collection efficiency.
  • the data information of the hardware components in the server is acquired through the out-of-band information acquisition method.
  • the control data of the server (data of the hardware components) information) and user service data are transmitted on different links, resulting in waste of link resources of the server and reducing the efficiency of information collection.
  • the link resources of the server can be saved, and the information collection efficiency can be improved.
  • the attribute list is a list pre-stored by the server.
  • At least one second attribute name is the name of the key technical indicator corresponding to the first component
  • each second attribute name is a name pre-defined by the developer and can be recognized by the operation and maintenance personnel
  • each second attribute name is in the attribute name.
  • the position, name, format, etc. of the list are fixed.
  • the name of the second attribute is current_cache_policy, and the operation and maintenance personnel can determine it as the current cache policy according to its literal meaning.
  • the virtual array card and the virtual hard disk exist in the server in this application by default.
  • the attribute list corresponding to the first component may be as shown in Table 1 below.
  • the attribute list may further include multiple application identifiers and at least one third attribute name corresponding to each application identifier, and each third attribute name has a corresponding second attribute name.
  • the at least one third attribute name is obtained by the developer by summing up the at least one first attribute name in the first attribute information, that is, the at least one third attribute name is the same as the at least one first attribute name.
  • the corresponding relationship between the third attribute name and the second attribute name is obtained by a developer through a collection experiment of the first component by using different collection application programs.
  • the attribute list may also be as shown in Table 2 and Table 3 below.
  • the server is provided with a basic data model corresponding to the first component, the basic data model includes the at least one second attribute name, and the attribute list is pre-established according to the at least one second attribute name, and The list stored in the server.
  • the basic data model For a detailed description of the basic data model, reference may be made to the embodiment in FIG. 5 .
  • S203 Acquire a second attribute value corresponding to the second attribute name in the first attribute information, and fill the second attribute value into the attribute list to obtain the information collection result of the first component.
  • At least one first attribute name has a first attribute name that is the same as the third attribute name corresponding to the target identifier.
  • the first attribute name corresponding to the third attribute name may be determined in the first attribute information, and the first attribute value of the first attribute name corresponding to the third attribute name in the first attribute information may be determined as the third attribute.
  • the second attribute value of the second attribute name corresponding to the name is filled, and the second attribute value of the second attribute name is filled into the attribute list shown in Table 1, so as to obtain the information collection result of the first component.
  • the attribute list shown above may also include a default value corresponding to each second attribute name. If the second attribute value corresponding to the second attribute name is determined, the default value corresponding to the second attribute name is replaced. is the second attribute value corresponding to the second attribute name, so as to obtain the information collection result of the first component; if the second attribute value corresponding to the second attribute name is not determined, the default value corresponding to the second attribute name is determined as The second attribute value corresponding to the second attribute name, thereby obtaining the information collection result of the first component.
  • the attribute list including the corresponding default value of each second attribute name may be as shown in Table 4 below.
  • any at least two tables in Table 1, Table 2, Table 3, and Table 4 may be combined to form a new table, which will not be described in detail here.
  • the information collection method includes: acquiring first attribute information of a first component through a collection application, where the first attribute information includes at least one first attribute name and a first attribute value corresponding to each first attribute name;
  • a component is any component in the server; obtain the attribute list corresponding to the first component, the attribute list includes at least one second attribute name; obtain the second attribute value corresponding to the second attribute name in the first attribute information, and use the first attribute information
  • the second attribute value is filled into the attribute list, and the information collection result of the first component is obtained.
  • the second attribute value corresponding to the second attribute name is obtained from the first attribute information, and the second attribute value is filled into the attribute list to obtain the information collection result of the first component, so that the information collection result includes each The second attribute name and the second attribute value corresponding to each second attribute name, so as to realize the standardization and integrity of information collection, and it is convenient for the operation and maintenance personnel to diagnose, repair, and warn the server directly according to the information collection results, so as to reduce the operation and maintenance costs.
  • the workload of maintenance personnel is improved, and the operation and maintenance efficiency of the server is improved.
  • the same component information is named in the data information corresponding to different servers.
  • format, location, etc. are usually different, so the naming, format, location, etc. of the same component information in the data information corresponding to different servers cannot be the same, and it is impossible to achieve unified management of different servers.
  • the attribute list corresponding to the first component is obtained, the second attribute value corresponding to the second attribute name is obtained from the first attribute information, and the second attribute value is filled into the attribute list to obtain the information collection result of the first component , so that the same second attribute name (ie component information) in the information collection results (ie data information) corresponding to different servers has the same naming, format, location, etc., to achieve unified management of different servers.
  • the present application provides The information collection method is described in detail.
  • FIG. 3 is a second schematic flowchart of the information collection method provided by the embodiment of the present application. As shown in Figure 3, the information collection method provided by this embodiment includes:
  • the query information may include at least one information among the query information of the first array card, the manufacturer information of the server, the query information of the second array card, and the query information of the third array card.
  • the query information includes the query information of the first array card and the manufacturer information of the server; the target identifier of the acquisition application is determined according to the query information, including:
  • the first application identifier is determined as the target identifier.
  • the query information further includes query information of the second array card
  • the method further includes: determining that there is a first array card in the server according to the query information of the first array card, and determining the server's After the manufacturer identification is not the default identification, if it is determined according to the second array card query information that the first array card supports the second array card, the second application identification is determined as the target identification; if the first array card is determined according to the second array card query information If the array card does not support the second array card, the third application identifier is determined as the target identifier.
  • the query information further includes query information of the third array card; determining the target identifier of the collection application according to the query information, including:
  • the fourth application identifier is determined as the target identifier
  • the fifth application identifier is determined as the target identifier.
  • a collection application program corresponding to the target identifier can be started, and the first attribute information of the first component is acquired through the collection application program corresponding to the target identifier.
  • S305 Perform information string division processing on the first attribute information to obtain at least one information string, where each information string includes at least one first attribute name and/or at least one first attribute value.
  • S305 reference may be made to S605 in the embodiment of FIG. 6 or S705 in the embodiment of FIG. 7 .
  • S306 reference may be made to S606 to S613 in the embodiment of FIG. 6 or S706 to S712 in the embodiment of FIG. 7 .
  • the first attribute information of the first component and the corresponding attribute list of the first component are obtained, and the information string division processing is performed on the first attribute information to obtain at least one information string, and then according to the first attribute information
  • Two attribute names and at least one information string, the second attribute value corresponding to the second attribute name is obtained from the first attribute information, and the second attribute value corresponding to each second attribute name can be accurately found.
  • the second attribute value corresponding to the second attribute name is obtained from the first attribute information, and the second attribute value is filled into the attribute list to obtain the information collection result of the first component, so that the information collection result includes each second attribute.
  • Name and the second attribute value corresponding to each second attribute name so as to realize the standardization and integrity of information collection, and it is convenient for the operation and maintenance personnel to diagnose, repair, and warn the server directly according to the information collection results, reducing the operation and maintenance personnel. workload, and improve the operation and maintenance efficiency of the server.
  • FIG. 4 is a schematic flowchart of determining an application identifier according to an embodiment of the present application. As shown in FIG. 4 , the method for determining an application identifier provided by this embodiment includes:
  • the first array card query information may be acquired from a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus device through the first instruction.
  • PCI peripheral component interconnect standard
  • the first instruction can be: lspci
  • S402. Determine whether there is a first array card in the server according to the query information of the first array card.
  • the query information of the first array card is empty (ie NULL), it is determined that the first array card does not exist in the server; if the query information of the first array card includes: MegaRAID SAS-3 3108, it is determined that the first array card exists in the server.
  • An array card, and the model of the first array card is: SAS-3 3108.
  • whether there is a first array card in the server may also be determined according to whether the query information of the first array card is obtained. For example, if the first array card query information is not obtained after executing the first command, it is determined that the first array card does not exist in the server. If the first array card query information is obtained after the first command is executed, and the obtained If the query information of the first array card includes: MegaRAID SAS-3 3108, it is determined that there is a first array card in the server, and the model of the first array card is: SAS-3 3108.
  • the manufacturer information of the server may be acquired through the second instruction.
  • the second instruction may be dmicode -t1.
  • the preset identification may be the brand name of the server.
  • the preset identifier is HX
  • the manufacturer information includes: Procuct Name: Len RD350
  • Len the manufacturer identifier of the server
  • the model of the server is: RD350.
  • the manufacturer identifier is Len and the preset identifier
  • the identifiers HX are different, so it can be determined that the manufacturer identifier of the server is not a preset identifier.
  • the first application identifier is the application identifier of the Hpacucli tool.
  • the query information of the second array card may be obtained from a Small Computer System Interface (Small Computer System Interface, SCSI) through a third instruction.
  • the third instruction could be: cat /proc/scsi/scsi.
  • S407. Determine whether the first array card supports the second array card according to the query information of the second array card.
  • the first array card is an array card implemented by hardware in the server
  • the query information of the second array card includes the level of the first array card.
  • the level of the first array card is: 10.
  • the second array card is an array card with a preset level, for example, the preset level may be: 5, or may be other.
  • the first array card supports the second array card according to the query information of the second array card and the preset level of the second array card.
  • a level list is pre-stored in the server, and the level list includes a preset level and at least one level corresponding to the preset level, wherein the first array card corresponding to each level in the at least one level is capable of supporting The second array card with this preset level.
  • the target level is obtained from the query information of the second array card, the target level is searched in at least one level, and if the target level is found in at least one level, it is determined that the first array card supports the second array card, and if at least one of the target levels is found. If the target level cannot be found in one level, it is determined that the first adapter does not support the second adapter.
  • the second application identifier is the application identifier of the Lsiutil tool
  • S409 Determine the third application identifier as the target identifier.
  • the third application identifier is the application identifier of the MegaCli tool.
  • the query information of the third array card may be acquired through the fourth instruction.
  • the fourth instruction may be: cat /proc/mdstat.
  • the third array card is an array card implemented by software in the server.
  • the query information of the third array card usually also includes an array (RAID) value.
  • RAID array
  • the level of the third array card can be determined according to the array value. For example, if the array value is raid 10, it is determined that the level of the third array card is 10.
  • the fourth application identifier is the application identifier of the Mdadm tool.
  • the fifth application identifier is the application identifier of the Smartmontools tool.
  • the basic data model is explained.
  • FIG. 5 is a schematic structural diagram of a basic data model provided by an embodiment of the present application.
  • the basic data model includes: the second attribute name corresponding to the virtual array card and the second attribute name corresponding to the virtual hard disk.
  • the virtual hard disk is an attribute under the second attribute name pd_list of the virtual array card, and the second attribute name pd_list can correspond to multiple virtual hard disks (that is, the virtual disk group in the server is one mounted under the virtual array card). Attributes).
  • FIG. 5 only exemplarily shows one virtual hard disk.
  • a basic data model can be pre-built, a virtual hard disk and a virtual array card can be linked together, and various software and hardware scenarios in the server (for example, including: The first array card and hard disk, with the third array card and hard disk, with the first array card, the third array card and the hard disk, with only any one of the hard disks, etc.) unification to realize the unification of the hard disk and the array card in the server summary of key technical indicators.
  • FIG. 6 is a third schematic flowchart of the information collection method provided by the embodiment of the present application. As shown in FIG. 6 , the information collection method provided by this embodiment includes:
  • S602. Determine the target identifier of the collection application program according to the query information.
  • first attribute information of the first component through a collection application program corresponding to the target identifier, where the first attribute information includes at least one first attribute name and a first attribute value corresponding to each first attribute name, and the first component includes at least one first attribute name and a first attribute value corresponding to each first attribute name.
  • One array card and at least one hard disk at least one array card includes a virtual array card, and at least one hard disk includes a virtual hard disk.
  • the attribute list shown in this embodiment may be as shown in Table 5 below. It should be noted that Table 5 only exemplarily shows a part of the list.
  • the second column includes the application identifier of the collection application: Hpacucli, and at least one third attribute name corresponding to the application identifier (respectively: Capacitor Status, Battery Count, Capacitor Status, Capacitor Count, Temperature).
  • S605. Perform information string division processing on the first attribute information according to the row arrangement of the first attribute information to obtain at least one information string, where one row of information in the first attribute information corresponds to one information string, and each information string includes at least one information string.
  • the number of the first attribute name and/or at least one information string of at least one first attribute value is M, where M is greater than or equal to 1, and M is greater than or equal to N.
  • S606. Determine whether there is a first attribute name that is the same as the jth third attribute name in the ith information string, and the name of the jth third attribute corresponds to the name of the jth second attribute.
  • the i-th information string and the j-th third attribute name may also be obtained.
  • the foregoing Table 5 may further include application identifiers corresponding to other collection application programs, and at least one third attribute name corresponding to the application identifiers.
  • the determined application identifiers can be stored in Table 5.
  • the corresponding flag bit of each third attribute name is set to a preset value (for example, the preset value may be 1, 2, 3), and further, when S606 is performed, it can be determined whether there is an i-th information string with The jth third attribute corresponding to the preset value has the same first attribute name.
  • the first attribute value corresponding to the jth third attribute name corresponding to the first attribute name with the same third attribute name may be obtained through a preset obtaining instruction, where the preset obtaining instruction may be: re.findall().
  • S608 Determine whether j is greater than or equal to N.
  • the above-mentioned Table 5 may further include a default value corresponding to each second attribute name.
  • the attribute list may be as shown in Table 6 below.
  • S613 Fill the second attribute value corresponding to the jth second attribute name into the attribute list to obtain the information collection result of the first component.
  • the second attribute value corresponding to the jth second attribute name is filled into the cell where the second attribute value corresponding to the jth second attribute name in the attribute list is located.
  • S606 is executed to determine whether the i-th information string has the same first attribute name as the j-th third attribute name, and the j-th third attribute name is the same as the j-th third attribute name.
  • the names of the two attributes correspond; and i and j are updated, and S606 is repeatedly executed, and the second attribute value corresponding to the jth second attribute name can be accurately determined. Further, the second attribute value corresponding to the jth second attribute name is filled into the attribute list to obtain the information collection result of the first component, so that the information collection result includes each second attribute name corresponding to each second attribute name.
  • the second attribute value is the second attribute value, so as to realize the standardization and integrity of information collection, and it is convenient for the operation and maintenance personnel to diagnose, repair, and warn the server directly according to the information collection results, reduce the workload of the operation and maintenance personnel, and improve the operation and maintenance of the server. dimension efficiency.
  • FIG. 7 is a schematic flowchart of an information collection method provided by an embodiment of the present application. As shown in FIG. 7 , the information collection method provided by this embodiment includes:
  • first attribute information of the first component through a collection application program corresponding to the target identifier, where the first attribute information includes at least one first attribute name and a first attribute value corresponding to each first attribute name, and the first component includes at least one first attribute name and a first attribute value corresponding to each first attribute name.
  • One array card and at least one hard disk at least one array card includes a virtual array card, and at least one hard disk includes a virtual hard disk.
  • the attribute list includes at least one second attribute name, at least one application identifier, and at least one third attribute name corresponding to each application identifier, and one third attribute name in the attribute list corresponds to A second attribute name, the number of at least one application identifier is M, M is greater than or equal to 1, and the at least one application identifier includes a target identifier.
  • the attribute list in this embodiment may be as shown in Table 7 below. It should be noted that Table 7 only exemplarily shows a part of the list.
  • the above-mentioned Table 7 may further include a default value corresponding to each second attribute value, and a third attribute name corresponding to each of the application identifier Hpacucli, the application identifier Mdadm, and the application identifier Smartmontools.
  • S705. Perform splitting processing on the first attribute information according to the preset characters to obtain at least one information string, wherein preset characters are set between the first attribute name and the first attribute value in the first attribute information, and the first attribute information A first attribute name or a first attribute value in the attribute information corresponds to an information string, and the number of at least one information string is N, and N is greater than or equal to 1.
  • the first attribute information is: Capacitor Status (preset character) Fasle (preset character)
  • Battery Count preset character
  • the first attribute information can be split and processed according to the preset character to obtain 4 information strings (respectively: Capacitor Status, Fasle, Battery Count, present).
  • Hash conversion processing is performed on the N information strings respectively to obtain N first hash values and N first mapping relationships, wherein one first hash value corresponds to one first mapping relationship.
  • N the index of the information string (ie, the position identifier), and n is an integer between 1 and N)
  • the obtained N-th A hash value denoted as: Hashn
  • N first mapping relationships denoted as: On
  • the two third attribute names corresponding to the first second attribute name are respectively Replacement Required, Capacitor Status.
  • Hash conversion is performed on the M third attribute names (denoted as: Qk, where k is the first column identifier of the column where the third attribute name is located) corresponding to the jth second attribute name, respectively, and the Mth third attribute names are obtained.
  • Two hash values denoted as: Hashjk
  • M second mapping relationships denoted as: Djk.
  • Hash21 and Hash22 that is, the first hash value Hash2 is the same as the second hash value Hash22 and Hash23, respectively).
  • mapping information obtain the third attribute value corresponding to the third attribute name corresponding to the second hash value in the first attribute information, and determine the third attribute value corresponding to the third attribute name corresponding to the second hash value
  • the second attribute value corresponding to the jth second attribute name is filled into the attribute list to obtain the information collection result of the first component, wherein the second hash value corresponds to The third attribute name corresponds to the jth second attribute name.
  • obtaining the third attribute value corresponding to the third attribute name corresponding to the second hash value in the first attribute information according to the mapping information including:
  • the identifier of the first column in the attribute list of the third attribute name corresponding to the second target value, and the identifier of the target identifier in the second column of the attribute list it is determined whether there is a first coordinate in at least one three-dimensional coordinate, and the first coordinate includes the first coordinate.
  • the first coordinate determine the first information string in the first attribute information, the position identification of the first information string in the first attribute information and the first coordinate except the first column identification and the second column identification
  • the coordinate values are the same; the attribute value corresponding to the second information string in the first attribute information is determined as the third attribute value corresponding to the third attribute name corresponding to the second target value, and the second information string is the first information string after the first information string. an information string. Preset characters are set between the second information string and the first information string.
  • the default value corresponding to the jth second attribute name is determined as the second attribute value corresponding to the jth second attribute name.
  • the third attribute name Replacement corresponding to the second hash value Hash22 The first column of Required in the attribute list is identified as 2, and the third attribute name Capacitor Status corresponding to the second hash value Hash23 is identified as 3 in the first column of the attribute list.
  • the second column of the application identification MegaCl is identified as 2
  • the second column of the application identification Lsiutil is identified as 3.
  • the second column identification of the target identification can be determined, and when the attribute list is as shown in Table 7, the column number of the column where the target identification is located can be searched in Table 7, so that the column of the target identification is located.
  • the column number is determined as the second column ID.
  • the first column identifier of the third attribute name Replacement Required corresponding to the second hash value Hash22 is 2
  • the first column identifier of the third attribute name Capacitor Status corresponding to the second hash value Hash23 is 3
  • the attribute value corresponding to the second information string in the first attribute information can be obtained according to the preset obtaining instruction.
  • the preset obtaining instruction may be Value(Sn+2), where Sn+2 is a position identifier of the second information string in the first attribute information.
  • Value can be calculated by the information string corresponding to the position identifier to determine whether the information string is an integer type or a Boolean type.
  • j is greater than or equal to 1 and less than or equal to Y.
  • the second attribute value corresponding to the jth second attribute name is filled into the attribute list to obtain the information collection result of the first component, so that the information collection result includes each second attribute name
  • the second attribute value corresponding to each second attribute name is convenient for the operation and maintenance personnel to diagnose, repair, and warn the server directly according to the information collection results, reduce the workload of the operation and maintenance personnel, and improve the operation and maintenance efficiency of the server.
  • FIG. 8 is a first structural schematic diagram of an information collection apparatus provided by an embodiment of the present application.
  • the information collection apparatus 10 includes: a first acquisition module 101 , a second acquisition module 102 , a third acquisition module 103 and a filling module 104 , wherein,
  • the first obtaining module 101 is configured to obtain first attribute information of a first component by collecting an application program.
  • the first attribute information includes at least one first attribute name and a first attribute value corresponding to each first attribute name. for any component in the server;
  • the second obtaining module 102 is configured to obtain an attribute list corresponding to the first component, where the attribute list includes at least one second attribute name;
  • the third obtaining module 103 is configured to obtain the second attribute value corresponding to the second attribute name in the first attribute information
  • the filling module 104 is configured to fill the second attribute value into the attribute list to obtain the information collection result of the first component.
  • the information collection apparatus provided in this embodiment can be used to implement the technical solutions of the foregoing method embodiments, and the implementation principle and technical effect thereof are similar, and details are not described herein again in this embodiment.
  • FIG. 9 is a second schematic structural diagram of an information collection apparatus provided by an embodiment of the present application.
  • the information collection device 10 further includes: a query module 105 and a determination module 106 , wherein,
  • the query module 105 is configured to query at least one array card to obtain query information before acquiring the first attribute information of the first component through the acquisition application;
  • the determining module 106 is configured to determine the target identifier of the collection application program according to the query information.
  • the information collection apparatus provided in this embodiment can be used to implement the technical solutions of the foregoing method embodiments, and the implementation principle and technical effect thereof are similar, and details are not described herein again in this embodiment.
  • the third obtaining module 103 is specifically configured to:
  • the second attribute value corresponding to the second attribute name is obtained in the first attribute information.
  • the third obtaining module 103 is specifically configured to:
  • the information string division processing is performed on the first attribute information to obtain at least one information string; wherein, one row of information in the first attribute information corresponds to one information string.
  • the number of at least one information string is M, and M is greater than or equal to 1
  • the attribute list further includes the target identifier of the collection application and at least one third attribute name corresponding to the target identifier, at least one third attribute name
  • the number of three attribute names is N, M is greater than or equal to N, and N is greater than or equal to 1, and a third attribute name in the attribute list corresponds to a second attribute name.
  • j is greater than or equal to 1 and less than or equal to N;
  • the third obtaining module 103 is specifically used for:
  • the third obtaining module 103 is specifically configured to:
  • the number of at least one information string is N, and N is greater than or equal to 1
  • the attribute list further includes at least one application identifier and at least one third attribute name corresponding to each application identifier.
  • a third attribute name corresponds to a second attribute name
  • the number of at least one application identifier is M
  • M is greater than or equal to 1
  • the at least one application identifier includes the target identifier of the collection application.
  • j is greater than or equal to 1 and less than or equal to Y, where Y is the total number of the at least one second attribute name;
  • the third obtaining module 103 is specifically used for:
  • Hash conversion processing is performed on the N information strings respectively to obtain N first hash values and N first mapping relationships, wherein one information string corresponds to a first hash value, and a first hash value corresponds to a first hash value. a mapping relationship;
  • Hash conversion is performed on the M third attribute names corresponding to the jth second attribute name, respectively, to obtain M second hash values and M second mapping relationships, wherein a third attribute name corresponding to a third attribute name Two hash values, a second hash value corresponds to a second mapping relationship;
  • the third obtaining module 103 is specifically configured to:
  • the third attribute value corresponding to the third attribute name corresponding to the second target value is obtained in the first attribute information, and the third attribute value is determined as the second attribute value corresponding to the jth second attribute name, wherein , the third attribute name corresponding to the second target value corresponds to the jth second attribute name.
  • the mapping information includes at least one three-dimensional coordinate; the third acquisition module 103 is specifically configured to:
  • the target identifier in the second column identifier of the attribute list it is determined whether there is a first coordinate in at least one three-dimensional coordinate, and the first coordinate includes The first column ID and the second column ID;
  • the first coordinate determine the first information string in the first attribute information, the position identification of the first information string in the first attribute information and the first coordinate except the first column identification and the second column identification
  • the coordinate values are the same; the attribute value corresponding to the second information string in the first attribute information is determined as the third attribute value corresponding to the third attribute name corresponding to the second target value, and the second information string is the first information string after the first information string. an information string.
  • the first component includes at least one array card and at least one hard disk, wherein at least one array card includes a virtual array card, and at least one hard disk includes a virtual hard disk.
  • the query information includes the query information of the first array card and the manufacturer information of the server; the determining module 106 is specifically configured to:
  • the first application identifier is determined as the target identifier.
  • the query information further includes query information of the second array card
  • the determining module 106 is further configured to:
  • the manufacturer ID of the server is determined not to be the preset ID according to the manufacturer information, if it is determined according to the query information of the second array card that the first array card supports the second array card If it is determined that the first array card does not support the second array card according to the query information of the second array card, the third application identifier is determined as the target identifier.
  • the query information further includes query information of the third array card; the determining module 106 is further configured to:
  • the fourth application identifier is determined as the target identifier
  • the fifth application identifier is determined as the target identifier.
  • At least one array card further includes a first array card and/or a third array card, the first array card is an array card realized by hardware, and the third array card is an array card realized by software .
  • FIG. 10 is a schematic diagram of a hardware structure of a server provided by an embodiment of the present application.
  • the server 20 in this embodiment includes: a processor 201 and a memory 202; wherein
  • memory 202 stores computer-executable instructions
  • the processor 201 executes the computer-executed instructions stored in the memory 202, so that the processor 201 executes each step in the foregoing method embodiment. For details, refer to the relevant descriptions in the foregoing method embodiments.
  • the memory 202 may be independent or integrated with the processor 201 .
  • the server 20 further includes a bus 203 for connecting the memory 202 and the processor 201 .
  • Embodiments of the present application further provide a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, each step in the above method embodiment is implemented.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are only illustrative.
  • the division of modules is only a logical function division. In actual implementation, there may be other division methods.
  • multiple modules may be combined or integrated into another A system, or some feature, can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or modules, and may be in electrical, mechanical or other forms.
  • the above-mentioned integrated modules implemented in the form of software functional modules may be stored in a computer-readable storage medium.
  • the above-mentioned software function modules are stored in a storage medium, and include several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute the methods of the various embodiments of the present application. some steps.
  • processor may be a central processing unit (English: Central Processing Unit, CPU for short), and may also be other general-purpose processors, digital signal processors (English: Digital Signal Processors) Signal Processor, referred to as: DSP), application specific integrated circuit (English: Application Specific Integrated Circuit, referred to as: ASIC) and so on.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the invention can be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the memory may include high-speed RAM memory, and may also include non-volatile storage NVM, such as at least one magnetic disk memory, and may also be a U disk, a removable hard disk, a read-only memory, a magnetic disk or an optical disk, and the like.
  • NVM non-volatile storage
  • the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect, PCI) bus or Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the buses in the drawings of the present application are not limited to only one bus or one type of bus.
  • the above storage medium can be implemented by any type of volatile or non-volatile storage devices or combinations thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Except Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.
  • SRAM Static Random Access Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • EPROM Erasable Except Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic Disk Magnetic Disk or Optical Disk.
  • a storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

本申请实施例提供一种信息采集方法、装置、服务器及存储介质,该信息采集方法包括:通过采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件为服务器中的任意部件;获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称;在第一属性信息中获取第二属性名称对应的第二属性值,并将第二属性值填充至属性列表,得到第一部件的信息采集结果。用于降低运维人员的工作量,提高对服务器的运维效率。

Description

信息采集方法、装置、服务器及存储介质
本申请要求于2020年10月26日提交中国专利局、申请号为202011156016.3、申请名称为“信息采集方法、装置、服务器及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及金融科技(Fintech)服务器的技术领域,尤其涉及一种信息采集方法、装置、服务器及存储介质。
背景技术
在此处键入背景技术描述段落。随着金融科技的发展,通常采用服务器对越来越多的金融业务数据进行分析、或者处理。在通过服务器对金融数据进行处理、或者分析的过程中,通常需要对服务器进行维护。
在相关技术中,通常采用基于智能平台管理接口(Intelligent Platform Management Interface,IPMI)采集技术获取服务器中的硬件部件(例如:硬盘、处理器等)的数据信息,从而使运维人员可以根据上述数据信息对服务器进行维护。但是基于IPMI的采集技术得到的数据信息为物理机器代码,可阅读性较差,导致运维效率低。而且,由于服务器的品牌众多,不同品牌的服务器对应的数据信息中包括的部件信息(例如,处理器的温度、电池的剩余电量)在数据信息中的命名、位置等通常也不同,导致运维人员需要了解不同品牌的服务器的部件信息在不同数据信息中的命名、位置等,增加了运维人员的工作量,导致运维效率低。
技术问题
本申请实施例提供一种信息采集方法、装置、服务器及存储介质,用于降低运维人员的工作量,提高对服务器的运维效率。
第一方面,本申请实施例提供一种信息采集方法,包括:
通过采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件为服务器中的任意部件;
获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称;
在第一属性信息中获取第二属性名称对应的第二属性值,并将第二属性值填充至属性列表,得到第一部件的信息采集结果。
在一种可能实施方式中,在第一属性信息中获取第二属性名称对应的第二属性值,包括:
对第一属性信息进行信息串划分处理,得到至少一个信息串,每个信息串中包括至少一个第一属性名称和/或至少一个第一属性值;
根据第二属性名称和至少一个信息串,在第一属性信息中获取第二属性名称对应的第二属性值。
在一种可能实施方式中,对第一属性信息进行信息串划分处理,得到至少一个信息串,包括:
按照第一属性信息的行排列方式,对第一属性信息进行信息串划分处理,得到至少一个信息串;其中,第一属性信息中的一行信息对应一个信息串。
在一种可能实施方式中,至少一个信息串的个数为M,M大于或等于1,属性列表中还包括采集应用程序的目标标识和目标标识对应的至少一个第三属性名称,至少一个第三属性名称的个数为N,M大于或等于N,N大于或等于1,属性列表中的一个第三属性名称对应一个第二属性名称。
在一种可能实施方式中,针对至少一个第二属性名称中的第j个第二属性名称,j大于或等于1且小于或等于N;
根据第j个第二属性名称和至少一个信息串,在第一属性信息中获取第j个第二属性名称对应的第二属性值,包括:
判断第i个信息串中是否存与第j个第三属性名称相同的第一属性名称;其中,i大于或等于1且小于或等于M;
若是,则将与第j个第三属性名称相同的第一属性名称对应的第一属性值,确定为第j个第二属性名称对应的第二属性值,其中,第j个第三属性名称对应第j个第二属性名称。
在一种可能实施方式中,对第一属性信息进行信息串划分处理,得到至少一个信息串,包括:
根据预设字符,对第一属性信息进行拆分处理,得到至少一个信息串;其中,第一属性信息中的第一属性名称和第一属性值之间设置有预设字符,第一属性信息中的一个第一属性名称或者一个第一属性值对应一个信息串。
在一种可能实施方式中,至少一个信息串的个数为N,N大于或等于1,属性列表中还包括至少一个应用标识和每个应用标识对应的至少一个第三属性名称,属性列表中的一个第三属性名称对应一个第二属性名称,至少一个应用标识的个数为M,M大于或等于1,至少一个应用标识中包括采集应用程序的目标标识。
在一种可能实施方式中,针对至少一个第二属性名称中的第j个第二属性名称,j大于或等于1且小于或等于Y,Y为至少一个第二属性名称的总个数;
根据第j个第二属性名称和至少一个信息串,在第一属性信息中获取第j个第二属性名称对应的第二属性值,包括:
分别对N个信息串进行哈希转换处理,得到N个第一哈希值和N个第一映射关系,其中,一个信息串对应一个第一哈希值,一个第一哈希值对应一个第一映射关系;
分别对第j个第二属性名称对应的M个第三属性名称进行哈希转换处理,得到M个第二哈希值和M个第二映射关系,其中,一个第三属性名称对应的一个第二哈希值,一个第二哈希值对应一个第二映射关系;
根据N个第一哈希值、N个第一映射关系、M个第二哈希值和M个第二映射关系,在第一属性信息中获取第j个第二属性名称对应的第二属性值。
在一种可能实施方式中,根据N个第一哈希值、N个第一映射关系、M个第二哈希值和M个第二映射关系,在第一属性信息中获取第j个第二属性名称对应的第二属性值,包括:
对N个第一哈希值中和M个第二哈希值进行比较处理,得到相同的第一目标值和第二目标值,其中,第一目标值为N个第一哈希值中的哈希值,第二目标值为M个第二哈希值中的哈希值;
获取第一目标值对应的第一目标映射关系与第二目标值对应的第二目标映射关系之间的映射信息;
根据映射信息,在第一属性信息中获取第二目标值对应的第三属性名称对应的第三属性值,将第三属性值确定为第j个第二属性名称对应的第二属性值,其中,第二目标值对应的第三属性名称与第j个第二属性名称对应。
在一种可能实施方式中,映射信息中包括至少一个三维坐标;根据映射信息,在第一属性信息中获取第二目标值对应的第三属性名称对应的第三属性值,包括:
根据第二目标值对应的第三属性名称在属性列表中的第一列标识、目标标识在属性列表中的第二列标识,判断至少一个三维坐标中是否存在第一坐标,第一坐标中包括第一列标识和第二列标识;
若是,则根据第一坐标,在第一属性信息中确定第一信息串,第一信息串在第一属性信息中位置标识与第一坐标中除第一列标识和第二列标识之外的坐标值相同;将第一属性信息中的第二信息串对应的属性值确定为第二目标值对应的第三属性名称对应的第三属性值,第二信息串为第一信息串之后的第一个信息串。
在一种可能实施方式中,服务器中安装有Linux操作系统,采集应用程序安装在所述Linux操作系统中;
通过采集应用程序获取第一部件的第一属性信息,包括:在Linux操作系统中,采用带内信息获取方式,通过采集应用程序获取所述第一部件的第一属性信息。
在一种可能实施方式中,服务器中设置有第一部件对应的基础数据模型,基础数据模型中包括至少一个第二属性名称,属性列表为根据至少一个第二属性名称预先建立、并存储的在服务器中的列表。
在一种可能实施方式中,第一部件包括至少一个阵列卡和至少一个硬盘,其中,至少一个阵列卡中包括虚拟阵列卡,至少一个硬盘中包括虚拟硬盘。
在一种可能实施方式中,通过采集应用程序获取第一部件的第一属性信息之前,还包括:
对至少一个阵列卡进行查询,得到查询信息;
根据查询信息确定采集应用程序的目标标识。
在一种可能实施方式中,查询信息中包括第一阵列卡查询信息和服务器的厂商信息;根据查询信息确定采集应用程序的目标标识,包括:
在根据第一阵列卡查询信息确定服务器中存在第一阵列卡、且根据厂商信息确定服务器的厂商标识为预设标识之后,将第一应用标识确定为目标标识。
在一种可能实施方式中,查询信息中还包括第二阵列卡查询信息,方法还包括:
在根据第一阵列卡查询信息确定服务器中存在第一阵列卡、且根据厂商信息确定服务器的厂商标识不为预设标识之后,若根据第二阵列卡查询信息确定第一阵列卡支持第二阵列卡,则将第二应用标识确定为目标标识;若根据第二阵列卡查询信息确定第一阵列卡不支持第二阵列卡,则将第三应用标识确定为目标标识。
在一种可能实施方式中,查询信息中还包括第三阵列卡查询信息;根据查询信息确定采集应用程序的目标标识,包括:
若根据第一阵列卡查询信息确定服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定服务器中存在第三阵列卡,则将第四应用标识确定为目标标识;
若根据第一阵列卡查询信息确定服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定服务器中不存在第三阵列卡,则将第五应用标识确定为目标标识。
在一种可能实施方式中,至少一个阵列卡中还包括第一阵列卡和/或第三阵列卡,第一阵列卡为通过硬件实现的阵列卡,第三阵列卡为通过软件实现的阵列卡。
第二方面,本申请实施例提供一种信息采集装置,包括:
第一获取模块用于,通过采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件为服务器中的任意部件;
第二获取模块用于,获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称;
第三获取模块用于,在第一属性信息中获取第二属性名称对应的第二属性值;
填充模块用于,将第二属性值填充至属性列表,得到第一部件的信息采集结果。
在一种可能实施方式中,第三获取模块具体用于:
对第一属性信息进行信息串划分处理,得到至少一个信息串,每个信息串中包括至少一个第一属性名称和/或至少一个第一属性值;
根据第二属性名称和至少一个信息串,在第一属性信息中获取第二属性名称对应的第二属性值。
在一种可能实施方式中,第三获取模块具体用于:
按照第一属性信息的行排列方式,对第一属性信息进行信息串划分处理,得到至少一个信息串;其中,第一属性信息中的一行信息对应一个信息串。
在一种可能实施方式中,至少一个信息串的个数为M,M大于或等于1,属性列表中还包括采集应用程序的目标标识和目标标识对应的至少一个第三属性名称,至少一个第三属性名称的个数为N,M大于或等于N,N大于或等于1,属性列表中的一个第三属性名称对应一个第二属性名称。
在一种可能实施方式中,针对至少一个第二属性名称中的第j个第二属性名称,j大于或等于1且小于或等于N;
第三获取模块具体用于:
判断第i个信息串中是否存与第j个第三属性名称相同的第一属性名称;其中,i大于或等于1且小于或等于M;
若是,则将与第j个第三属性名称相同的第一属性名称对应的第一属性值,确定为第j个第二属性名称对应的第二属性值,其中,第j个第三属性名称对应第j个第二属性名称。
在一种可能实施方式中,第三获取模块具体用于:
根据预设字符,对第一属性信息进行拆分处理,得到至少一个信息串;其中,第一属性信息中的第一属性名称和第一属性值之间设置有预设字符,第一属性信息中的一个第一属性名称或者一个第一属性值对应一个信息串。
在一种可能实施方式中,至少一个信息串的个数为N,N大于或等于1,属性列表中还包括至少一个应用标识和每个应用标识对应的至少一个第三属性名称,属性列表中的一个第三属性名称对应一个第二属性名称,至少一个应用标识的个数为M,M大于或等于1,至少一个应用标识中包括采集应用程序的目标标识。
在一种可能实施方式中,针对至少一个第二属性名称中的第j个第二属性名称,j大于或等于1且小于或等于Y,Y为至少一个第二属性名称的总个数;
第三获取模块具体用于:
分别对N个信息串进行哈希转换处理,得到N个第一哈希值和N个第一映射关系,其中,一个信息串对应一个第一哈希值,一个第一哈希值对应一个第一映射关系;
分别对第j个第二属性名称对应的M个第三属性名称进行哈希转换处理,得到M个第二哈希值和M个第二映射关系,其中,一个第三属性名称对应的一个第二哈希值,一个第二哈希值对应一个第二映射关系;
根据N个第一哈希值、N个第一映射关系、M个第二哈希值和M个第二映射关系,在第一属性信息中获取第j个第二属性名称对应的第二属性值。
在一种可能实施方式中,第三获取模块具体用于:
对N个第一哈希值中和M个第二哈希值进行比较处理,得到相同的第一目标值和第二目标值,其中,第一目标值为N个第一哈希值中的哈希值,第二目标值为M个第二哈希值中的哈希值;
获取第一目标值对应的第一目标映射关系与第二目标值对应的第二目标映射关系之间的映射信息;
根据映射信息,在第一属性信息中获取第二目标值对应的第三属性名称对应的第三属性值,将第三属性值确定为第j个第二属性名称对应的第二属性值,其中,第二目标值对应的第三属性名称与第j个第二属性名称对应。
在一种可能实施方式中,映射信息中包括至少一个三维坐标;第三获取模块具体用于:
根据第二目标值对应的第三属性名称在属性列表中的第一列标识、目标标识在属性列表中的第二列标识,判断至少一个三维坐标中是否存在第一坐标,第一坐标中包括第一列标识和第二列标识;
若是,则根据第一坐标,在第一属性信息中确定第一信息串,第一信息串在第一属性信息中位置标识与第一坐标中除第一列标识和第二列标识之外的坐标值相同;将第一属性信息中的第二信息串对应的属性值确定为第二目标值对应的第三属性名称对应的第三属性值,第二信息串为第一信息串之后的第一个信息串。
在一种可能实施方式中,服务器中安装有Linux操作系统,采集应用程序安装在所述Linux操作系统中;所述第一获取模块具体用于:
在Linux操作系统中,采用带内信息获取方式,通过采集应用程序获取所述第一部件的第一属性信息。
在一种可能实施方式中,服务器中设置有第一部件对应的基础数据模型,基础数据模型中包括至少一个第二属性名称,属性列表为根据至少一个第二属性名称预先建立、并存储的在服务器中的列表。
在一种可能实施方式中,第一部件包括至少一个阵列卡和至少一个硬盘,其中,至少一个阵列卡中包括虚拟阵列卡,至少一个硬盘中包括虚拟硬盘。
在一种可能实施方式中,信息采集装置还包括:查询模块和确定模块,其中,查询模块用于,在通过采集应用程序获取第一部件的第一属性信息之前对至少一个阵列卡进行查询,得到查询信息;
确定模块用于,根据查询信息确定采集应用程序的目标标识。
在一种可能实施方式中,查询信息中包括第一阵列卡查询信息和服务器的厂商信息;确定模块具体用于:
在根据第一阵列卡查询信息确定服务器中存在第一阵列卡、且根据厂商信息确定服务器的厂商标识为预设标识之后,将第一应用标识确定为目标标识。
在一种可能实施方式中,查询信息中还包括第二阵列卡查询信息,确定模块还用于:
在根据第一阵列卡查询信息确定服务器中存在第一阵列卡、且根据厂商信息确定服务器的厂商标识不为预设标识之后,若根据第二阵列卡查询信息确定第一阵列卡支持第二阵列卡,则将第二应用标识确定为目标标识;若根据第二阵列卡查询信息确定第一阵列卡不支持第二阵列卡,则将第三应用标识确定为目标标识。
在一种可能实施方式中,查询信息中还包括第三阵列卡查询信息;确定模块还用于:
若根据第一阵列卡查询信息确定服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定服务器中存在第三阵列卡,则将第四应用标识确定为目标标识;
若根据第一阵列卡查询信息确定服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定服务器中不存在第三阵列卡,则将第五应用标识确定为目标标识。
在一种可能实施方式中,至少一个阵列卡中还包括第一阵列卡和/或第三阵列卡,第一阵列卡为通过硬件实现的阵列卡,第三阵列卡为通过软件实现的阵列卡。
第三方面,本申请实施例提供一种服务器,包括:存储器和处理器;
存储器存储计算机执行指令;
处理器执行存储器存储的计算机执行指令,使得处理器执行第一方面中任一项的方法。
第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,当计算机执行指令被处理器执行时实现第一方面中任一项的方法。
本申请提供一种信息采集方法、装置、服务器及存储介质,该信息采集方法包括:通过采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件为服务器中的任意部件;获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称;在第一属性信息中获取第二属性名称对应的第二属性值,并将第二属性值填充至属性列表,得到第一部件的信息采集结果。在上述方法中,从第一属性信息中获取第二属性名称对应的第二属性值,将第二属性值填充至属性列表得到第一部件的信息采集结果,使得信息采集结果中包括每个第二属性名称和每个第二属性名称对应的第二属性值,从而实现了信息采集的规范、完整性,便于运维人员直接根据信息采集结果,对服务器进行诊断、维修、预警等,降低运维人员的工作量,提高对服务器的运维效率。。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的信息采集方法的应用场景示意图;
图2为本申请实施例提供的信息采集方法的流程示意图一;
图3为本申请实施例提供的信息采集方法的流程示意图二;
图4为本申请实施例提供的确定应用标识的流程示意图;
图5为本申请实施例提供的基础数据模型的结构示意图;
图6为本申请实施例提供的信息采集方法的流程示意图三;
图7为本申请实施例提供的信息采集方法的流程示意图四;
图8为本申请实施例提供的信息采集装置的结构示意图一;
图9为本申请实施例提供的信息采集装置的结构示意图二
图10为本申请实施例提供的服务器的硬件结构示意图。
本发明的实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和/或权利要求书及上述附图中的术语“第一”、“第二”、“第三”和“第四”(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
图1为本申请实施例提供的信息采集方法的应用场景示意图。如图1所示,包括:服务器10。服务器10包括存储器和显示设备,服务器10中安装有linux系统和至少一个采集应用程序,服务器10中还可以设置有内存(memery)、处理器(Central Processing Unit,CPU)、阵列卡(即RAID卡)、硬盘(DISK)和基础数据模型等。其中,存储器可以用于存储第一部件的属性列表和第一属性信息,显示设备可以用于向用户展示第一部件的信息采集结果,基础数据模型可以用于构建第一部件的属性列表。对基础数据模型的详细说明可以参见图5实施例。
在本申请中,例如需要得到第一部件的信息采集结果时,首先获取第一部件的属性列表和第一属性信息,其中,属性列表包括第一部件对应的至少一个属性名称;其次在第一属性信息中获取每个属性名称对应的属性值;进而将属性值填充到属性列表中,得到第一部件的信息采集结果。在本申请中,至少一个属性名称为运维人员可阅读的名称(例如,属性名称为battery_state,即电池状态对应的英文单词组合),而且每个属性名称和其对应的属性值在属性列表中的位置固定,至少一个属性名称在属性列表中的名称固定,可以降低运维人员的工作量,提高运维效率。
下面,通过具体实施例对本申请所示的技术方案进行详细说明。需要说明的是,下面几个具体实施例可以相互结合,对于相同或相似的内容,在不同的实施例中不再进行重复说明。
图2为本申请实施例提供的信息采集方法的流程示意图一。如图2所示,本实施例提供的信息采集方法包括:
S201、通过采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件为服务器中的任意部件。
可选地,本申请实施例的执行主体可以为服务器,也可以为设置在服务器中的信息采集装置,信息采集装置可以通过软件和/或硬件的结合来实现。其中,服务器中安装有Linux操作系统,采集应用程序安装在Linux操作系统中。
可选地,采集应用程序可以是自研的计算机应用程序,也可以为MegaCli工具、Lsiutil工具、Hpacucli工具、Mdadm工具、Smartmontools工具中任意一种。具体的,采集应用程序为与服务器匹配的应用程序。具体的,每个采集应用程序具有各自对应的应用标识(例如,MegaCli工具的应用标识可以为MegaCli),在实际中,可以先确定目标标识,进而将具有目标标识的采集应用程序确定为与服务器匹配的应用程序。其中,确定目标标识的方法可以参见图3实施例中的S301~S302。
可选地,第一部件可以为处理器、内存等,还可以为包括阵列卡、硬盘、虚拟阵列卡和虚拟硬盘等中的任意至少一个的部件。
其中,第一属性名称为通过采集应用程序采集得到第一部件的属性关键字对应的名称。需要说明的是,不同采集应用程序采集的同一个属性关键字对应的第一属性名称可能不同。
例如,属性关键字为当前缓存策略,MegaCli工具采集得到第一属性名称为Current Cache(即当前缓存策略),通过Lsiutil工具采集得到第一属性名称为Current Cache。
在一种可能的实施方式中,通过采集应用程序获取第一部件的第一属性信息的方法,具体可以为:在Linux操作系统中,采用带内信息获取方式,通过采集应用程序获取第一部件的第一属性信息。
在上述带内信息获取方式中,服务器的控制数据(即第一属性信息)和用户业务数据信息在相同的链路传送,可以节省服务器的链路资源,提高信息采集效率。
与现有技术不同,在现有技术中,基于IPMI采集技术,通过带外信息获取方法,获取服务器中硬件部件的数据信息,在带外信息获取方法中,服务器的控制数据(硬件部件的数据信息)与用户业务数据在不同的链路传送,导致服务器的链路资源浪费,降低信息采集效率。而在本申请中,通过带内信息获取方法,可以节省服务器的链路资源,提高信息采集效率。
S202、获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称。
其中,属性列表为服务器预先存储的列表。
其中,至少一个第二属性名称为第一部件对应的关键技术指标的名称,每个第二属性名称为开发人员预先定义的、且运维人员可以识别的名称,每个第二属性名称在属性列表的位置、名称、格式等固定不变。例如,第二属性名称为current_cache_policy,运维人员可以根据其字面意思确定其为当前缓存策略。
需要说明的是,当需要通过本申请提供的信息采集方法,得到服务器中阵列卡和硬盘(即第一部件的)信息采集结果时,默认为本申请中的服务器中存在虚拟阵列卡和虚拟硬盘,此时,第一部件对应的属性列表可以如下表1所示。
表1
Figure 812882dest_path_image001
可选地,属性列表还可以包括多个应用标识和每个应用标识对应的至少一个第三属性名称,每个第三属性名称具有各自对应的第二属性名称。
其中,至少一个第三属性名称为开发人员对第一属性信息中的至少一个第一属性名称进行归纳统计得到的,即至少一个第三属性名称和至少一个第一属性名称相同。
可选地,第三属性名称与第二属性名称之间的对应关系为开发人员通过采用不同采集应用程序对第一部件进行采集实验得到的。
可选地,当应用标识分别为MegaCl、Lsiutil、Hpacucli、Mdadm、Smartmontools时,属性列表还可以如下表2和表3所示。
表2
Figure 822427dest_path_image002
表3
Figure 59373dest_path_image003
在上述表3中,应用标识所在列中的“--”表示没有第二属性名称对应的第三属性名称。需要说明的是,上述表1、表2和表3中的任意至少两个表格可以结合起来形成新的表格,此处不再进行赘述。
在一种可能的实施方式中,服务器中设置有第一部件对应的基础数据模型,基础数据模型中包括所述至少一个第二属性名称,属性列表为根据至少一个第二属性名称预先建立、并存储的在服务器中的列表。对基础数据模型的详细说明,可以参见图5实施例。
S203、在第一属性信息中获取第二属性名称对应的第二属性值,并将第二属性值填充至属性列表,得到第一部件的信息采集结果。
需要说明的是,在通过采集应用程序(具有目标标识)获取的第一属性信息中,至少一个第一属性名称中存在与目标标识对应的第三属性名称相同的一个第一属性名称。
可选地,可以在第一属性信息中确定第三属性名称对应的第一属性名称,将第一属性信息中第三属性名称对应的第一属性名称的第一属性值,确定为第三属性名称对应的第二属性名称的第二属性值,并将该第二属性名称的第二属性值填充至表1所示的属性列表中,从而得到第一部件的信息采集结果。
可选地,上述所示的属性列表中还可以包括每个第二属性名称对应的默认值,若确定出第二属性名称对应的第二属性值,则将第二属性名称对应的默认值替换为该第二属性名称对应的第二属性值,从而得到第一部件的信息采集结果;若未确定出第二属性名称对应的第二属性值,则将第二属性名称对应的默认值确定为该第二属性名称对应的第二属性值,从而得到第一部件的信息采集结果。例如,包括每个第二属性名称各自对应的默认值的属性列表可以如下表4所示。
表4
Figure 473168dest_path_image004
可选地,上述表1、表2、表3和表4中的任意至少两个表格可以结合,从而形成新的表格,此处不再详述。
本实施例提供的信息采集方法包括:通过采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件为服务器中的任意部件;获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称;在第一属性信息中获取第二属性名称对应的第二属性值,并将第二属性值填充至属性列表,得到第一部件的信息采集结果。在上述方法中,从第一属性信息中获取第二属性名称对应的第二属性值,将第二属性值填充至属性列表得到第一部件的信息采集结果,使得信息采集结果中包括每个第二属性名称和每个第二属性名称对应的第二属性值,从而实现了信息采集的规范、完整性,便于运维人员直接根据信息采集结果,对服务器进行诊断、维修、预警等,降低运维人员的工作量,提高对服务器的运维效率。
与现有技术不同,在现有技术中,在采用基于IPMI的采集技术对不同的服务器中的硬件部件进行信息采集得到的数据信息中,相同的部件信息在不同服务器对应的数据信息中的命名、格式、位置等通常不同,无法使得相同的部件信息在不同服务器对应的数据信息中的命名、格式、位置等也相同,也无法实现对不同的服务器进行统一管理。在本申请中,获取第一部件对应的属性列表,在第一属性信息中获取第二属性名称对应的第二属性值,并将第二属性值填充至属性列表得到第一部件的信息采集结果,可以使得相同的第二属性名称(即部件信息)在不同服务器对应的信息采集结果(即数据信息)中的命名、格式、位置等也相同,实现对不同的服务器进行统一管理。
在上述实施例的基础上,下面结合图3,以第一部件包括至少一个阵列卡和至少一个硬盘、至少一个阵列卡中包括虚拟阵列卡、至少一个硬盘中包括虚拟硬盘为例,对本申请提供的信息采集方法进行详细说明。
图3为本申请实施例提供的信息采集方法的流程示意图二。如图3所示,本实施例提供的信息采集方法包括:
S301、对服务器中至少一个阵列卡进行查询,得到查询信息。
可选地,查询信息中可以包括第一阵列卡查询信息、服务器的厂商信息、第二阵列卡查询信息、第三阵列卡查询信息中的任意至少一个信息。
S302、根据查询信息确定采集应用程序的目标标识。
在一种可能的实施方式中,查询信息中包括第一阵列卡查询信息和服务器的厂商信息;根据查询信息确定采集应用程序的目标标识,包括:
在根据第一阵列卡查询信息确定服务器中存在第一阵列卡、且根据厂商信息确定服务器的厂商标识为预设标识之后,将第一应用标识确定为目标标识。
在另一种可能的实施方式中,查询信息中还包括第二阵列卡查询信息,方法还包括:在根据第一阵列卡查询信息确定服务器中存在第一阵列卡、且根据厂商信息确定服务器的厂商标识不为预设标识之后,若根据第二阵列卡查询信息确定第一阵列卡支持第二阵列卡,则将第二应用标识确定为目标标识;若根据第二阵列卡查询信息确定第一阵列卡不支持第二阵列卡,则将第三应用标识确定为目标标识。
在另一种可能的实施方式中,查询信息中还包括第三阵列卡查询信息;根据查询信息确定采集应用程序的目标标识,包括:
若根据第一阵列卡查询信息确定服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定服务器中存在第三阵列卡,则将第四应用标识确定为目标标识;
若根据第一阵列卡查询信息确定服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定服务器中不存在第三阵列卡,则将第五应用标识确定为目标标识。
具体的,对S301~S302执行过程的详细说明请参见图4实施例,此处不再进行赘述。
S303、通过目标标识对应的采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件包括至少一个阵列卡和至少一个硬盘,至少一个阵列卡中包括虚拟阵列卡,至少一个硬盘中包括虚拟硬盘。
可选地,在确定出目标标识之后,可以启动目标标识对应的采集应用程序,并通过目标标识对应的采集应用程序获取第一部件的第一属性信息。
S304、获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称。
具体的,对基础数据模型的详细说明,请参见图5实施例。
S305、对第一属性信息进行信息串划分处理,得到至少一个信息串,每个信息串中包括至少一个第一属性名称和/或至少一个第一属性值。
具体的,对S305说明可以参见图6实施例中的S605、或者图7实施例中的S705。
S306、根据第二属性名称和至少一个信息串,在第一属性信息中获取第二属性名称对应的第二属性值,并将第二属性值填充至属性列表,得到第一部件的信息采集结果。
具体的,对S306说明可以参见图6实施例中的S606~S613、或者图7实施例中的S706~S712。
本实施例提供的信息采集方法中,获取第一部件的第一属性信息和第一部件的对应的属性列表,并对第一属性信息进行信息串划分处理,得到至少一个信息串,进而根据第二属性名称和至少一个信息串,在第一属性信息中获取第二属性名称对应的第二属性值,可以精准找到每个第二属性名称对应的第二属性值。进一步地,从第一属性信息中获取第二属性名称对应的第二属性值,将第二属性值填充至属性列表得到第一部件的信息采集结果,使得信息采集结果中包括每个第二属性名称和每个第二属性名称对应的第二属性值,从而实现了信息采集的规范、完整性,便于运维人员直接根据信息采集结果,对服务器进行诊断、维修、预警等,降低运维人员的工作量,提高对服务器的运维效率。
在上述实施例的基础上,下面结合图4,对上述S301~S302的执行过程做进一步地详细介绍,具体的,请参见图4实施例。
图4为本申请实施例提供的确定应用标识的流程示意图。如图4所示,本实施例提供的确定应用标识的方法包括:
S401、获取第一阵列卡查询信息。
可选地,可以通过第一指令从外设部件互连标准(Peripheral Component Interconnect,PCI)总线设备上获取第一阵列卡查询信息。例如,第一指令可以为:lspci |grep -i raid。
S402、根据第一阵列卡查询信息判断服务器中是否存在第一阵列卡。
若是,则执行S403~S409。
若否,则执行S4010~ S413。
例如,若第一阵列卡查询信息为:空(即NULL),则确定服务器中不存在第一阵列卡,若第一阵列卡查询信息中包括:MegaRAID SAS-3 3108,则确定服务器中存在第一阵列卡、且第一阵列卡的型号为:SAS-3 3108。
可选地,还可以根据是否获取到第一阵列卡查询信息确定服务器中是否存在第一阵列卡。例如,若执行完第一指令之后未获取到第一阵列卡查询信息,则确定服务器中不存在第一阵列卡,若执行完第一指令之后获取到第一阵列卡查询信息、且获取到的第一阵列卡查询信息中包括:MegaRAID SAS-3 3108,则确定服务器中存在第一阵列卡、第一阵列卡的型号为:SAS-3 3108。
S403、获取服务器的厂商信息。
可选地,可以通过第二指令获取服务器的厂商信息。例如,第二指令可以为dmicode -t1。
S404、根据厂商信息判断服务器的厂商标识是否为预设标识。
若是,则执行S405。
若否,则执行S406~S409。
可选地,预设标识可以为服务器的品牌名称。例如,当预设标识为HX时,若厂商信息中包括:Procuct Name:Len RD350,则确定服务器的厂商标识为:Len、服务器的型号为:RD350,进一步地,由于厂商标识为Len与预设标识HX不同,因此可以确定服务器的厂商标识不为预设标识。
S405、将第一应用标识确定为目标标识。
其中,第一应用标识为Hpacucli工具的应用标识。
S406、获取第二阵列卡查询信息。
可选地,可以通过第三指令从小型计算机系统接口(Small Computer System Interface,SCSI)中获取第二阵列卡查询信息。例如,第三指令可以为:cat /proc/scsi/scsi。
S407、根据第二阵列卡查询信息判断第一阵列卡是否支持第二阵列卡。
若是,则执行S408。
若否,则执行S409。
其中,第一阵列卡为服务器中通过硬件实现的阵列卡,
可选地,第二阵列卡查询信息中包括第一阵列卡的级别。例如,当第二阵列卡查询信息中包括:revision:10时,第一阵列卡的级别为:10。
可选地,第二阵列卡为具有预设级别的阵列卡,例如,预设级别可以为:5,还可以为其他。
可选地,可以根据第二阵列卡查询信息和第二阵列卡的预设级别,确定第一阵列卡是否支持第二阵列卡。具体的,在服务器中预先存储级别列表,该级别列表中包括预设级别和该预设级别对应的至少一个级别,其中,至少一个级别中的每个级别对应的第一阵列卡均为能够支持具有该预设级别的第二阵列卡。
进一步地,在第二阵列卡查询信息中获取目标级别,在至少一个级别中查找目标级别,若在至少一个级别中查找到目标级别,则确定第一阵列卡支持第二阵列卡,若在至少一个级别中查找不到目标级别,则确定第一阵列卡不支持第二阵列卡。
S408、将第二应用标识确定为目标标识。
其中,第二应用标识为Lsiutil工具的应用标识,
S409、将第三应用标识确定为目标标识。
其中,第三应用标识为MegaCli工具的应用标识。
S410、获取第三阵列卡查询信息。
可选地,可以通过第四指令获取第三阵列卡查询信息。例如,第四指令可以为:cat /proc/mdstat。
S411、根据第三阵列卡查询信息判断服务器中是否存在第三阵列卡。
若是,则执行S412。
若否,则执行S413。
其中,第三阵列卡为服务器中通过软件实现的阵列卡。
可选地,可以根据第三阵列卡查询信息中是否包括关键字md0,来确定服务器中是否存在第三阵列卡。例如,若第三阵列卡查询信息中包括关键字md0,则确定服务器中存在第三阵列卡,若第三阵列卡查询信息中不包括关键字md0,则确定服务器中不存在第三阵列卡。
进一步地,当第三阵列卡查询信息中包括关键字md0时,第三阵列卡查询信息中通常还包括阵列(RAID)值。在实际中,可以根据阵列值确定第三阵列卡的级别。例如,若阵列值为raid 10,则确定第三阵列卡的级别为10。
S412、将第四应用标识确定为目标标识。
其中,第四应用标识为Mdadm工具的应用标识。
S413、将第五应用标识确定为目标标识。
其中,第五应用标识为Smartmontools工具的应用标识。
在上述实施例的基础上,下面以第一部件包括至少一个阵列卡和至少一个硬盘、至少一个阵列卡中包括虚拟阵列卡、至少一个硬盘中包括虚拟硬盘为例,结合图5,对基础数据模型进行说明。
图5为本申请实施例提供的基础数据模型的结构示意图。如图5所示,基础数据模型包括:虚拟阵列卡对应的第二属性名称、以及虚拟硬盘对应的第二属性名称。
其中,虚拟硬盘为虚拟阵列卡的第二属性名称pd_list之下一个属性,该第二属性名称pd_list可以对应的多个虚拟硬盘(即服务器中的虚拟磁盘组是挂载在虚拟阵列卡下的一个属性)。图5仅示例性的示出一个虚拟硬盘。
需要说明的是,在执行本申请所示的信息采集方法之前,可以预先构建基础数据模型,可以将虚拟硬盘和虚拟阵列卡联系在一起,将服务器中的各种软硬场景(例如包括:具有第一阵列卡和硬盘,具有第三阵列卡和硬盘,具有第一阵列卡、第三阵列卡和硬盘,仅具有硬盘等中的任意一种场景)统一,实现对服务器中的硬盘和阵列卡的关键技术指标进行汇总。
在上述实施例的基础上,下面结合图6对本申请提供的信息采集方法进行详细地说明。具体的,请参见图6实施例。
图6为本申请实施例提供的信息采集方法的流程示意图三。如图6所示,本实施例提供的信息采集方法包括:
S601、对服务器中的至少一个阵列卡进行查询,得到查询信息。
S602、根据查询信息确定采集应用程序的目标标识。
具体的,S601~S602的执行方法可以参见上述图4实施例,此处不再进行赘述。
S603、通过目标标识对应的采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件包括至少一个阵列卡和至少一个硬盘,至少一个阵列卡中包括虚拟阵列卡,至少一个硬盘中包括虚拟硬盘。
S604、获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称、采集应用程序的应用标识、以及应用标识对应的至少一个第三属性名称,至少一个第三属性名称的个数为N,N大于或等于1,属性列表中的一个第三属性名称对应一个第二属性名称。
例如,本实施例所示的属性列表可以如下表5所示。需要说明的是,表5仅示例性的示出列表的一部分。
表5
Figure 670931dest_path_image005
在表5中,第二列中包括采集应用程序的应用标识:Hpacucli,以及应用标识对应的至少一个第三属性名称(分别为:Capacitor Status、Battery Count、Capacitor Status、Capacitor Count、Temperature)。
S605、按照第一属性信息的行排列方式,对第一属性信息进行信息串划分处理,得到至少一个信息串,第一属性信息中的一行信息对应一个信息串,每个信息串中包括至少一个第一属性名称和/或至少一个第一属性值至少一个信息串的个数为M,M大于或等于1,M大于或等于N。
S606、判断第i个信息串中是否存与第j个第三属性名称相同的第一属性名称,第j个第三属性名称与第j个第二属性名称对应。
若是,则执行S607。
若否,则执行S608。
可选地,在S606之前还可以先获取第i个信息串和第j个第三属性名称。
需要说明的是,初始时,i=1,j=1。
可选地,上述表5中还可以包括其他采集应用程序对应的应用标识、以及应用标识对应的至少一个第三属性名称。在实际中,当上述表5中包括其他采集应用程序对应的应用标识、以及应用标识对应的至少一个第三属性名称时,在执行完S602之后,可以在表5中,将确定出的应用标识对应的每个第三属性名称的标志位设置为预设值(例如,预设值可以为1、2、3),进一步地,在执行S606时,可以判断第i个信息串中是否存与预设值对应的第j个第三属性名称相同的第一属性名称。
S607、将与第j个第三属性名称相同的第一属性名称对应的第一属性值,确定为第j个第三属性名称对应的第j个第二属性名称对应的第二属性值。
可选地,可以通过预设获取指令获取第j个第三属性名称相同的第一属性名称对应的第一属性值,其中,该预设获取指令可以为:re.findall()。
S608、判断j是否大于或等于N。
若否,则执行S609。
若是,则执行S610。
S609、更新j,j=j+1。
S610、判断i是否大于或等于M。
若否,则执行S611。
若否,则执行S612。
S611、更新i,i=i+1;更新j,j=1。
S612、将第j个第二属性名称对应默认值确定为第j个第二属性名称对应的第二属性值。
可选地,上述表5中还可以包括每个第二属性名称对应的默认值。当表5中包括每个第二属性名称对应的默认值时,属性列表可以如下表6所示。
表6
Figure 484166dest_path_image006
S613、将第j个第二属性名称对应的第二属性值填充至属性列表,得到第一部件的信息采集结果。
具体的,将第j个第二属性名称对应的第二属性值填充至属性列表中第j个第二属性名称对应的第二属性值所在的单元格中。
在本实施例提供的信息采集方法中,执行S606,判断第i个信息串中是否存与第j个第三属性名称相同的第一属性名称,第j个第三属性名称与第j个第二属性名称对应;并更新i和j,重复执行S606,可以准确地确定出第j个第二属性名称对应的第二属性值。进一步地,将第j个第二属性名称对应的第二属性值填充至属性列表得到第一部件的信息采集结果,使得信息采集结果中包括每个第二属性名称和每个第二属性名称对应的第二属性值,从而实现了信息采集的规范、完整性,便于运维人员直接根据信息采集结果,对服务器进行诊断、维修、预警等,降低运维人员的工作量,提高对服务器的运维效率。
在上述实施例的基础上,下面结合图7对本申请提供的信息采集方法进行详细地说明。具体的,请参见图7实施例。
图7为本申请实施例提供的信息采集方法的流程示意图。如图7所示,本实施例提供的信息采集方法包括:
S701、对服务器中的至少一个阵列卡进行查询,得到查询信息。
S702、根据查询信息确定采集应用程序的目标标识。
S703、通过目标标识对应的采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件包括至少一个阵列卡和至少一个硬盘,至少一个阵列卡中包括虚拟阵列卡,至少一个硬盘中包括虚拟硬盘。
具体的,S701~S703的执行方法可以参见上述S601~S603的执行方法,此处不再进行赘述。
S704、获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称、至少一个应用标识和每个应用标识对应的至少一个第三属性名称,属性列表中的一个第三属性名称对应一个第二属性名称,至少一个应用标识的个数为M,M大于或等于1,至少一个应用标识中包括目标标识。
例如,当M=2时,本实施例中的属性列表可以如下表7所示。需要说明的是,表7仅示例性的示出列表的一部分。
表7
Figure 575619dest_path_image007
可选地,上述表7中还可以包括每个第二属性值对应的默认值,以及应用标识Hpacucli、应用标识Mdadm和应用标识Smartmontools各自对应的第三属性名称。
S705、根据预设字符,对第一属性信息进行拆分处理,得到至少一个信息串,其中,第一属性信息中的第一属性名称和第一属性值之间设置有预设字符,第一属性信息中的一个第一属性名称或者一个第一属性值对应一个信息串,至少一个信息串的个数为N,N大于或等于1。
例如,当第一属性信息为:Capacitor Status(预设字符)Fasle(预设字符) Battery Count(预设字符)present时,可以将根据预设字符,对第一属性信息进行拆分处理,得到4个信息串(分别为:Capacitor Status、Fasle、Battery Count、present)。
S706、分别对N个信息串哈希转换处理,得到N个第一哈希值和N个第一映射关系,其中,一个第一哈希值对应一个第一映射关系。
具体的,分别对N个信息串(记为:Sn,n为信息串的索引(即位置标识),n取值为1~N之间的整数)哈希转换处理之后,得到的N个第一哈希值(记为:Hashn)和N个第一映射关系(记为:On),其中,一个信息串对应的一个第一哈希值,一个第一哈希值对应一个第一映射关系。例如,n=1时,S1对应的Hash1,Hash1对应O1。
例如,N=4时,分别对4个信息串(依次分别为:S1、S2、S3、S4)哈希转换处理之后,得到的4个第一哈希值(依次分别为:Hash1、Hash2、Hash3、Hash4)和4个第一映射关系(依次分别为:O1、O2、O3、O4)。
S707、获取至少一个第二属性名称中的第j个第二属性名称。
S708、分别对第j个第二属性名称对应的M个第三属性名称进行哈希转换处理,得到M个第二哈希值和M个第二映射关系,其中,一个第二哈希值对应一个第二映射关系。
例如,当j=1时,第1个第二属性名称对应的2个第三属性名称分别为Replacement Required、Capacitor Status。
具体的,分别对第j个第二属性名称对应的M个第三属性名称(记为:Qk,k为第三属性名称所在列的第一列标识)进行哈希转换处理,得到M个第二哈希值(记为:Hashjk)和M个第二映射关系(记为:Djk)。
例如,当j=2、M=2时,分别对2个第三属性名称(依次分别为Replacement Required、Capacitor Status)进行哈希转换处理,得到2个第二哈希值(依次分别为:Hash22、Hash23)和2个第二映射关系(依次分别为:D22、D23)。
S709、对N个第一哈希值中和M个第二哈希值进行比较处理,得到相同的第一哈希值和第二哈希值,其中,第一哈希值为N个第一哈希值中的哈希值,第二哈希值为M个第二哈希值中的哈希值。
例如,j=2、N=4、M=2时,对4个第一哈希值中和2个第二哈希值进行比较处理,可以得到相同的第一哈希值Hash2、第二哈希值Hash21和Hash22(即第一哈希值Hash2分别与第二哈希值Hash22和Hash23相同)。
S710、获取第一哈希值对应的第一目标映射关系与第二哈希值对应的第二目标映射关系之间的映射信息。
可选地,映射信息为根据第一目标映射关系和第二目标映射关系确定的三维坐标Pjkn。例如,当第一哈希值为Hash2、第二哈希值分别为Hash22和Hash23时,若第一目标映射关系为O2,第二目标映射关系分别为D22和D22,则确定的映射信息中包括三维坐标P222(即:j=2、k=2、n=2)和三维坐标P232(即:j=2、k=3、n=2)。
S711、根据映射信息,在第一属性信息中获取第二哈希值对应的第三属性名称对应的第三属性值,将第二哈希值对应的第三属性名称对应的第三属性值确定为第j第二属性名称对应的第二属性值,将第j第二属性名称对应的第二属性值填充至属性列表,得到第一部件的信息采集结果,其中,第二哈希值对应的第三属性名称与第j第二属性名称对应。
在一种可能的实施例中,根据映射信息,在第一属性信息中获取第二哈希值对应的第三属性名称对应的第三属性值,包括:
根据第二目标值对应的第三属性名称在属性列表中的第一列标识、目标标识在属性列表中的第二列标识,判断至少一个三维坐标是否存在第一坐标,第一坐标中包括第一列标识和第二列标识;
若是,则根据第一坐标,在第一属性信息中确定第一信息串,第一信息串在第一属性信息中位置标识与第一坐标中除第一列标识和第二列标识之外的坐标值相同;将第一属性信息中的第二信息串对应的属性值确定为第二目标值对应的第三属性名称对应的第三属性值,第二信息串为第一信息串之后的第一个信息串。第二信息串与第一信息串之间设置有预设字符。
若否,则将第j个第二属性名称对应的默认值确定为第j第二属性名称对应的第二属性值。
例如,第二哈希值Hash22对应的第三属性名称Replacement Required在属性列表中的第一列标识为2,第二哈希值Hash23对应的第三属性名称Capacitor Status在属性列表中的第一列标识为3。例如,应用标识MegaCl的第二列标识为2,应用标识Lsiutil的第二列标识为3。
可选地,在执行完S702之后可以确定目标标识的第二列标识,当属性列表如表7所示时,可以在表7中查找目标标识所在列的列号,从而将目标标识所在列的列号确定为第二列标识。例如,当映射信息包括的两个三维坐标分别为:三维坐标P222(即:j=2、k=2、n=2)和三维坐标P232(即:j=2、k=3、n=2)时,若第二哈希值Hash22对应的第三属性名称Replacement Required的第一列标识为2、第二哈希值Hash23对应的第三属性名称Capacitor Status的第一列标识为3、目标标识的第二列标识为2,则确定两个三维坐标中包括第一坐标P222(即k=2时对应的三维坐标)。
具体的,根据上述第一坐标P222,可以确定第一信息串在第一属性信息中的位置标识为Sn(其中,n=2)。进一步地,可以根据预设获取指令获取第一属性信息中的第二信息串对应的属性值。例如,预设获取指令可以为Value(Sn+2),其中,Sn+2为第二信息串在第一属性信息中的位置标识。需要说明的是,Value可以位置标识对应的信息串进行计算,以确定信息串为整型还是布尔型。
S712、更新j,j=j+1,重复执行Y次S707~S712,直至的将每个第二属性名称对应的第二属性值填充至属性列表,得到第一部件的信息采集结果,其中,Y为至少一个第二属性名称的总个数。
其中,j大于或等于1且小于或等于Y。
在本实施例提供的信息采集方法中,将第j个第二属性名称对应的第二属性值填充至属性列表得到第一部件的信息采集结果,使得信息采集结果中包括每个第二属性名称和每个第二属性名称对应的第二属性值,便于运维人员直接根据信息采集结果,对服务器进行诊断、维修、预警等,降低运维人员的工作量,提高对服务器的运维效率。
图8为本申请实施例提供的信息采集装置的结构示意图一。如图8所示,信息采集装置10包括:第一获取模块101、第二获取模块102、第三获取模块103和填充模块104,其中,
第一获取模块101用于,通过采集应用程序获取第一部件的第一属性信息,第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,第一部件为服务器中的任意部件;
第二获取模块102用于,获取第一部件对应的属性列表,属性列表中包括至少一个第二属性名称;
第三获取模块103用于,在第一属性信息中获取第二属性名称对应的第二属性值;
填充模块104用于,将第二属性值填充至属性列表,得到第一部件的信息采集结果。
本实施例提供的信息采集装置,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。
图9为本申请实施例提供的信息采集装置的结构示意图二。在图8的基础上,如图9所示,信息采集装置10还包括:查询模块105和确定模块106,其中,
查询模块105用于,在通过采集应用程序获取第一部件的第一属性信息之前对至少一个阵列卡进行查询,得到查询信息;
确定模块106用于,根据查询信息确定采集应用程序的目标标识。
本实施例提供的信息采集装置,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。
在一种可能实施方式中,第三获取模块103具体用于:
对第一属性信息进行信息串划分处理,得到至少一个信息串,每个信息串中包括至少一个第一属性名称和/或至少一个第一属性值;
根据第二属性名称和至少一个信息串,在第一属性信息中获取第二属性名称对应的第二属性值。
在一种可能实施方式中,第三获取模块103具体用于:
按照第一属性信息的行排列方式,对第一属性信息进行信息串划分处理,得到至少一个信息串;其中,第一属性信息中的一行信息对应一个信息串。
在一种可能实施方式中,至少一个信息串的个数为M,M大于或等于1,属性列表中还包括采集应用程序的目标标识和目标标识对应的至少一个第三属性名称,至少一个第三属性名称的个数为N,M大于或等于N,N大于或等于1,属性列表中的一个第三属性名称对应一个第二属性名称。
在一种可能实施方式中,针对至少一个第二属性名称中的第j个第二属性名称,j大于或等于1且小于或等于N;
第三获取模块103具体用于:
判断第i个信息串中是否存与第j个第三属性名称相同的第一属性名称;其中,i大于或等于1且小于或等于M;
若是,则将与第j个第三属性名称相同的第一属性名称对应的第一属性值,确定为第j个第二属性名称对应的第二属性值,其中,第j个第三属性名称对应第j个第二属性名称。
在一种可能实施方式中,第三获取模块103具体用于:
根据预设字符,对第一属性信息进行拆分处理,得到至少一个信息串;其中,第一属性信息中的第一属性名称和第一属性值之间设置有预设字符,第一属性信息中的一个第一属性名称或者一个第一属性值对应一个信息串。
在一种可能实施方式中,至少一个信息串的个数为N,N大于或等于1,属性列表中还包括至少一个应用标识和每个应用标识对应的至少一个第三属性名称,属性列表中的一个第三属性名称对应一个第二属性名称,至少一个应用标识的个数为M,M大于或等于1,至少一个应用标识中包括采集应用程序的目标标识。
在一种可能实施方式中,针对至少一个第二属性名称中的第j个第二属性名称,j大于或等于1且小于或等于Y,Y为至少一个第二属性名称的总个数;
第三获取模块103具体用于:
分别对N个信息串进行哈希转换处理,得到N个第一哈希值和N个第一映射关系,其中,一个信息串对应一个第一哈希值,一个第一哈希值对应一个第一映射关系;
分别对第j个第二属性名称对应的M个第三属性名称进行哈希转换处理,得到M个第二哈希值和M个第二映射关系,其中,一个第三属性名称对应的一个第二哈希值,一个第二哈希值对应一个第二映射关系;
根据N个第一哈希值、N个第一映射关系、M个第二哈希值和M个第二映射关系,在第一属性信息中获取第j个第二属性名称对应的第二属性值。
在一种可能实施方式中,第三获取模块103具体用于:
对N个第一哈希值中和M个第二哈希值进行比较处理,得到相同的第一目标值和第二目标值,其中,第一目标值为N个第一哈希值中的哈希值,第二目标值为M个第二哈希值中的哈希值;
获取第一目标值对应的第一目标映射关系与第二目标值对应的第二目标映射关系之间的映射信息;
根据映射信息,在第一属性信息中获取第二目标值对应的第三属性名称对应的第三属性值,将第三属性值确定为第j个第二属性名称对应的第二属性值,其中,第二目标值对应的第三属性名称与第j个第二属性名称对应。
在一种可能实施方式中,映射信息中包括至少一个三维坐标;第三获取模块103具体用于:
根据第二目标值对应的第三属性名称在属性列表中的第一列标识、目标标识在属性列表中的第二列标识,判断至少一个三维坐标中是否存在第一坐标,第一坐标中包括第一列标识和第二列标识;
若是,则根据第一坐标,在第一属性信息中确定第一信息串,第一信息串在第一属性信息中位置标识与第一坐标中除第一列标识和第二列标识之外的坐标值相同;将第一属性信息中的第二信息串对应的属性值确定为第二目标值对应的第三属性名称对应的第三属性值,第二信息串为第一信息串之后的第一个信息串。
在一种可能实施方式中,第一部件包括至少一个阵列卡和至少一个硬盘,其中,至少一个阵列卡中包括虚拟阵列卡,至少一个硬盘中包括虚拟硬盘。
在一种可能实施方式中,查询信息中包括第一阵列卡查询信息和服务器的厂商信息;确定模块106具体用于:
在根据第一阵列卡查询信息确定服务器中存在第一阵列卡、且根据厂商信息确定服务器的厂商标识为预设标识之后,将第一应用标识确定为目标标识。
在一种可能实施方式中,查询信息中还包括第二阵列卡查询信息,确定模块106还用于:
在根据第一阵列卡查询信息确定服务器中存在第一阵列卡、且根据厂商信息确定服务器的厂商标识不为预设标识之后,若根据第二阵列卡查询信息确定第一阵列卡支持第二阵列卡,则将第二应用标识确定为目标标识;若根据第二阵列卡查询信息确定第一阵列卡不支持第二阵列卡,则将第三应用标识确定为目标标识。
在一种可能实施方式中,查询信息中还包括第三阵列卡查询信息;确定模块106还用于:
若根据第一阵列卡查询信息确定服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定服务器中存在第三阵列卡,则将第四应用标识确定为目标标识;
若根据第一阵列卡查询信息确定服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定服务器中不存在第三阵列卡,则将第五应用标识确定为目标标识。
在一种可能实施方式中,至少一个阵列卡中还包括第一阵列卡和/或第三阵列卡,第一阵列卡为通过硬件实现的阵列卡,第三阵列卡为通过软件实现的阵列卡。
图10为本申请实施例提供的服务器的硬件结构示意图。如图10所示,本实施例的服务器20包括:处理器201和存储器202;其中
存储器202存储计算机执行指令;
处理器201执行存储器202中存储的计算机执行指令,使得处理器201执行上述方法实施例中的各个步骤。具体可以参见前述方法实施例中的相关描述。
可选地,存储器202既可以是独立的,也可以跟处理器201集成在一起。
当存储器202独立设置时,该服务器20中还包括总线203,用于连接存储器202和处理器201。
本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机执行指令,当计算机执行指令被处理器执行时实现如上方法实施例中的各个步骤。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的设备实施例仅仅是示意性的,例如,模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。
上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(英文:processor)执行本申请各个实施例方法的部分步骤。
应理解,上述处理器可以是中央处理单元(英文:Central Processing Unit,简称:CPU),还可以是其他通用处理器、数字信号处理器(英文:Digital Signal Processor,简称:DSP)、专用集成电路(英文:Application Specific Integrated Circuit,简称:ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合发明所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
存储器可能包含高速RAM存储器,也可能还包括非易失性存储NVM,例如至少一个磁盘存储器,还可以为U盘、移动硬盘、只读存储器、磁盘或光盘等。
总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,本申请附图中的总线并不限定仅有一根总线或一种类型的总线。
上述存储介质可以是由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。存储介质可以是通用或专用计算机能够存取的任何可用介质。
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (21)

  1. 一种信息采集方法,其特征在于,应用于服务器,包括:
    通过采集应用程序获取第一部件的第一属性信息,所述第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,所述第一部件为服务器中的任意部件;
    获取所述第一部件对应的属性列表,所述属性列表中包括至少一个第二属性名称;
    在所述第一属性信息中获取第二属性名称对应的第二属性值,并将所述第二属性值填充至所述属性列表,得到所述第一部件的信息采集结果。
  2. 根据权利要求1所述的方法,其特征在于,在所述第一属性信息中获取第二属性名称对应的第二属性值,包括:
    对所述第一属性信息进行信息串划分处理,得到至少一个信息串,每个信息串中包括至少一个第一属性名称和/或至少一个第一属性值;
    根据所述第二属性名称和所述至少一个信息串,在所述第一属性信息中获取第二属性名称对应的第二属性值。
  3. 根据权利要求2所述的方法,其特征在于,对所述第一属性信息进行信息串划分处理,得到至少一个信息串,包括:
    按照所述第一属性信息的行排列方式,对所述第一属性信息进行信息串划分处理,得到至少一个信息串;其中,所述第一属性信息中的一行信息对应一个信息串。
  4. 根据权利要求3所述的方法,其特征在于,所述至少一个信息串的个数为M,M大于或等于1,所述属性列表中还包括所述采集应用程序的目标标识和所述目标标识对应的至少一个第三属性名称,所述至少一个第三属性名称的个数为N,M大于或等于所述N,N大于或等于1,所述属性列表中的一个第三属性名称对应一个第二属性名称。
  5. 根据权利要求4所述的方法,其特征在于,针对所述至少一个第二属性名称中的第j个第二属性名称,j大于或等于1且小于或等于N;
    根据第j个第二属性名称和所述至少一个信息串,在所述第一属性信息中获取第j个第二属性名称对应的第二属性值,包括:
    判断第i个信息串中是否存与第j个第三属性名称相同的第一属性名称;其中,i大于或等于1且小于或等于M;
    若是,则将与第j个第三属性名称相同的第一属性名称对应的第一属性值,确定为第j个第二属性名称对应的第二属性值,其中,第j个第三属性名称对应第j个第二属性名称。
  6. 根据权利要求2所述的方法,其特征在于,对所述第一属性信息进行信息串划分处理,得到至少一个信息串,包括:
    根据预设字符,对所述第一属性信息进行拆分处理,得到所述至少一个信息串;其中,第一属性信息中的第一属性名称和第一属性值之间设置有所述预设字符,所述第一属性信息中的一个第一属性名称或者一个第一属性值对应一个信息串。
  7. 根据权利要求6所述的方法,其特征在于,所述至少一个信息串的个数为N,N大于或等于1,所述属性列表中还包括至少一个应用标识和每个应用标识对应的至少一个第三属性名称,所述属性列表中的一个第三属性名称对应一个第二属性名称,所述至少一个应用标识的个数为M,M大于或等于1,所述至少一个应用标识中包括所述采集应用程序的目标标识。
  8. 根据权利要求7所述的方法,其特征在于,针对所述至少一个第二属性名称中的第j个第二属性名称,j大于或等于1且小于或等于Y,Y为所述至少一个第二属性名称的总个数;
    根据第j个第二属性名称和所述至少一个信息串,在所述第一属性信息中获取第j个第二属性名称对应的第二属性值,包括:
    分别对N个信息串进行哈希转换处理,得到N个第一哈希值和所述N个第一映射关系,其中,一个信息串对应一个第一哈希值,一个第一哈希值对应一个第一映射关系;
    分别对第j个第二属性名称对应的M个第三属性名称进行哈希转换处理,得到M个第二哈希值和所述M个第二映射关系,其中,一个第三属性名称对应的一个第二哈希值,一个第二哈希值对应一个第二映射关系;
    根据所述N个第一哈希值、所述N个第一映射关系、所述M个第二哈希值和所述M个第二映射关系,在所述第一属性信息中获取第j个第二属性名称对应的第二属性值。
  9. 根据权利要求8所述的方法,其特征在于,根据所述N个第一哈希值、所述N个第一映射关系、所述M个第二哈希值和所述M个第二映射关系,在所述第一属性信息中获取第j个第二属性名称对应的第二属性值,包括:
    对所述N个第一哈希值中和所述M个第二哈希值进行比较处理,得到相同的第一目标值和第二目标值,其中,所述第一目标值为所述N个第一哈希值中的哈希值,所述第二目标值为所述M个第二哈希值中的哈希值;
    获取所述第一目标值对应的第一目标映射关系与所述第二目标值对应的第二目标映射关系之间的映射信息;
    根据所述映射信息,在所述第一属性信息中获取所述第二目标值对应的第三属性名称对应的第三属性值,将所述第三属性值确定为第j个第二属性名称对应的第二属性值,其中,所述第二目标值对应的第三属性名称与第j个第二属性名称对应。
  10. 根据权利要求9所述的方法,其特征在于,所述映射信息中包括至少一个三维坐标;根据所述映射信息,在所述第一属性信息中获取所述第二目标值对应的第三属性名称对应的第三属性值,包括:
    根据所述第二目标值对应的第三属性名称在所述属性列表中的第一列标识、所述目标标识在所述属性列表中的第二列标识,判断所述至少一个三维坐标中是否存在第一坐标,所述第一坐标中包括所述第一列标识和所述第二列标识;
    若是,则根据所述第一坐标,在所述第一属性信息中确定第一信息串,所述第一信息串在所述第一属性信息中位置标识与所述第一坐标中除所述第一列标识和所述第二列标识之外的坐标值相同;将所述第一属性信息中的第二信息串对应的属性值确定为所述第二目标值对应的第三属性名称对应的第三属性值,所述第二信息串为所述第一信息串之后的第一个信息串。
  11. 根据权利要求1-10中任一项所述的方法,其特征在于,所述服务器中安装有Linux操作系统,所述采集应用程序安装在所述Linux操作系统中;通过采集应用程序获取第一部件的第一属性信息,包括:
    在所述Linux操作系统中,采用带内信息获取方式,通过所述采集应用程序获取所述第一部件的第一属性信息。
  12. 根据权利要求1-10中任一项所述的方法,其特征在于,所述服务器中设置有所述第一部件对应的基础数据模型,所述基础数据模型中包括所述至少一个第二属性名称,所述属性列表为根据所述至少一个第二属性名称预先建立、并存储的在所述服务器中的列表。
  13. 根据权利要求1-10中任一项所述的方法,其特征在于,所述第一部件包括至少一个阵列卡和至少一个硬盘,其中,所述至少一个阵列卡中包括虚拟阵列卡,所述至少一个硬盘中包括虚拟硬盘。
  14. 根据权利要求13所述的方法,其特征在于,所述通过采集应用程序获取第一部件的第一属性信息之前,还包括:
    对所述至少一个阵列卡进行查询,得到查询信息;
    根据所述查询信息确定所述采集应用程序的目标标识。
  15. 根据权利要求14所述的方法,其特征在于,所述查询信息中包括第一阵列卡查询信息和所述服务器的厂商信息;所述根据所述查询信息确定所述采集应用程序的目标标识,包括:
    在根据所述第一阵列卡查询信息确定所述服务器中存在第一阵列卡、且根据厂商信息确定所述服务器的厂商标识为预设标识之后,将第一应用标识确定为所述目标标识。
  16. 根据权利要求15所述的方法,其特征在于,所述查询信息中还包括第二阵列卡查询信息,所述方法还包括:
    在根据所述第一阵列卡查询信息确定所述服务器中存在第一阵列卡、且根据厂商信息确定所述服务器的厂商标识不为预设标识之后,若根据所述第二阵列卡查询信息确定所述第一阵列卡支持第二阵列卡,则将第二应用标识确定为所述目标标识;若根据所述第二阵列卡查询信息确定所述第一阵列卡不支持第二阵列卡,则将第三应用标识确定为所述目标标识。
  17. 根据权利要求16所述的方法,其特征在于,所述查询信息中还包括第三阵列卡查询信息;所述根据所述查询信息确定所述采集应用程序的目标标识,包括:
    若根据所述第一阵列卡查询信息确定所述服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定所述服务器中存在第三阵列卡,则将第四应用标识确定为所述目标标识;
    若根据所述第一阵列卡查询信息确定所述服务器中不存在第一阵列卡、且根据第三阵列卡查询信息确定所述服务器中不存在第三阵列卡,则将第五应用标识确定为所述目标标识。
  18. 根据权利要求17所述的方法,其特征在于,所述至少一个阵列卡中还包括所述第一阵列卡和/或第三阵列卡,所述第一阵列卡为通过硬件实现的阵列卡,所述第三阵列卡为通过软件实现的阵列卡。
  19. 一种信息采集装置,其特征在于,包括:第一获取模块、第二获取模块、第三获取模块和填充模块,其中,
    所述第一获取模块用于,通过采集应用程序获取第一部件的第一属性信息,所述第一属性信息包括至少一个第一属性名称和每个第一属性名称对应的第一属性值,所述第一部件为服务器中的任意部件;
    所述第二获取模块用于,获取所述第一部件对应的属性列表,所述属性列表中包括至少一个第二属性名称;
    所述第三获取模块用于,在所述第一属性信息中获取第二属性名称对应的第二属性值;
    所述填充模块用于,将所述第二属性值填充至所述属性列表,得到所述第一部件的信息采集结果。
  20. 一种服务器,其特征在于,其特征在于,包括:存储器和处理器;
    所述存储器存储计算机执行指令;
    所述处理器执行所述存储器存储的计算机执行指令,使得所述处理器执行权利要求1至18中任一项所述的方法。
  21. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当所述计算机执行指令被处理器执行时实现权利要求1至18中任一项所述的方法。
PCT/CN2021/124641 2020-10-26 2021-10-19 信息采集方法、装置、服务器及存储介质 WO2022089249A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011156016.3A CN112181796B (zh) 2020-10-26 2020-10-26 信息采集方法、装置、服务器及存储介质
CN202011156016.3 2020-10-26

Publications (1)

Publication Number Publication Date
WO2022089249A1 true WO2022089249A1 (zh) 2022-05-05

Family

ID=73923857

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/124641 WO2022089249A1 (zh) 2020-10-26 2021-10-19 信息采集方法、装置、服务器及存储介质

Country Status (2)

Country Link
CN (1) CN112181796B (zh)
WO (1) WO2022089249A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181796B (zh) * 2020-10-26 2021-09-14 深圳前海微众银行股份有限公司 信息采集方法、装置、服务器及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631755A (zh) * 2011-06-29 2014-03-12 北京奇虎科技有限公司 一种装机配置单的生成方法及装置
US20140108463A1 (en) * 2012-10-12 2014-04-17 Ca, Inc. Data structure for efficiently identifying transactions
CN104268241A (zh) * 2014-09-29 2015-01-07 北京合力思腾科技股份有限公司 一种配置数据库中属性显示方法
CN110378033A (zh) * 2019-07-22 2019-10-25 中新软件(上海)有限公司 实体部件的非标设计方法、装置、存储介质及计算机设备
CN112181796A (zh) * 2020-10-26 2021-01-05 深圳前海微众银行股份有限公司 信息采集方法、装置、服务器及存储介质

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460344B (zh) * 2018-09-26 2023-04-28 国家计算机网络与信息安全管理中心 一种服务器的运维分析方法与系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103631755A (zh) * 2011-06-29 2014-03-12 北京奇虎科技有限公司 一种装机配置单的生成方法及装置
US20140108463A1 (en) * 2012-10-12 2014-04-17 Ca, Inc. Data structure for efficiently identifying transactions
CN104268241A (zh) * 2014-09-29 2015-01-07 北京合力思腾科技股份有限公司 一种配置数据库中属性显示方法
CN110378033A (zh) * 2019-07-22 2019-10-25 中新软件(上海)有限公司 实体部件的非标设计方法、装置、存储介质及计算机设备
CN112181796A (zh) * 2020-10-26 2021-01-05 深圳前海微众银行股份有限公司 信息采集方法、装置、服务器及存储介质

Also Published As

Publication number Publication date
CN112181796B (zh) 2021-09-14
CN112181796A (zh) 2021-01-05

Similar Documents

Publication Publication Date Title
US9996565B2 (en) Managing an index of a table of a database
JP5852677B2 (ja) レジスタ・マッピング方法
US8332367B2 (en) Parallel data redundancy removal
CN103782282B (zh) 具有用于虚拟化输入/输出的处理器局部一致性的计算机系统
CN111356996B (zh) 用于版本验证的系统和计算机实现的方法
CN111709527A (zh) 运维知识图谱库的建立方法、装置、设备及存储介质
EP3669262B1 (en) Thin provisioning virtual desktop infrastructure virtual machines in cloud environments without thin clone support
KR101355273B1 (ko) 컴퓨팅 시스템 및 그 실행 제어 방법과, 그 실행 제어 프로그램을 기록한 기록 매체
CN113360519B (zh) 数据处理方法、装置、设备和存储介质
WO2020238245A1 (zh) 实现函数跳转的方法、装置及计算机存储介质
WO2022100032A1 (zh) 系统分析可视化方法、装置、电子设备及计算机可读存储介质
WO2022089249A1 (zh) 信息采集方法、装置、服务器及存储介质
CN105426119A (zh) 一种存储设备及数据处理方法
CN113010208A (zh) 一种版本信息的生成方法、装置、设备及存储介质
CN111046085B (zh) 数据的溯源处理方法及装置、介质和设备
CN111429085A (zh) 合同数据生成方法、装置、电子设备及存储介质
CN114816772B (zh) 基于兼容层运行的应用的排错方法、排错系统及计算设备
CN115794821A (zh) 一种不同平台同一资产信息汇聚方法、系统、设备及介质
US9535977B1 (en) Object building for an aggregate object class request
TWI444824B (zh) 虛擬機器記憶體的鑑識方法與電腦系統
CN115858183B (zh) 异步并行i/o请求的进程间联合分析方法、装置及设备
US11940966B2 (en) Method, apparatus, and system for estimating database management system performance
WO2023020511A1 (zh) 设备控制方法、装置、服务器及存储介质
CN113515504B (zh) 数据管理方法、装置、电子设备以及存储介质
WO2022134345A1 (zh) 文件访问方法、装置、设备及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21884977

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 01.08.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21884977

Country of ref document: EP

Kind code of ref document: A1