CN111885159B - Data acquisition method and device, electronic equipment and storage medium - Google Patents

Data acquisition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111885159B
CN111885159B CN202010713727.XA CN202010713727A CN111885159B CN 111885159 B CN111885159 B CN 111885159B CN 202010713727 A CN202010713727 A CN 202010713727A CN 111885159 B CN111885159 B CN 111885159B
Authority
CN
China
Prior art keywords
ipmi
nodes
target
node
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010713727.XA
Other languages
Chinese (zh)
Other versions
CN111885159A (en
Inventor
周军
苗海锋
张浩龙
王家尧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Shuguang International Information Industry Co ltd
Dawning Information Industry Beijing Co Ltd
Original Assignee
Zhongke Shuguang International Information Industry Co ltd
Dawning Information Industry Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Shuguang International Information Industry Co ltd, Dawning Information Industry Beijing Co Ltd filed Critical Zhongke Shuguang International Information Industry Co ltd
Priority to CN202010713727.XA priority Critical patent/CN111885159B/en
Publication of CN111885159A publication Critical patent/CN111885159A/en
Application granted granted Critical
Publication of CN111885159B publication Critical patent/CN111885159B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a data acquisition method, a data acquisition device, electronic equipment and a storage medium. The data acquisition method is used in electronic equipment to acquire hardware information of IPMI nodes of a plurality of slave devices, and comprises the following steps: acquiring a node list, wherein the node list comprises node identifications of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device; sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes to judge the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes; and starting a plurality of threads to collect target data in a plurality of target IPMI nodes in a parallel mode, wherein each thread is used for collecting data of one target IPMI node. The method and the device can improve the acquisition efficiency of the target data.

Description

Data acquisition method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer network technologies, and in particular, to a data acquisition method, an apparatus, an electronic device, and a storage medium.
Background
The ipmitool tool is adopted to collect the target data of the IPMI node in the electronic equipment, and the target data of the IPMI node is required to be collected by the ipmitool tool in a multithreading large-concurrency mode. The efficiency of collecting the target data of the IPMI nodes by the ipmitool is low, the collected IPMI information is not well optimized, and under the condition of large-scale clustering, if the IPMitool is used for collecting the IPMI information, the time spent on collecting the IPMI information of all the nodes at one time is very long, and the efficiency is low.
In view of the above problems, no effective technical solution exists at present.
Disclosure of Invention
An object of the embodiments of the present application is to provide a data acquisition method, an apparatus, an electronic device, and a storage medium, which can improve the acquisition efficiency of target data.
In a first aspect, an embodiment of the present application provides a data collection method, used in an electronic device, for performing target data collection on IPMI nodes of a plurality of slave devices, where the method includes:
acquiring a node list, wherein the node list comprises node identifiers of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device;
sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes to judge the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes;
establishing a plurality of threads, and running the threads in a parallel mode to collect target data of the target IPMI nodes, wherein each thread is used for collecting data of at least one target IPMI node.
According to the method and the device, the unavailable IPMI nodes are removed, and then the target data is acquired on the plurality of available target IPMI nodes in a parallel mode, so that the efficiency can be improved.
Optionally, in the data collection method according to the embodiment of the present application, the establishing multiple threads and running the multiple threads in a parallel manner to collect target data of the multiple target IPMI nodes includes:
dividing the plurality of target IPMI nodes into a plurality of first sets, each of the first sets comprising a plurality of target IPMI nodes;
and establishing a plurality of threads aiming at each first set, and running the threads in a parallel mode to collect a plurality of target IPMI nodes in each first set, wherein each thread is used for collecting data of one target IPMI node.
According to the embodiment of the application, the target IPMI nodes are grouped, and a plurality of parallel threads are established for each group, so that the target data can be rapidly acquired, the phenomenon that the acquisition speed is too slow due to the fact that the performance of electronic equipment is affected by too many threads is avoided, and the efficiency can be improved.
Optionally, in the data collection method according to this embodiment of the present application, the dividing the plurality of target IPMI nodes into a plurality of first sets includes:
acquiring type information of each slave device, and acquiring format information of target data of each target IPMI node according to the type information;
and dividing the plurality of target IPMI nodes into a plurality of first sets according to the format information of each target data.
According to the method and the device, grouping is performed through the type information of the slave device, basic parameter configuration for acquiring target data corresponding to the IPMI node is facilitated, configuration is only needed once for one first set, and therefore efficiency can be improved.
Optionally, in the data collection method according to this embodiment of the present application, the dividing the plurality of target IPMI nodes into a plurality of first sets includes:
acquiring data volume information of target data of each target IPMI node;
dividing the plurality of target IPMI nodes into a plurality of first sets according to the data volume information, wherein in the same first set, the difference value of the data volumes of the target data of any two target IPMI nodes is smaller than a first preset threshold value.
According to the embodiment of the application, the first set is divided based on the data volume information, and the phenomenon that the data volume difference of target data corresponding to the target IPMI nodes in the same set is too large is avoided, so that the required time tends to be uniform, the utilization rate of the multiple threads can be improved, and the efficiency can be improved.
Optionally, in the data collection method according to the embodiment of the present application, the establishing multiple threads and running the multiple threads in a parallel manner to collect target data of the multiple target IPMI nodes includes:
dividing the plurality of target IPMI nodes into a plurality of second sets, each second set comprising a plurality of target IPMI nodes;
establishing a plurality of threads, wherein the plurality of threads are in one-to-one correspondence with the plurality of second sets;
and running the multiple threads in a parallel mode, so that each thread performs target data acquisition on multiple target IPMI nodes in the corresponding second set in a serial mode.
According to the embodiment of the application, one thread is established for the same second set, so that the total number of required threads is reduced, the time can be saved, and the efficiency is greatly improved.
Optionally, in the data acquisition method according to the embodiment of the present application, the target data of the target IPMI nodes in each of the second sets have the same data type, and a difference between total data amounts of corresponding target data in any two second sets is smaller than a second preset threshold.
Optionally, in the data collection method according to this embodiment of the present application, the sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes to determine the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes, includes:
dividing the plurality of IPMI nodes into a plurality of groups according to a first preset strategy, wherein each group comprises a plurality of IPMI nodes, and the formats of target data of the IPMI nodes in the same group are the same;
and sending a query instruction to the corresponding IPMI node according to the node identifications of the plurality of IPMI nodes of each group to judge the availability of each IPMI node and set the available IPMI node as the target IPMI node.
In a second aspect, an embodiment of the present application further provides a data acquisition apparatus, configured in an electronic device, to acquire hardware information of IPMI nodes of a plurality of slave devices, where the apparatus includes:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a node list, the node list comprises node identifications of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device;
the screening module is used for sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes so as to judge the availability of each IPMI node, and therefore a plurality of available target IPMI nodes are screened out;
the collection module is used for establishing a plurality of threads and running the threads in a parallel mode so as to collect target data of the target IPMI nodes, and each thread is used for collecting data of at least one target IPMI node.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method as provided in the first aspect are executed.
In a fourth aspect, embodiments of the present application provide a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the steps in the method as provided in the first aspect.
As can be seen from the above, the data acquisition method and apparatus provided in the embodiment of the present application acquire a node list, where the node list includes node identifiers of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device; sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes to judge the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes; the method comprises the steps of establishing a plurality of threads, running the threads in a parallel mode to collect target data of a plurality of target IPMI nodes, wherein each thread is used for collecting data of at least one target IPMI node, so that the target data of a plurality of slave devices can be collected quickly, and efficiency can be improved.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a flowchart of a data acquisition method according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram of a data acquisition device according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a flowchart of a data acquisition method in some embodiments of the present application. The method is used in electronic equipment to collect hardware information of IPMI nodes of a plurality of slave equipment, wherein the electronic equipment can be a server or terminal equipment.
The data acquisition method comprises the following steps:
s101, a node list is obtained, the node list comprises node identifications of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device.
S102, sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes to judge the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes;
s103, establishing a plurality of threads, and operating the threads in a parallel mode to acquire target data of the target IPMI nodes, wherein each thread is used for acquiring data of at least one target IPMI node.
In step S101, IPMI refers to an Intelligent Platform management interface (IPMI for short). The plurality of slave devices are in the same pre-established group as the electronic device. Each slave device is provided with a corresponding IPMI node, so that the electronic device collects hardware information, i.e., target data, of the corresponding slave device through the IPMI node. The target data may include basic configuration information of hardware, and may also include hardware operating parameter information, for example, a certain slave device is a router, and correspondingly, the target data may include uplink and downlink traffic information of the router, the number of terminals accessing the internet through the router, identification information of each terminal, some basic configuration parameters of the router, and the like. Of course, it is not limited thereto.
In step S102, the availability of each IPMI node is determined by sending an inquiry command to the IPMI node corresponding to each slave device, that is, whether each IPMI node can normally collect information is determined. It is understood that, when performing the query, the electronic device first sends a query command to each IPMI node, and then waits for receiving feedback information of each IPMI node. And if the feedback information of a certain IPMI node is not received within the preset time, judging that the IPMI node is unavailable. For the IPMI node that returns the feedback information within the preset time, the feedback information needs to be queried and analyzed to determine whether the corresponding IPMI node is currently available, that is, whether the corresponding IPMI node is currently in a state capable of collecting the target data.
In some embodiments, this step S102 may include the following sub-steps: s1021, dividing the IPMI nodes into a plurality of groups; s1022, sending a query to the corresponding IPMI node according to the node identification of the plurality of IPMI nodes of each group to determine the availability of each IPMI node, and setting the available IPMI node as the target IPMI node. In step S1021, the slave devices may be grouped according to the types of the slave devices corresponding to the IPMI nodes, and the IPMI nodes of the slave devices of the same type are grouped in the same group. Of course, an average grouping may be performed, each group having the same number of IPMI nodes. In this step S1022, multiple threads may be established, so as to query the availability of each IPMI node in parallel. After the check is finished, an available node list and an unavailable node list are generated, the node identifications of all unavailable IMPI nodes are put into the unavailable node list, and the node identifications of all available IMPI nodes are put into the available node list.
It will be appreciated that at query time, a check window may be set into which the node identification of the IPMI node within each group is placed, the size of the check window being 1024, 2048, 4096, etc. When the number of IPMI nodes in the node list is less than or equal to 1024, the size of the inspection window is set to 1024, that is, the IPMI nodes in the node list can be put into the inspection window together for inspection. When the number of IPMI nodes on the node list is greater than 1024 and smaller than 4096, the window size is set to 2048. The plurality of IPMI nodes may be detected twice. When the number of IPMI nodes on the node list is greater than or equal to 4096, the size of the window is set to 4096. Checking that the window size is no longer increasing indefinitely is primarily a concern that the efficiency of querying the availability of IPMI nodes will become lower after the window is increased. The input information of the inspection window is the nodes in the node list, and the output information is two lists of available IPMI nodes and unavailable IPMI nodes.
In step S103, the target data of the target IPMI nodes may be collected in various manners. Data acquisition is performed on the target IPMI node in a parallel mode to the greatest extent, so that the efficiency is improved. Of course, due to the performance limitation of the electronic device itself, the number of threads that can be simultaneously run at a time cannot be infinite, and the overall running efficiency is rapidly reduced when the number of threads exceeds a certain number, thereby affecting the acquisition of target data and affecting other operations of the electronic device.
In some embodiments, this step S103 may comprise the following sub-steps: s1031, dividing the plurality of target IPMI nodes into a plurality of first sets, wherein each first set comprises a plurality of target IPMI nodes; s1032, aiming at each first set, a plurality of threads are established, the threads are operated in a parallel mode to collect target data of a plurality of target IPMI nodes in each first set, and each thread is used for collecting data of one target IPMI node.
In step S1031, the number of target IPMI nodes in each first set is less than the number of threads that can be run by the electronic device at the same time. The division may be performed based on the type of the slave device corresponding to each target IPMI node, specifically, the division may be performed according to format information of target data of each slave device, or may also be performed according to the data volume of the target data, so as to improve the efficiency of data acquisition.
Specifically, in some embodiments, this step S1031 may include: s10311, obtaining type information of each slave device, and obtaining format information of target data of each target IPMI node according to the type information; and S10312, dividing the plurality of target IPMI nodes into a plurality of first sets according to the format information of each target data, wherein each first set comprises a plurality of target IPMI nodes. Because different types of slave devices have target data with different formats, in order to ensure that the same batch of parallel execution threads can more efficiently complete data acquisition on each target IPMI node in the same first set, the target IPMI nodes with the target data with the same format are placed in the same batch of parallel execution threads, and when the threads are established, the threads with the same type of configuration parameters can be adopted to acquire the data of the target IPMI nodes in the same first set, so that the efficiency can be improved.
In other embodiments, the step S1031 may include: s10313, acquiring data volume information of target data of each target IPMI node; s10314, dividing the plurality of target IPMI nodes into a plurality of first sets according to the data volume information, wherein in the same first set, the difference value of the data volumes of the target data of any two target IPMI nodes is smaller than a first preset threshold value. Wherein the first preset threshold value can be set to a fixed value, such as x1KB. The first preset threshold may also be a dynamic value, and the size of the first preset threshold is related to the communication speed of each slave device, so as to ensure that the time for acquiring the target data of the IPMI nodes in each first set is about the same. That is, the difference between the time spent on collecting the target data of any two target IPMI nodes in the same first set is less than 5 seconds. In step S10313, the approximate data size of the target data of each target IPMI node may be obtained according to the collection record of the target data of each target IPMI node in the history. Of course, the approximate data size of the target data of each target IPMI node may be estimated in other common ways. In step S10314, the target IPMI nodes with the same data size are divided into the same group, but considering that the target IPMI nodes cannot be completely the same, a first preset threshold may be set, so as to ensure that the target data sizes of any two target IPMI nodes in the same first set are smaller than the first preset threshold, so that the same thread can be completed in a short time during execution, and then the next thread can be established more quickly, so as to complete the collection of the target data of the next target IPMI node, thereby improving the efficiency.
In step S1032, for example, if there are 50 target IPMI nodes in the first set, then 50 threads are simultaneously started to run in parallel, so as to achieve fast collection of target data of the 50 target IPMI nodes.
It is understood that in other embodiments, the step S103 includes the following steps: s1033, dividing the plurality of target IPMI nodes into a plurality of second sets, wherein each second set comprises a plurality of target IPMI nodes; s1034, establishing a plurality of threads, wherein the plurality of threads are in one-to-one correspondence with the plurality of second sets; s1035, running the plurality of threads in parallel, such that each of the threads performs target data collection on a plurality of target IPMI nodes in the corresponding second set in a serial manner. And the target data of the target IPMI nodes in each second set have the same data type, and the difference value of the total data quantity of the corresponding target data in any two second sets is smaller than a second preset threshold value. The second preset threshold may be a fixed amount, for example, set to x2KB, or may be a dynamic threshold set according to the transmission rate of each slave device, so as to ensure that the total time difference of the acquisition operations of the target data in each second set is small. Of course, when the division is performed in this way, it is ensured that the total data amount of the target data in each second set is approximately the same as much as possible, so that it is ensured that the multiple threads can run in parallel for as long as possible. In addition, it is also necessary to ensure that the format information of the target data in the same second set is the same, and certainly, as the number cannot be completely balanced, for some second sets, data collection can be performed on several target IPMI nodes with different types of target data.
It is to be understood that, in some embodiments, if the number of target IPMI nodes is large, for example, the number of target IPMI nodes is 1000, the electronic device may only run 100 threads at a time, and therefore, 100 threads may be established to perform the target data collection on 100 target IPMI nodes, and after the target data collection is completed, another 100 threads may be established to perform the target data collection on other 100 target IPMI nodes until the target data collection on the 1000 target IPMI nodes is completed.
As can be seen from the above, in the data acquisition method provided in the embodiment of the present application, a node list is obtained, where the node list includes node identifiers of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device; sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes to judge the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes; the method comprises the steps of establishing a plurality of threads, running the threads in a parallel mode to collect target data of a plurality of target IPMI nodes, wherein each thread is used for collecting data of at least one target IPMI node, so that the target data of a plurality of slave devices can be collected quickly, and efficiency can be improved.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a data collection apparatus in some embodiments of the present application, the data collection apparatus is used in an electronic device to collect hardware information of IPMI nodes of a plurality of slave devices, and the apparatus includes: an acquisition module 201, a screening module 202 and an acquisition module 203.
The obtaining module 201 is configured to obtain a node list, where the node list includes node identifiers of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device. The plurality of slave devices are in the same pre-established group as the electronic device. Each slave device is provided with a corresponding IPMI node, so that the electronic device collects hardware information, i.e. target data, of the corresponding slave device through the IPMI node. The target data may include basic configuration information of hardware, and may also include hardware operating parameter information, for example, a certain slave device is a router, and correspondingly, the target data may include uplink and downlink traffic information of the router, the number of terminals accessing the internet through the router, identification information of each terminal, some basic configuration parameters of the router, and the like. Of course, it is not limited thereto.
The screening module 202 is configured to send a query to each IPMI node according to the node identifiers of the plurality of IPMI nodes to determine the availability of each IPMI node, so as to screen a plurality of available target IPMI nodes. The screening module 202 may determine the availability of each IPMI node by sending a query to the IPMI node corresponding to each slave device, that is, whether the information collection is normal. It is understood that, when performing the query, the electronic device first sends a query command to each IPMI node, and then waits for receiving feedback information of each IPMI node. And if the feedback information of a certain IPMI node is not received within the preset time, judging that the IPMI node is unavailable. For the IPMI node that returns the feedback information within the preset time, the feedback information needs to be queried and analyzed to determine whether the corresponding IPMI node is currently available, that is, whether the corresponding IPMI node is currently in a state capable of collecting the target data.
In some embodiments, the screening module 202 is configured to: dividing the plurality of IPMI nodes into a plurality of groups; and sending a query instruction to the corresponding IPMI node according to the node identifications of the plurality of IPMI nodes of each group to judge the availability of each IPMI node and set the available IPMI node as the target IPMI node. The screening module 202 may perform grouping according to the types of the slave devices corresponding to the IPMI nodes, where the IPMI nodes of the slave devices of the same type are grouped in the same group. Of course, an average grouping may be performed, each group having the same number of IPMI nodes. Wherein the screening module 202 may establish multiple threads to query the availability of each IPMI node in parallel. After the check is finished, an available node list and an unavailable node list are generated, the node identifications of all unavailable IMPI nodes are put into the unavailable node list, and the node identifications of all available IMPI nodes are put into the available node list.
It is appreciated that upon query, the screening module 202 may set a check window into which the node identification of the IPMI node within each group is placed, the size of the check window being 1024, 2048, 4096, etc. When the number of IPMI nodes in the node list is smaller than or equal to 1024, the size of the inspection window is set to 1024, that is, the IPMI nodes in the node list can be put into the inspection window together for inspection. When the number of IPMI nodes on the node list is greater than 1024 and smaller than 4096, the window size is set to 2048. The plurality of IPMI nodes may be detected twice. When the number of IPMI nodes on the node list is greater than or equal to 4096, the size of the window is set to 4096. Checking that the window size is no longer increasing indefinitely is primarily a concern that the efficiency of querying the availability of IPMI nodes will become lower after the window is increased. The input information of the inspection window is the nodes in the node list, and the output information is two lists of available IPMI nodes and unavailable IPMI nodes.
The collection module 203 is configured to establish a plurality of threads and run the plurality of threads in a parallel manner to collect target data of the plurality of target IPMI nodes, where each thread is configured to collect data of at least one target IPMI node. The collection module 203 may collect the target data of the target IPMI nodes in various ways. Data acquisition is performed on the target IPMI node in a parallel mode to the greatest extent, so that the efficiency is improved. Of course, due to the performance limitation of the electronic device itself, the number of threads that can be simultaneously run at a time cannot be infinite, and the overall running efficiency is rapidly reduced when the number of threads exceeds a certain number, thereby affecting the acquisition of target data and affecting other operations of the electronic device.
In some embodiments, the collection module 203 is configured to divide the plurality of target IPMI nodes into a plurality of first sets, each of the first sets comprising a plurality of target IPMI nodes; for each of the first sets, a plurality of threads are started in parallel to collect a plurality of target IPMI nodes in each of the first sets. The number of target IPMI nodes in each first set is less than the number of threads which can be run by the electronic device at the same time. The division may be performed based on the type of the slave device corresponding to each IPMI, specifically, the division may be performed according to format information of the target data of each slave device, or may be performed according to the data volume of the target data, so as to improve the efficiency of data acquisition.
Specifically, in some embodiments, the acquisition module 203 is specifically configured to: acquiring type information of each slave device, and acquiring format information of target data of each target IPMI node according to the type information; dividing the plurality of target IPMI nodes into a plurality of first sets according to the format information of each target data, wherein each first set comprises a plurality of target IPMI nodes. Since different types of slave devices have target data with different formats, in order to ensure that the same batch of parallel execution threads can more efficiently complete the collection of the target data of each target IPMI node in the same first set, the target IPMI nodes with the target data with the same format are placed in the same batch of parallel execution threads, so that the efficiency can be improved.
In other embodiments, the acquisition module 203 may be configured to: acquiring data volume information of target data of each target IPMI node; dividing a plurality of target IPMI nodes into a plurality of first sets according to the data volume information, wherein in the same first set, the difference value of the data volumes of the target data of any two target IPMI nodes is smaller than a first preset threshold value. Wherein the first preset threshold may be set to a certain value, for example x1 KB. The first preset threshold may also be a dynamic value, and the size of the first preset threshold is related to the communication speed of each slave device, so as to ensure that the time for acquiring the target data of the IPMI nodes in each first set is about the same. In the same first set, the difference of the time consumption of the acquisition work of the target data of any two target IPMI nodes is less than 5 seconds. The approximate data volume of the target data of each target IPMI node can be obtained according to the historical collection record of the target data of each target IPMI node. Of course, the approximate data size of the target data of each target IPMI node may be estimated in other common ways. In the preferred embodiment, the target IPMI nodes with the same data size are divided into the same group, but considering that the data sizes may not be completely the same, a first preset threshold may be set, so as to ensure that the difference between the maximum data size and the minimum data size of the target IPMI nodes in the same first set is smaller than the first preset threshold. Therefore, the threads of the same batch can be completed in almost the same time during execution, and then the acquisition of the target data of the next batch can be carried out more quickly, so that the efficiency can be improved. For example, if 50 target IPMI nodes exist in the first set, 50 threads are simultaneously started to run in parallel, so that the target data of the 50 target IPMI nodes can be rapidly collected.
It is to be appreciated that in other embodiments the acquisition module 203 is configured to: dividing said plurality of target IPMI nodes into a plurality of second sets, each said second set comprising a plurality of target IPMI nodes; establishing a plurality of threads, wherein the plurality of threads are in one-to-one correspondence with the plurality of second sets; the plurality of threads are run in parallel such that each of the threads performs target data collection on target IPMI nodes in the corresponding second set in a serial manner. And the target data of the target IPMI nodes in each second set have the same data type, and the difference of the total data quantity of the corresponding target data in any two second sets is smaller than a second preset threshold. Wherein the second preset threshold may be a fixed amount, for example set to x2KB, which may also be a dynamic threshold set according to the transmission rate of the respective slave devices, to ensure that the total time difference between the acquisitions of the target data in the respective second sets is small. Of course, when the division is performed in this way, it is ensured that the total data volume of the target data in each second set is approximately the same as much as possible, so that it is ensured that the multiple threads can keep running in parallel for a long time. In addition, it is also necessary to ensure that the format information of the target data in the same second set is the same, and certainly, as the number of the slave devices of each type cannot be completely balanced, for some second sets, data collection can be performed on target IPMI nodes of several different types of target data.
As can be seen from the above, the data acquisition apparatus provided in the embodiment of the present application obtains a node list, where the node list includes node identifiers of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device; sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes to judge the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes; establishing a plurality of threads, and running the threads in a parallel mode to acquire target data of the target IPMI nodes, wherein each thread is used for acquiring data of at least one target IPMI node; therefore, the target data of the slave devices can be rapidly acquired, and the efficiency can be improved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the present disclosure provides an electronic device 3, including: the processor 301 and the memory 32, the processor 301 and the memory 302 being interconnected and communicating with each other via a communication bus 303 and/or other form of connection mechanism (not shown), the memory 302 storing a computer program executable by the processor 301, the processor 301 executing the computer program when the computing device is running to perform the method of any of the alternative implementations of the embodiments described above.
The embodiment of the present application provides a storage medium, and when being executed by a processor, the computer program performs the method in any optional implementation manner of the above embodiment. The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (9)

1. A data collection method for use in an electronic device to perform target data collection on IPMI nodes of a plurality of slave devices, the method comprising:
acquiring a node list, wherein the node list comprises node identifications of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device;
sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes to judge the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes;
establishing a plurality of threads, and running the threads in a parallel mode to acquire target data of a plurality of target IPMI nodes, wherein each thread is used for acquiring data of at least one target IPMI node;
wherein, the sending a query to each IPMI node according to the node identifiers of the plurality of IPMI nodes to determine the availability of each IPMI node, so as to screen out a plurality of available target IPMI nodes, comprises:
dividing the plurality of IPMI nodes into a plurality of groups, wherein each group comprises a plurality of IPMI nodes, and the formats of target data of the IPMI nodes in the same group are the same;
and sending a query instruction to the corresponding IPMI node according to the node identifications of the plurality of IPMI nodes of each group to judge the availability of each IPMI node and set the available IPMI node as the target IPMI node.
2. The method of claim 1, wherein the establishing a plurality of threads and running the plurality of threads in parallel to collect target data for an IPMI node of the plurality of target IPMI nodes comprises:
dividing the plurality of target IPMI nodes into a plurality of first sets, each of the first sets comprising a plurality of target IPMI nodes;
for the plurality of first sets, sequentially aiming at each first set, establishing a plurality of threads, and running the threads in a parallel mode to collect a plurality of target IPMI nodes in each first set, wherein each thread is used for collecting data of one target IPMI node.
3. The data collection method of claim 2, wherein said partitioning said plurality of target IPMI nodes into a first plurality of sets comprises:
acquiring type information of each slave device, and acquiring format information of target data of each target IPMI node according to the type information;
and dividing the plurality of target IPMI nodes into a plurality of first sets according to the format information of each target data.
4. The data collection method of claim 2, wherein said partitioning said plurality of target IPMI nodes into a first plurality of sets comprises:
acquiring data volume information of target data of each target IPMI node;
dividing the plurality of target IPMI nodes into a plurality of first sets according to the data volume information, wherein in the same first set, the difference value of the data volumes of the target data of any two target IPMI nodes is smaller than a first preset threshold value.
5. The data collection method of claim 1, wherein establishing a plurality of threads and running the plurality of threads in parallel to collect target data of a plurality of target IPMI nodes comprises:
dividing said plurality of target IPMI nodes into a plurality of second sets, each said second set comprising a plurality of target IPMI nodes;
establishing a plurality of threads, wherein the plurality of threads are in one-to-one correspondence with the plurality of second sets;
and running the multiple threads in a parallel mode, so that each thread performs target data acquisition on multiple target IPMI nodes in the corresponding second set in a serial mode.
6. The data collection method of claim 5, wherein the target data of the target IPMI nodes in each second set have the same data type, and a difference between total data amounts of the corresponding target data in any two second sets is smaller than a second preset threshold.
7. A data collection apparatus, for use in an electronic device to collect hardware information from IPMI nodes of a plurality of slave devices, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a node list, the node list comprises node identifications of a plurality of IPMI nodes to be detected, and each IPMI node corresponds to one slave device;
the screening module is used for sending a query instruction to each IPMI node according to the node identifiers of the plurality of IPMI nodes so as to judge the availability of each IPMI node, and therefore a plurality of available target IPMI nodes are screened out;
the collection module is used for establishing a plurality of threads and running the threads in a parallel mode so as to collect target data of a plurality of target IPMI nodes, and each thread is used for collecting data of at least one target IPMI node;
the screening module is specifically configured to divide the plurality of IPMI nodes into a plurality of groups, each group includes a plurality of IPMI nodes, and the formats of target data of the IPMI nodes in the same group are the same; and sending a query instruction to the corresponding IPMI node according to the node identifications of the plurality of IPMI nodes of each group to judge the availability of each IPMI node and set the available IPMI node as the target IPMI node.
8. An electronic device comprising a processor and a memory, the memory storing computer readable instructions that, when executed by the processor, perform the method of any of claims 1-6.
9. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the method according to any of claims 1-6.
CN202010713727.XA 2020-07-22 2020-07-22 Data acquisition method and device, electronic equipment and storage medium Active CN111885159B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010713727.XA CN111885159B (en) 2020-07-22 2020-07-22 Data acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010713727.XA CN111885159B (en) 2020-07-22 2020-07-22 Data acquisition method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111885159A CN111885159A (en) 2020-11-03
CN111885159B true CN111885159B (en) 2022-06-14

Family

ID=73155345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010713727.XA Active CN111885159B (en) 2020-07-22 2020-07-22 Data acquisition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111885159B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500582A (en) * 2022-02-11 2022-05-13 浙江大华技术股份有限公司 Log collection method and device, storage medium and electronic device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110543409A (en) * 2019-08-29 2019-12-06 南方电网数字电网研究院有限公司 Hardware data acquisition method and device, computer equipment and storage medium
CN111092921A (en) * 2018-10-24 2020-05-01 北大方正集团有限公司 Data acquisition method, device and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10929290B2 (en) * 2016-12-31 2021-02-23 Intel Corporation Mechanism for providing reconfigurable data tiers in a rack scale environment
CN108173715A (en) * 2018-01-02 2018-06-15 郑州云海信息技术有限公司 A kind of method, apparatus and equipment for obtaining distributed storage server hardware information
CN109684051B (en) * 2018-12-17 2020-08-11 杭州玳数科技有限公司 Method and system for asynchronously submitting hybrid big data task

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111092921A (en) * 2018-10-24 2020-05-01 北大方正集团有限公司 Data acquisition method, device and storage medium
CN110543409A (en) * 2019-08-29 2019-12-06 南方电网数字电网研究院有限公司 Hardware data acquisition method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111885159A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
CN108322345B (en) Method for issuing fault repair data packet and server
CN111818159A (en) Data processing node management method, device, equipment and storage medium
CN111555963A (en) Message pushing method and device, electronic equipment and storage medium
CN113656168A (en) Method, system, medium and equipment for automatic disaster recovery and scheduling of traffic
CN111538563A (en) Event analysis method and device for Kubernetes
CN110708369B (en) File deployment method and device for equipment nodes, scheduling server and storage medium
CN111966289A (en) Partition optimization method and system based on Kafka cluster
CN111651595A (en) Abnormal log processing method and device
CN111930493A (en) NodeManager state management method and device in cluster and computing equipment
CN107203464B (en) Method and device for positioning service problem
CN114490078A (en) Dynamic capacity reduction and expansion method, device and equipment for micro-service
CN111885159B (en) Data acquisition method and device, electronic equipment and storage medium
CN111291018B (en) Data management method, device, equipment and storage medium
CN109697117B (en) Terminal control method, terminal control device and computer-readable storage medium
CN116089477B (en) Distributed training method and system
CN105187490B (en) A kind of transfer processing method of internet of things data
CN116886490A (en) Server inspection method and device and computer readable storage medium
CN116225609A (en) Pod scheduling method, device and equipment of Kubernetes cluster and computer readable medium
CN113448747B (en) Data transmission method, device, computer equipment and storage medium
CN109257256A (en) Apparatus monitoring method, device, computer equipment and storage medium
CN113867736B (en) Deployment scheme generation method and device
CN109918277A (en) Electronic device, the evaluation method of system log cluster analysis result and storage medium
CN111669294B (en) Monitoring system configuration method, device, monitoring system and storage medium
CN114070755B (en) Virtual machine network flow determination method and device, electronic equipment and storage medium
CN114363150A (en) Network card connectivity monitoring method and device for server cluster

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant