CN110912782A - Data acquisition method, device and storage medium - Google Patents

Data acquisition method, device and storage medium Download PDF

Info

Publication number
CN110912782A
CN110912782A CN201911301521.XA CN201911301521A CN110912782A CN 110912782 A CN110912782 A CN 110912782A CN 201911301521 A CN201911301521 A CN 201911301521A CN 110912782 A CN110912782 A CN 110912782A
Authority
CN
China
Prior art keywords
data
acquisition
acquired
rule
task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911301521.XA
Other languages
Chinese (zh)
Other versions
CN110912782B (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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201911301521.XA priority Critical patent/CN110912782B/en
Publication of CN110912782A publication Critical patent/CN110912782A/en
Application granted granted Critical
Publication of CN110912782B publication Critical patent/CN110912782B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The application provides a data acquisition method, a data acquisition device and a storage medium, which are used for simplifying a data acquisition process. The method comprises the following steps: acquiring a data acquisition task; the data acquisition task comprises first equipment description information used for determining acquired equipment; determining at least one parsing rule associated with the data collection task; the at least one analysis rule belongs to an analysis rule set, and the analysis rule set comprises analysis rules for analyzing data of different network protocols; and analyzing the data generated by the acquired equipment according to the at least one analysis rule to obtain the acquired data of the acquired equipment.

Description

Data acquisition method, device and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data acquisition method, an apparatus, and a storage medium.
Background
With the development of science and technology, the data acquisition method is more intelligent. In some cases, for example, when network data is collected, due to different manufacturers or device models of collected devices in practical applications, the sources of the network data are various, and the formats of the network data are various, so that when the network data is collected, developers are often required to modify and debug codes according to different collection conditions, and the data collection process is complicated.
Disclosure of Invention
The embodiment of the application provides a data acquisition method, a data acquisition device and a storage medium, which are used for simplifying a data acquisition process.
In a first aspect, a data acquisition method is provided, which includes:
acquiring a data acquisition task; the data acquisition task comprises first equipment description information used for determining acquired equipment;
determining at least one parsing rule associated with the data collection task; the at least one analysis rule belongs to an analysis rule set, and the analysis rule set comprises analysis rules for analyzing data of different network protocols;
and analyzing the data generated by the acquired equipment according to the at least one analysis rule to obtain the acquired data of the acquired equipment.
In the embodiment of the application, after the first device description information is obtained, the parsing rules can be matched from the parsing rules of the data corresponding to different network protocols based on the first device description information, so that the data corresponding to different network protocol devices can be collected and parsed, and in the process of collecting data of different collected devices, only the corresponding parsing rules need to be matched, compared with the traditional method that in the process of collecting data corresponding to different network protocols, a programmer needs to manually modify the collection rules, or the programmer needs to manually switch the parsing rules corresponding to different network protocols, in the embodiment of the application, the data collection process is simpler, and the automation degree is higher; in addition, the data acquisition process does not need excessive participation of users, and the use process of the users is more convenient.
Optionally, the task of acquiring data includes:
acquiring an IP address of a device to be acquired;
establishing communication connection with the collected equipment according to the IP address;
acquiring first device description information of the acquired device; wherein the first device description information includes the manufacturer of the acquired device and the IP address;
and generating a data acquisition task according to the first equipment description information.
In the embodiment of the application, complete first equipment description information can be acquired through the IP address, information provided by a user is reduced, user experience is improved, excessive information does not need to be manually input by the user, and the situations of abnormal data acquisition process and the like caused by user input errors are avoided.
Optionally, the data collection task further includes a first collection item, and determining at least one parsing rule associated with the data collection task includes:
determining a first analysis rule subset matched with the first equipment description information in an analysis rule set;
determining a first analysis rule required for analyzing the data corresponding to the first acquisition item in the first analysis rule subset;
if the first analysis rule is determined to be associated with a second acquisition item, determining a second analysis rule required for analyzing data corresponding to the second acquisition item; wherein the at least one parsing rule associated with the first device description information comprises the first parsing rule and the second parsing rule.
In the embodiment of the application, the analysis rule may include associated acquisition items, a second analysis rule matched with the associated acquisition items needs to be determined, and the association relationship between the analysis rule and the acquisition items is automatically determined, so that the process of acquiring the acquired data is more automated, the number of the acquisition items required to be input by a user is reduced, and the association relationship between the analysis rule and the acquisition items is automatically determined, so that the method can adapt to more complex data acquisition scenes and the accuracy of the acquired data is higher.
Optionally, analyzing the data generated by the acquired device according to the at least one analysis rule to obtain the acquired data of the acquired device, including:
if the data acquisition task does not comprise the external acquisition item parameter value corresponding to the first acquisition item, analyzing the data corresponding to the second acquisition item according to the second analysis rule to obtain the data acquisition result of the second acquisition item; analyzing the data corresponding to the first acquisition item according to the data acquisition result and the first analysis rule to obtain the acquisition data of the acquired equipment; alternatively, the first and second electrodes may be,
if the data acquisition task further comprises an external acquisition item parameter value corresponding to the first acquisition item, analyzing data corresponding to the first acquisition item according to the external acquisition item parameter value and the first analysis rule to obtain the acquired data of the acquired equipment.
In the embodiment of the application, in the process of data acquisition and analysis according to the analysis rule, the second acquisition item associated with the first analysis rule can be directly matched, and the acquired data of the acquired equipment is acquired according to the acquired data acquisition result of the second acquisition item, so that the method is suitable for a more complex data acquisition process. Or, parameter values of some external acquisition item parameter values may be acquired, the acquired data of the acquired device is acquired according to the parameter values of the external acquisition item parameter values, and the data acquisition result of the second acquisition item may be obtained by analyzing data by an analysis rule or may be an externally specified value. The analysis rule analysis data can be indirectly controlled according to the parameter value of the external acquisition item parameter value, so that the acquisition data meeting the limitation of the external acquisition item parameter value can be obtained, the acquired acquisition data can better meet the requirements of users, and the flow consumption for transmitting useless data is reduced to a certain extent.
Optionally, determining at least one parsing rule associated with the data collection task includes:
if the task identifier of the data acquisition task is the same as the task identifier of the cached historical data acquisition task, determining an analysis rule associated with the historical data acquisition task as an analysis rule associated with the first equipment description information; wherein the task identifier of the data collection task is obtained by calculating the first device description information and/or collection items in the data collection task.
In the embodiment of the application, each data acquisition task and the corresponding analysis rule can be stored in the cache, when the data acquisition task is executed, the historical data acquisition task which is the same as the data acquisition task can be determined from the cache, the analysis rule corresponding to the historical data acquisition task is determined as the analysis rule of the data acquisition task, and the calculation overhead in the data acquisition process can be relatively reduced.
Optionally, the at least one parsing rule includes a combination manner between the acquisition items corresponding to the parsing rules, and the analyzing, according to the at least one parsing rule, the data generated by the acquired device to obtain the acquisition data of the acquired device includes:
acquiring initial data generated by the acquired equipment corresponding to each acquisition item in the data acquisition task;
analyzing each initial data to obtain analyzed data corresponding to each acquisition item;
and according to the combination mode, combining the analyzed data to obtain the acquired data of the acquired equipment.
In the embodiment of the application, after the collected data are analyzed, the analyzed data corresponding to each collected item can be combined according to the combination mode of the collected items among the analysis rules, so that the integrity of the combined data is stronger, the structuralization degree is higher, the hierarchical relationship among the combined data is more definite, the combined data is more complete, and the readability is higher.
Optionally, the method further includes:
if the configuration information meeting the preset format is determined, analyzing the configuration information to obtain an analysis rule to be added;
and if the analysis rule set does not have the analysis rule with the same analysis rule to be added, writing the analysis rule to be added into the analysis rule set.
In the embodiment of the application, a new analysis rule can be added to the analysis rule set, so that the range of data which can be analyzed by the analysis rule set is wider, the requirements of more users are met, the new analysis rule can be added by adding configuration information meeting the preset format, the mode of adding the analysis rule is simple, and the operability of the users is improved to a certain extent.
Optionally, each parsing rule in the parsing rule set is associated with one processing unit, and each processing unit is configured to implement one parsing rule.
In the embodiment of the application, each analysis rule can be associated with one processing unit, so that when data is acquired, different analysis rules can be executed in parallel through a plurality of processing units, the data acquisition efficiency is improved, the waiting time of a user is reduced, and the use experience of the user is improved. In addition, different data can be acquired at the same time through parallel processing, conditions are provided for the causal relationship and the like of subsequent analysis data, and the difficulty of the subsequent data analysis work is reduced to a certain extent.
Optionally, each processing unit includes an actuator and an analyzer, the actuator is configured to obtain data generated by the acquired device corresponding to an analysis rule, and the analyzer is configured to analyze the data obtained by the corresponding actuator.
In the embodiment of the application, one processing unit can be divided into an actuator and an analyzer, the actuator is used for acquiring data of one network protocol, the analyzer is used for analyzing the data format, the actuator corresponding to the protocol is only needed to be used for acquiring data from different network protocols, the acquired data is analyzed by using one data analyzer, and the data processing is completed by using the combined actuator and the analyzer as one processing unit, so that the analyzer and the actuator are in a decoupling state, and the data acquisition and analysis process is more efficient.
Optionally, the data collection task further includes one or more of collection items, a combination manner between the collection items, or a filtering rule for filtering the collected data.
In the embodiment of the application, the data acquisition task can comprise various information, so that the analysis rule associated with the data acquisition task can be more accurately matched, the accuracy of the acquired data of the acquired equipment is higher, and the automation degree of the process of acquiring the acquired data of the acquired equipment is higher.
In a second aspect, an apparatus for data acquisition is provided, including:
an acquisition module: for obtaining a data acquisition task; the data acquisition task comprises first equipment description information used for determining acquired equipment;
a processing module: for determining at least one parsing rule associated with the data collection task; the at least one analysis rule belongs to an analysis rule set, and the analysis rule set comprises analysis rules for analyzing data corresponding to equipment of different network protocols; and analyzing the data generated by the acquired equipment corresponding to the first equipment description information according to the at least one analysis rule to obtain the acquired data of the acquired equipment.
Optionally, the obtaining module is specifically configured to: acquiring an IP address of a device to be acquired; and obtaining first device description information of the acquired device; wherein the first device description information includes the manufacturer of the acquired device and the IP address;
the processing module is specifically configured to: establishing communication connection with the collected equipment according to the IP address; and generating a data acquisition task according to the first equipment description information.
Optionally, the data collection task further includes a first collection item, and the processing module is specifically configured to:
determining a first analysis rule subset matched with the first equipment description information in an analysis rule set;
determining a first analysis rule required for analyzing the data corresponding to the first acquisition item in the first analysis rule subset;
if the first analysis rule is determined to be associated with a second acquisition item, determining a second analysis rule required for analyzing data corresponding to the second acquisition item; wherein the at least one parsing rule associated with the first device description information comprises the first parsing rule and the second parsing rule.
Optionally, the processing module is specifically configured to:
if the data acquisition task does not comprise the external acquisition item parameter value corresponding to the first acquisition item, analyzing the data corresponding to the second acquisition item according to the second analysis rule to obtain the data acquisition result of the second acquisition item; analyzing the data corresponding to the first acquisition item according to the data acquisition result and the first analysis rule to obtain the acquisition data of the acquired equipment; alternatively, the first and second electrodes may be,
if the data acquisition task further comprises an external acquisition item parameter value corresponding to the first acquisition item, analyzing data corresponding to the first acquisition item according to the external acquisition item parameter value and the first analysis rule to obtain the acquired data of the acquired equipment.
Optionally, the processing module is specifically configured to:
if the task identifier of the data acquisition task is the same as the task identifier of the cached historical data acquisition task, determining an analysis rule associated with the historical data acquisition task as an analysis rule associated with the first equipment description information; wherein the task identifier of the data collection task is obtained by calculating the first device description information and/or collection items in the data collection task.
Optionally, the obtaining module is specifically configured to:
acquiring initial data generated by the acquired equipment corresponding to each acquisition item in the data acquisition task;
analyzing each initial data to obtain analyzed data corresponding to each acquisition item;
and according to the combination mode, combining the analyzed data to obtain the acquired data of the acquired equipment.
Optionally, the processing module is further configured to:
if the configuration information meeting the preset format is determined, analyzing the configuration information to obtain an analysis rule to be added;
and if the analysis rule set does not have the analysis rule with the same analysis rule to be added, writing the analysis rule to be added into the analysis rule set.
Optionally, each parsing rule in the parsing rule set is associated with one processing unit, and each processing unit is configured to implement one parsing rule.
Optionally, each processing unit includes an executor and an analyzer, where the executor is configured to obtain data generated by the acquired device corresponding to an analysis rule, and the analyzer is configured to analyze the data obtained by the executor corresponding to the analyzer.
Optionally, the data collection task further includes one or more of collection items, a combination manner between the collection items, or a filtering rule for filtering the collected data.
In a third aspect, an apparatus for data acquisition is provided, including:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory and executing the method of any of the first aspect according to the obtained program instructions.
In a fourth aspect, there is provided a storage medium having stored thereon computer-executable instructions for causing a computer to perform the method of any of the first aspects.
Drawings
Fig. 1 is an application scenario of a data acquisition method according to an embodiment of the present application;
fig. 2 is a flowchart of a data acquisition method according to an embodiment of the present application;
fig. 3 is a flowchart for determining device description information of an acquired device according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a parsing rule set according to an embodiment of the present application;
FIG. 5 is a flow chart illustrating a process for determining at least one parsing rule associated with a data collection task according to an embodiment of the present application;
fig. 6 is a flowchart for obtaining acquisition data of an acquired device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a data acquisition apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a data acquisition device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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.
In addition, in the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
In order to simplify the data acquisition process, the present application provides a data acquisition method, please refer to fig. 1, which is an application scenario of the data acquisition method, and the application scenario includes a device 101 for a user to operate, a data acquisition apparatus 102, and an acquired device 103. The captured device 103 in fig. 1 includes a first network device 104, a second network device 105, a first server 106, and a second server 107. The device 101 for user operation and the data acquisition device 102 can communicate with each other, the data acquisition device 102 and the device 103 to be acquired can communicate with each other, and the user can acquire data of the device 103 to be acquired by operating the device 101 for user operation.
Fig. 1 illustrates an example in which the device 101 for user operation is a terminal device, and actually does not limit the specific type of the device 101 for user operation. Fig. 1 is an example of a server corresponding to the data acquisition device 102 as a terminal device, and actually does not limit the specific type of the data acquisition device 102. Fig. 1 illustrates the captured device 103 as a first network device 104, a second network device 105, a first server 106, and a second server 107, and actually does not limit the specific type of the captured device 103. The number of the acquired devices 103 may be one or more, and the number of the acquired devices 103 is not limited in the embodiment of the present application.
Based on the application scenario of fig. 1, a data acquisition method in the embodiment of the present application is described below, please refer to fig. 2, which is a flowchart of the data acquisition method. The method comprises the following steps:
s21, acquiring a data acquisition task;
s22, determining at least one analysis rule associated with the data collection task;
and S23, analyzing the data generated by the acquired equipment corresponding to the equipment description information according to at least one analysis rule to obtain the acquired data of the acquired equipment 103.
The general idea in the embodiments of the present application is described below:
the device 101 for the user to operate obtains a data acquisition request from the user and sends the data acquisition request to the data acquisition apparatus 102, and the data acquisition apparatus 102 receives the data acquisition request from the device 101 for the user to operate. The data acquisition device 102 analyzes the received data acquisition request, obtains first device description information used for determining the acquired device 103 in the data acquisition request, and generates a corresponding data acquisition task. The data collection device 102 determines, in the set of parsing rules, at least one parsing rule associated with the data collection task based on the obtained data collection task. The data acquisition device 102 analyzes the data generated by the acquired equipment 103 corresponding to the data acquisition task according to the determined at least one analysis rule, so as to obtain the acquired data of the acquired equipment 103.
In the embodiment of the present application, in the analysis rule set, an analysis rule associated with the data acquisition task is determined for the data acquisition task, and the acquired data of the acquired device 103 is obtained according to the determined analysis rule. The analysis rule may be an analysis rule for analyzing data obtained through different network protocols, so that different network protocols may be automatically matched in the process of obtaining data generated by the acquired device 103, and the corresponding analysis rule may be adopted for analysis in the process of analyzing data generated by the acquired device 103, so that the data acquisition device 102 is not limited by the network protocols when acquiring data of the acquired device 103, and the data acquisition device 102 may acquire acquired data of the acquired device 103 from various sources. In addition, in the embodiment of the present application, methods for analyzing different data formats are encapsulated into different analysis rules, and the data acquisition device 102 may automatically adapt to a required analysis rule in the process of analyzing data generated by the acquired device 103, so that the process of data acquisition in the embodiment of the present application is simpler than the existing method that a programmer needs to modify an analysis rule to acquire data in different data formats, or a method that a programmer needs to manually switch analysis rules corresponding to other network protocols to acquire data in different network protocols.
After the general idea of the embodiments of the present application is introduced, specific embodiments of each step will be described in detail below.
The data collection apparatus 102 may receive a data collection request from the user for the user-operated device 101 before performing the data collection task at S21.
Specifically, a user may submit a data acquisition request to the device 101 for user operation by operating the device 101 for user operation, and the device 101 for user operation receives the data acquisition request from the user.
After the apparatus 101 for user operation receives the data collection request from the user, the data collection device 102 executes S21 to acquire a data collection task.
Specifically, the device 101 for user operation sends a data acquisition request to the data acquisition device 102, and the data acquisition device 102 receives the data acquisition request from the device 101 for user operation and generates a data acquisition task according to the data acquisition request. The data collection task may include first device descriptive information for determining the collected device 103. The first device description information may include address information of the acquired device 103. The address information may be an IP address of the acquired device 103, and the data acquisition apparatus 102 may determine the acquired device 103 through the IP address, so as to establish a communication connection with the acquired device 103; or the address information may be an address mask or a wildcard address descriptor, and the network system where the data acquisition device 102 is located stores all available device address information sets, or the data acquisition device 102 may acquire all available device address information sets from the network system through a public interface, and in all available device address information sets, the data acquisition device 102 determines the IP address of the acquired device 103 through the address mask or the wildcard address descriptor, and the data acquisition device 102 may determine the acquired device 103 through the IP address, thereby establishing a communication connection with the acquired device 103.
After establishing a communication connection with the device 103 to be acquired, the data acquisition apparatus 102 may acquire data from the device 103 to be acquired through a different network protocol. The data acquired by the data acquisition apparatus 102 to the acquired device 103 may be all data of the acquired device 103, or may be all data transmitted by the acquired device 103. Different network protocols may use a common interface for data transmission, or may use different interfaces for data transmission, which is not limited in particular.
The first device description information may include, in addition to the address information, other device information of the acquired device 103, where the other device information may be one or more of a manufacturer of the acquired device 103, a device model of the acquired device 103, and a version of acquisition software in the acquired device 103. The source of the other device information is explained below.
Other device information may be from user input; alternatively, the first and second electrodes may be,
other device information can be determined through address information; alternatively, the first and second electrodes may be,
some of the other device information may be from user input, and another of the other device information may be determined from the some of the user input.
The following describes a process of determining other device information of the acquired device 103.
Referring to fig. 3, for a flowchart of determining other device information of the acquired device 103, a specific flow of the data acquisition apparatus 102 determining other device information of the acquired device 103 is described as follows, wherein the execution sequence of step S32 and step S33 may be interchanged, and is not limited specifically.
S31, the data acquisition device 102 sends the supplier inquiry information to the acquired device 103, and determines the supplier of the acquired device 103.
Specifically, after the data acquisition device 102 establishes a communication connection with the acquired device 103 through the address information, manufacturer query information may be sent to the acquired device 103, the acquired device 103 receives the manufacturer query information from the data acquisition device 102 and returns manufacturer information to the data acquisition device 102, and the data acquisition device 102 receives the manufacturer information from the acquired device 103 and determines the manufacturer of the acquired device 103.
For example, the data acquisition apparatus 102 may determine the manufacturer of the acquired device 103 by using a manufacturer query method provided in a Simple Network Management Protocol (SNMP). The data acquisition apparatus 102 transmits a common Object Identifier (OID) to the acquired device 103: 1.3.6.1.2.1.1.2.0, the acquired device 103 receives the OID from the data acquisition device 102 and returns the product code: 4881. the data acquisition device 102 receives the manufacturer code from the acquired device 103, and determines the manufacturer of the acquired device 103 as a according to the received manufacturer code.
S32, the data acquisition apparatus 102 sends the device model query information to the acquired device 103, and determines the device model of the acquired device 103.
Specifically, the data acquisition device 102 sends device model query information to the acquired device 103, the acquired device 103 receives the device model query information from the data acquisition device 102 and returns device model information to the data acquisition device 102, and the data acquisition device 102 receives the device model information from the acquired device 103 and determines the device model of the acquired device 103.
For example, the data acquisition apparatus 102 may determine the device model of the acquired device 103 using a private OID provided in the SNMP network protocol. The specific query process is the same as the process of querying the manufacturer of the collected device 103, and is not described herein again.
S33, the data acquisition device 102 sends the software version query information to the acquired device 103, and determines the software version of the acquired device 103.
Specifically, the data acquisition device 102 sends software version query information to the acquired device 103, the acquired device 103 receives the software version query information from the data acquisition device 102 and returns software version information to the data acquisition device 102, and the data acquisition device 102 receives the software version information from the acquired device 103 and determines the software version of the acquired device 103.
For example, the data acquisition apparatus 102 may determine the software version of the acquired device 103 using a private OID provided in the SNMP network protocol. The specific query process is the same as the process of querying the manufacturer of the collected device 103, and is not described herein again.
As an embodiment, the data collection task may include a first collection item in addition to the first device description information.
In particular, the user may not need to collect all of the data of the captured device 103, or the user may not need to collect all of the data transmitted by the captured device 103. The data collection task may further include, in addition to the first device description information, a first collection item, where the first collection item is used to define data that the user wants to collect, and the data collection device 102 may collect only data corresponding to the first collection item. The data collection request submitted by the user may include a specific collection requirement, and the data collection device 102 generates a data collection task after receiving the data collection request from the device 101 operated by the user. In the data collection task, a first collection item may be further included to indicate a specific data collection requirement of the user, where the first collection item may be one or multiple, and is not limited in particular. The first acquisition item may be understood as a parameter type for the acquired device 103, such as a temperature of the acquired device 103, a CPU usage rate, a memory usage rate, and the like.
After the data collection device 102 acquires the data collection task, S22 is executed to determine at least one parsing rule associated with the data collection task. At least one analysis rule belongs to the analysis rule set, and the at least one analysis rule comprises analysis rules matched with first acquisition items in the data acquisition task and can also comprise other analysis rules corresponding to second acquisition items associated with the matched analysis rules. For example, a first parsing rule of the at least one parsing rule is a parsing rule matching a first collection item in the data collection task, and a second parsing rule of the at least one parsing rule is a parsing rule matching a second collection item associated with the first parsing rule, which will be described below as an example of a manner of determining the at least one parsing rule according to different data sources.
Firstly, the method comprises the following steps:
the data collection device 102 may determine at least one parsing rule from the set of parsing rules that matches the data collection task.
Specifically, the parsing rule set stores various parsing rules that can be used for parsing data generated by the collected device 103, and after obtaining the first device description information, the data collection apparatus 102 may determine, according to the first device description information, a first parsing rule subset that matches the first device description information from the parsing rule set, and in the first parsing rule subset, determine a first parsing rule that is required for parsing data corresponding to a first collection item in the data collection task. The first subset of parsing rules may be understood as some or all of the parsing rules in the rule set. If the first parsing rule is associated with a second parsing rule, the second parsing rule may be determined to be at least one parsing rule matching the data collection task.
In a possible embodiment, the collected devices 103 involved in the data collection task may be one or more, and the data collection apparatus 102 may determine a parsing rule that can parse the data generated by each collected device 103.
In one possible embodiment, the first device description information may be precise device description information or ambiguous device description information. The accurate device description information indicates that the device description information is more detailed, the fuzzy device description information indicates that the device description information is broader, and the data acquisition device 102 may directly acquire data of the acquired device 103 according to the fuzzy first device description information after acquiring the fuzzy first device description information, or may further acquire the accurate first device description information and then acquire data of the acquired device 103, where the manner of further acquiring the accurate first device description information may refer to the contents discussed in the foregoing steps S31 to S33, and is not described herein again.
For example, a user may need to collect data for a device having a certain characteristic, and device description information of the collected device 103 is entered in the data collection request, and the device description information may be precise device description information, such as including the manufacturer of the collected device 103, the device model, the version of the collection software, and the like, or the device description information may be fuzzy device description information, such as including only the manufacturer of the collected device 103.
In the parsing rule set, the data collection device 102 may match the parsing rule for the accurate first device description information, and the range of the determined parsing rule is smaller, or may match the parsing rule for the fuzzy first description information, and the range of the determined parsing rule is larger.
Specifically, the device description information declared by one parsing rule may be accurate device description information, or may be fuzzy device description information, and the number of acquired devices 103 that can be matched with the accurate device description information declared by the parsing rule is smaller, and the number of acquired devices 103 that can be matched with the fuzzy device description information declared by the parsing rule is larger. The way of declaring the fuzzy device description information can be to use a regular expression to describe the device model, collect the software version of the software, and the like; or, the device model and the software version of the acquisition software may be described by using a Lightweight Directory Access Protocol (LDAP); alternatively, a combination of several types of precise device description information may be possible; alternatively, the device description information may be used as the collection item, for example, the manufacturer may be used as the collection item in the data collection task, and so on.
The parsing rule set includes all parsing rules that can be used for parsing data corresponding to different network protocols, and the structure of the parsing rule set may be a tree structure or a table form, and the structure of the parsing rule is not limited in the present application. Each parsing rule in the parsing rule set has a function of parsing data of a certain collected device or devices. Each parsing rule includes one or more of the following:
(1) the device type information of the collected device 103 includes one or more of a manufacturer, a software version, a device model, and the like. That is, the device type information corresponding to the device that can be analyzed by the analysis rule;
(2) the collection items corresponding to the analysis rules are used for publishing the own analysis capability set to the outside;
(3) the collection items associated with the parsing rule refer to other collection items that may be relied upon to implement a certain parsing rule. Based on the dependent acquisition items, the analysis rules corresponding to the dependent other acquisition items can be found;
(4) the combination mode of the collection items among the analysis rules is used for explaining the actions of how to assemble the hierarchical relationship and the level relationship of each collection item, whether to add the collection items into the list and the like.
In one possible embodiment, the parsing rule set may be extended based on configuration information satisfying a preset format. The extended parsing rule may be a support for data collection of a new network protocol, or may be a support for data collection of a new device type, or may be one or more of supports for data collection of a new collection item, which is not limited in particular.
Specifically, the parsing rules in the parsing rule set can be expanded or cancelled, and the parsing rule set is dynamically managed. One parsing rule may have a definition element describing data corresponding to a network protocol type that the parsing rule can parse, or may have a definition element describing a device type supported by the parsing rule, or may have a definition element describing an acquisition item generated by a parsing rule unit, or may have a definition element describing an acquisition item that the parsing rule may be associated with, or may have a definition element describing a simple combination of acquisition items, or may have one or more definition elements describing a process of parsing data by the parsing rule.
There are various specific methods for extending the parsing rule, and three of the methods are first described below as examples.
B1:
And packaging the parsing rule with the annotation, and expanding the parsing rule set according to the declared annotation.
Specifically, in the backend file of the acquisition software, the parsing rule may be written in the form of a code, and the parsing rule is labeled in an annotation manner, that is, the parsing rule is declared, so that the scanning module of the data acquisition device 102 acquires the parsing rule according to the annotation statement. When the acquisition software is started or runs, the scanning module scans the parsing rules marked with the annotations in a software package of the acquisition software, and registers the scanned parsing rules marked with the annotations in a parsing rule set.
There are many label parsing rules, and one of them is described as an example below.
Specifically, @ protocol, the network protocol required by the parsing rule is labeled. A network protocol is realized as a data acquisition code class, the network protocol type stated in @ protocol corresponds to a network protocol data acquisition class, and the data acquisition class is adopted to execute the data acquisition of the corresponding network protocol; @ deviceType, marking associated device type information, such as one or more of the manufacturer of the device, the device model, and the software version of the acquisition software; @ product, marking the acquisition item that the analysis rule can analyze, and including the way of acquiring the data corresponding to the acquisition item, and can be matched with the network protocol type stated in @ protocol, for example, for the SNMP protocol, the acquisition item that can be analyzed can be stated as the manufacturer, and the acquisition way is the way of using OID as 1.3.6.1.2.1.1.2.0; @ require, labeling the collection items associated with the parsing rule; @ combineWay, labeling the structured combination mode of the acquisition items; @ parser, label data parsing process. The parsing of a data format is realized as a class in a code mode, and a parsing process stated in @ parser corresponds to a parsing rule. An parsing rule is implemented as a code class, and annotations are marked on the code class, thereby declaring the capabilities of the parsing rule.
B2:
And expanding the analysis rule set according to the analysis rule stated by the configuration file.
Specifically, files corresponding to different parsing rules may be newly added to a back-end file of the acquisition software, and a configuration file corresponding to the newly added parsing rule is compiled, where the configuration file is used to indicate a position of the file corresponding to the newly added parsing rule, so that the scanning module in the data acquisition device 102 determines the file position of the parsing rule according to the indication information of the configuration file, adds the parsing rule to the parsing rule set, and continues to scan a next parsing rule declared by the configuration file.
For example, a user writes an eXtensible markup language (XML) file, marks the position of an analysis rule file in the XML file, obtains the position of the analysis rule file after a scanning module obtains the XML file, obtains an analysis rule corresponding to the position information according to the position information, and adds the analysis rule to an analysis rule set; alternatively, the user writes a service description language (DSL) file, and marks the position of the parsing rule file in the header information of the DSL file, so that the scanning module can add the parsing rule to the parsing rule set.
B3:
The set of parsing rules is extended according to parsing rules declared in a service description language (DSL) file.
Specifically, the acquisition process can be implemented as a dynamic language-based DSL file, so that the process of extending the parsing rule is faster and more flexible. In DSL, the process of data parsing may consist of a certain number of sub-processes, each sub-process handles a specific data parsing step, each sub-process may be packaged into a syntax in DSL, and the parsing processes are assembled by combining the order of the syntax, thereby handling various types of data parsing.
Among them, there are many writing manners of DSL files, and one of them is described below as an example, that is, contents of each item are defined according to a block, which is specifically shown in table 1 below.
Please refer to table 1, which is a method for partitioning blocks in a DSL file.
TABLE 1
Figure BDA0002321908930000171
For example, the device block marks the manufacturer and the device model of the device, and collects device type information such as the version of software; labeling an analysis process of an analysis rule on the parser block; and the version information of the revision block is marked for version control.
Please refer to table 2, which is a method for dividing the internal partition of the parser block.
TABLE 2
Figure BDA0002321908930000181
For example, the product block labels a collection item set of data corresponding to a collection item that can be analyzed by the analysis rule; marking acquisition items associated with the analysis rule on the require block; marking the mode of acquiring data in the command block, and the like; and marking the way of analyzing the data by the pipeline block, and the like.
In one possible embodiment, the format of the DSL file may be multiple, and one of the file formats is described below as an example.
Specifically, the manufacturer of the acquired device 103 is "a", the device model is "N18 k", the version of the acquisition software is "10.14", the "show ARP" is adopted, data is acquired through an Address Resolution Protocol (ARP), the acquisition item is "arpTable", and the data is analyzed through the analysis rule, which specifically includes the following steps:
revision‘2019-01-01’
device{
manufacturer 'A'// definition of the manufacturer
softVersion '10.14'// define software version
model 'N18k'// defining the device model number
}
parser{
command{
ssh'show arp'
}
produce'arpTable'
pipeline{
[ analysis rule 1] "opening map
Parameter 1 parameter value
...
Parameter 1 parameter value
}
[ analysis rule 2] "opening
Parameter 1 parameter value
...
Parameter 1 parameter value
}
[ analysis rule n ] (great restriction of the size of a large area)
Parameter 1 parameter value
...
Parameter 1 parameter value
}
}
}
In a possible embodiment, the data collection apparatus 102 has an interface for importing a DSL file, which is used to import the DSL file dynamically, parse the content in the DSL file, and register the parsing rule in the parsing rule set.
In a possible embodiment, the extended parsing rule set may be scanned to a specific file location by a scanning module to obtain parsing rules, such as B1 and B2 described above, or a specific interface may be provided for the collection software to actively read the parsing rules, such as B3 described above, or the collection software may be run in a modular-support container, such as an Open Service Gateway Initiative (OSGi) container, according to a modular development manner, such as an OSGi-based lightweight KARAF container, and the newly added parsing rules and the configuration files are independently compiled into a software package, and the dynamic loading of the software package is realized by means of a thermal deployment capability of the container, the configuration files of the software package are scanned when loaded, and the content in the configuration files is parsed, and the parsing rules are registered in the parsing rule set.
For example, please refer to fig. 4, which is a schematic structural diagram of a parsing rule set.
Specifically, the parsing rule set is divided into a parsing rule set corresponding to the network device set and a parsing rule set corresponding to the server set from the root, the next level of the network device set is a network protocol set, the next level of the network protocol set is a manufacturer set of the device 103 to be acquired, the next level of the manufacturer set of the device 103 to be acquired is a device model set of the device 103 to be acquired, the next level of the device model set of the device 103 to be acquired is a version of the acquisition software in the device 103 to be acquired, and the like.
II, secondly:
the data collection device 102 may determine a first parsing rule matching the first device description information from the cached historical data collection tasks.
Specifically, in the cache, the data acquisition task and the parsing rule corresponding to the data acquisition task in each time or within a preset time period may be stored, and if the first device description information received by the data acquisition device 102 from the terminal device is the same as the second device description information in the historical data acquisition task stored in the cache, the parsing rule corresponding to the second device description information is determined as the parsing rule associated with the first device description information. The cache may be a cache in the data acquisition apparatus 102, or may be other cache devices, or may be a cloud platform, and a specific cache manner is not limited.
The manner in which at least one parsing rule is determined using two different data sources is discussed above and is described below.
The determination method is as follows:
determining a parsing rule matched with the first device description information;
and determining the matched resolution rule as at least one resolution rule.
Determining a second mode:
determining a first subset of parsing rules that match the first device description information;
if the data acquisition task comprises a first acquisition item, determining a first analysis rule which can analyze data corresponding to the first acquisition item in the first analysis rule subset;
if the first analysis rule is associated with the second acquisition item, determining a second analysis rule corresponding to the second acquisition item; wherein the at least one parsing rule associated with the data collection task comprises a first parsing rule and a second parsing rule.
Referring to fig. 5, for a flow chart of determining at least one parsing rule associated with the data collection task, a specific flow of the data collection apparatus 102 determining at least one parsing rule associated with the device description information is introduced as follows:
s51, the data collection device 102 determines a first parsing rule matching the data collection task.
Specifically, the data collection device 102 determines first device description information in the data collection task according to the received data collection task. The data acquisition device 102 determines a first parsing rule subset matched with the first device description information according to the obtained first device description information. If the data acquisition task comprises a first acquisition item, determining a first analysis rule matched with the first acquisition item in the data acquisition task in the first analysis rule subset; if the first collection item is not included in the data collection task, then the first subset of parsing rules can be considered a first parsing rule. As described above, the first device description information may be one or more of the manufacturer of the captured device 103, the device model of the captured device 103, the version of the capture software in the captured device 103, the capture item, and the like. The data acquisition device 102 matches the first device description information and the analysis rule of each information in the first acquisition item respectively to obtain a first analysis rule matched with the data acquisition task.
S52, if the first parsing rule is associated with the second collection item, the data collection device 102 determines a second parsing rule corresponding to the second collection item.
Specifically, if the first parsing rule is associated with other second collection items that do not match the parsing rule, the data collection device 102 continues to determine the parsing rule that respectively matches each collection item in the collection items associated with the first parsing rule, and obtains the second parsing rule that matches the second collection item associated with the first parsing rule. The at least one parsing rule associated with the device description information determined by the data acquisition device 102 includes a second parsing rule of the first parsing rule.
In a possible embodiment, the first device description information may include a plurality of device description information, and after each parsing rule associated with one device description information is determined, the device description information may be deleted from the first device description information, so as to prevent the data acquisition apparatus 102 from repeatedly determining the parsing rule associated with the device description information.
In one possible embodiment, the first acquisition item in the data acquisition task may be one acquisition item, or may be multiple acquisition items. The data collection device 102 may delete a collection item from the first collection item after each determination of a resolution rule associated with the collection item to prevent the data collection device 102 from repeatedly determining a resolution rule associated with the collection item.
After the data acquisition device 102 determines at least one parsing rule associated with the data acquisition task, S23 is executed, and the data generated by the acquired device 103 is parsed according to the at least one parsing rule to obtain the acquired data of the acquired device 103.
Specifically, the data acquisition device 102 determines a data acquisition mode according to a data acquisition method included in each of the at least one parsing rule, and performs data acquisition on the acquired device 103 to obtain initial data. The data acquisition device 102 analyzes the corresponding initial data according to the analysis rule to obtain the acquired data of the acquired device 103. The data acquisition process and the initial data analysis process of the data acquisition device 102 may be performed simultaneously, or the data acquisition device 102 may analyze all the initial data after acquiring all the initial data, which is not limited specifically.
A method of obtaining acquisition data of the acquired device 103 is described below.
The method for acquiring the collected data comprises the following steps:
the at least one analysis rule comprises a combination mode of equipment description information among the analysis rules and acquisition items which can be analyzed by each analysis rule, and the analyzed data corresponding to each acquisition item is obtained according to the data corresponding to each acquisition item of the at least one analysis rule; and combining the analyzed data corresponding to each acquisition item according to a corresponding combination mode to obtain the acquisition data of the acquired equipment.
Specifically, the at least one analysis rule associated with the data acquisition task determined by the data acquisition device 102 includes a combination manner of the acquisition items between each analysis rule, and after the data acquisition device 102 analyzes the initial data, the acquisition data corresponding to each acquisition item in the first acquisition item in the data acquisition task is obtained. The data acquisition device 102 combines the acquired data corresponding to each acquisition item according to the combination mode of the device description information to obtain the acquired data of the acquired device 103. The combination mode can be a parent-child combination, a flat combination or a list combination, and the like, and the specific combination mode is not limited.
For example, port data may need to obtain acquired data corresponding to each analyzed acquisition item through different analysis rules, a first analysis rule may obtain an ID of a port, that is, a portId is 2, a second analysis rule may obtain a transmittable data amount, that is, a bandwidth is 1000, then a combination manner of the two analyzed data may be determined according to a combination manner of device description information, that is, a portId and a bandwidth are a horizontal level, then the combined data is a "ports": [ { "portId": "Gi0/1", "bandwidth": 1000}].
A second method for acquiring the acquired data:
referring to fig. 6, in order to obtain a flowchart of the collected data of the collected device 103, a specific process of obtaining the collected data of the collected device 103 may be described as follows.
S61, the data collection device 102 determines whether the external collection item parameter value is included in the data collection task.
Specifically, the data acquisition device 102 determines the data acquisition mode according to the data acquisition method included in each of the at least one parsing rule, and the data acquisition device 102 determines whether the data acquisition task includes the external acquisition item parameter value. The external collection item parameter value may be intermediate information generated by the collection software in the process of collecting data, or may be parameter information input by a user, which is not limited specifically. When determining at least one analysis rule associated with the data collection task under the condition that the external collection item parameter value is included in the data collection task, after determining the first analysis rule at S51, the step S52 is not required to be executed, and the second analysis rule corresponding to the second collection item is determined.
For example, the parsing rule includes a collection item including port information, and the user defines that the port information is a Gi0/1 port, the data collection apparatus 102 determines that the data collection manner is to obtain port data through a Secure Shell (SSH) protocol, and the user defines that the port is a Gi0/1 port, that is, the parsing rule includes an external collection item parameter value Gi 0/1.
S62, if it is determined that the data collection task includes the external collection item parameter value, the data collection device 102 sets the external collection item parameter value in the context of the data collection process.
Specifically, if the data collection task includes an external collection item parameter value, the data collection device 102 sets the external collection item parameter value in the context of the data collection process. The context environment may be a variable store for storing values of the external collection item parameters to which the parsing rule relates.
For example, if the data acquisition device 102 needs to acquire port data through the SSH protocol, the data acquisition device 102 may acquire a port ID from an acquisition item input by a user as a parameter value of the port, and set the port ID in a context environment, so that the data acquisition device 102 may acquire data of the port corresponding to the ID. The port ID that the data acquisition device 102 needs to acquire is an external acquisition item, and the value corresponding to the port ID that needs to acquire is an external acquisition item parameter value.
S63, the data acquisition device 102 obtains the data generated by the acquired device 103 according to the external acquisition item parameter value and at least one analysis rule;
specifically, the data acquisition device 102 acquires data of the acquired device 103 according to the acquired external acquisition item parameter value and at least one analysis rule, so as to obtain initial data.
For example, when the data acquisition device 102 needs to acquire port data through the SSH protocol, and the parameter value of the port ID acquired by the data acquisition device 102 is 2, the data acquisition device 102 executes a show interface [2] command to acquire the data of the port with the port ID of 2.
As an example, in the process of obtaining the collected data, the network protocol may not work normally for some reason, and the data collection apparatus 102 may remove the network protocol that does not work normally from the parsing rule set, so as to prevent the data collection device from matching the network protocol that does not work normally when matching the parsing rule for the first device description information.
S64, if it is determined that the data collection task does not include the external collection item parameter value, the data collection device 102 obtains the data generated by the collected device 103 according to at least one parsing rule.
Specifically, the data acquisition device 102 obtains the data generated by the acquired device 103 according to at least one parsing rule.
S65, the data acquisition device 102 analyzes the data generated by the device 103 to obtain the data acquired by the device 103.
Specifically, the data acquisition device 102 acquires data generated by the acquired device 103 to obtain initial data. After the initial data is obtained, the data acquisition device 102 analyzes the initial data according to at least one analysis rule to obtain data corresponding to each piece of equipment description information in the first piece of equipment description information included in the at least one analysis rule.
In one possible embodiment, the correspondence of each acquisition item in the first acquisition item in the data acquisition task with the data may be specified as a correspondence in a "key-value" format. Each acquisition item in the first acquisition items is a key, and the data corresponding to the acquisition item is the value corresponding to the key. After the data acquisition device 102 analyzes the initial data, the obtained analyzed data is stored or transmitted in a "key-value" format.
For example, if the collection item is a utilization rate (CPU) of a Central Processing Unit (CPU), and the collected CPU utilization rate is 20, that is, if the key is "CPU usage", and the value corresponding to the key is 20, the parsed data format may be { "CPU usage": 20 }.
A third method for acquiring the acquired data:
each parsing rule in the parsing rule set may be associated with a processing unit, and the processing unit in the data acquisition device 102 may be configured to execute the corresponding parsing rule, so that the data acquisition device 102 may perform parallel processing when matching parsing rules for different acquisition items, thereby increasing the processing speed of the data acquisition device 102. In addition, different data can be acquired at the same time through parallel processing, conditions are provided for the causal relationship and the like of subsequent analysis data, and the difficulty of the subsequent data analysis work is reduced to a certain extent.
For example, if the reason that the CPU occupancy of a device is always high needs to be analyzed, various factors such as a memory, a device temperature, and a network IO are busy may exist, at this time, if data such as the CPU usage, the memory, the device temperature, and the network IO can be collected at the same time point, great convenience is provided in the causal relationship of data analysis, and if the data are collected at different time points, additional means are required to preprocess the data during data analysis, which undoubtedly increases the process and reduces the accuracy.
Furthermore, each processing unit comprises an actuator and an analyzer, the actuator is used for acquiring data generated by the acquired device corresponding to one analysis rule, and the analyzer is used for acquiring the data acquired by the corresponding actuator, so that synchronous acquisition and analysis of various acquired data are realized, and the acquisition and analysis processes are decoupled.
As an embodiment, the above three methods for obtaining the collected data may be implemented in combination. For example, the acquisition data process in the first method or the second method is realized by a plurality of processing units.
As an embodiment, after obtaining the data corresponding to each collection item, the data collection apparatus 102 may filter the collected data of the collected device 103 according to a preset filtering rule, so as to obtain filtered collected data. The preset filtering rule may be a filtering rule input by a user through the terminal device, or may be a filtering rule pre-stored in the data acquisition apparatus 102, which is not limited in particular.
Specifically, for the acquired data of the acquired device 103 obtained by the data acquisition device 102 according to the data acquisition task input by the user, the data acquisition device 102 may perform further filtering according to a preset filtering rule, or may send the data to the terminal device, so that the terminal device performs further filtering according to the preset filtering rule, and the data focused by the user in the acquired data is obtained.
For example, the data acquisition device 102 is disposed in an alarm system, and the data acquisition device 102 may acquire the CPU utilization of the acquired devices 103, in this case, the acquired data includes the CPU utilization of all the acquired devices 103, however, only data with the CPU utilization higher than a certain threshold is focused by the user, in this case, the filtering rule may be set to filter data with the CPU utilization smaller than 60, so that the user only obtains data of devices with the CPU utilization greater than or equal to 60.
In a possible embodiment, the data acquisition device 102 may return the acquired data to the terminal device after acquiring the acquired data of the acquired device 103, or may send the acquired data to the message middleware.
Specifically, after acquiring data of the acquired device 103, the data acquisition device 102 sends the acquired data to the terminal device, and the terminal device receives the acquired data from the data acquisition device 102, and the terminal device may perform further processing, or may directly display the acquired data to the user, specifically without limitation; or, the data collection device 102 stores the collected data to a message middleware for data exchange between other platforms, and the message middleware may be kafka, ActiveMQ, and the like, without limitation.
Based on the same inventive concept, the embodiment of the application provides a data acquisition device, and the device can realize the corresponding functions of the data acquisition method. This device corresponds to the data acquisition device 102 discussed previously. Referring to fig. 7, the apparatus includes an obtaining module 701 and a processing module 702. Wherein:
an acquisition module 701: for obtaining a data acquisition task; the data acquisition task comprises first equipment description information used for determining the acquired equipment;
the processing module 702: for determining at least one parsing rule associated with the data collection task; at least one analysis rule belongs to an analysis rule set, and the analysis rule set comprises analysis rules for analyzing data corresponding to equipment of different network protocols; and analyzing the data generated by the acquired equipment corresponding to the first equipment description information according to at least one analysis rule to obtain the acquired data of the acquired equipment.
In a possible embodiment, the obtaining module 701 is specifically configured to:
acquiring an IP address of a device to be acquired; acquiring first device description information of the acquired device; the first device description information comprises the manufacturer and the IP address of the collected device;
the processing module 702 is specifically configured to:
establishing communication connection with the collected equipment according to the IP address; and generating a data acquisition task according to the first device description information.
In a possible embodiment, the data collection task further includes a first collection item, and the processing module 702 is specifically configured to:
determining a first analysis rule subset matched with the first equipment description information in the analysis rule set;
determining a first analysis rule required for analyzing the data corresponding to the first acquisition item in the first analysis rule subset;
if the first analysis rule is associated with the second acquisition item, determining a second analysis rule required for analyzing the data corresponding to the second acquisition item; wherein the at least one parsing rule associated with the first device description information comprises a first parsing rule and a second parsing rule.
In a possible embodiment, the processing module 702 is specifically configured to:
if the data acquisition task does not comprise the external acquisition item parameter value corresponding to the first acquisition item, analyzing the data corresponding to the second acquisition item according to a second analysis rule to obtain a data acquisition result of the second acquisition item; analyzing the data corresponding to the first acquisition item according to the data acquisition result and a first analysis rule to obtain the acquisition data of the acquired equipment; alternatively, the first and second electrodes may be,
and if the data acquisition task further comprises an external acquisition item parameter value corresponding to the first acquisition item, analyzing the data corresponding to the first acquisition item according to the external acquisition item parameter value and a first analysis rule to obtain the acquisition data of the acquired equipment.
In a possible embodiment, the processing module 702 is specifically configured to:
if the task identifier of the data acquisition task is the same as the task identifier of the cached historical data acquisition task, determining an analysis rule associated with the historical data acquisition task as an analysis rule associated with the first equipment description information; the task identification of the data acquisition task is obtained by calculating the first device description information and/or the acquisition items in the data acquisition task.
In a possible embodiment, the obtaining module 701 is specifically configured to:
acquiring initial data generated by acquired equipment corresponding to each acquisition item in a data acquisition task;
the processing module 702 is specifically configured to:
analyzing each initial data to obtain analyzed data corresponding to each acquisition item;
and according to the combination mode, combining the analyzed data to obtain the acquired data of the acquired equipment.
In a possible embodiment, the processing module 702 is further configured to:
if the configuration information meeting the preset format is determined, analyzing the configuration information to obtain an analysis rule to be added;
and if the analysis rule set does not have the same analysis rule to be added, writing the analysis rule to be added into the analysis rule set.
In one possible embodiment, each parsing rule in the parsing rule set is associated with a processing unit, and each processing unit is used for implementing a parsing rule.
In a possible embodiment, each processing unit includes an executor and a parser, the executor is used for acquiring data generated by the acquired device corresponding to a parsing rule, and the parser is used for parsing the data acquired by the corresponding executor.
In one possible embodiment, the data collection task further includes one or more of collection items, combinations among collection items, or filtering rules for filtering the collection data.
Based on the same inventive concept, the present application provides a data acquisition apparatus, which is equivalent to the data acquisition apparatus 102 discussed above, please refer to fig. 8, and the apparatus includes:
at least one processor 801, and a memory 802 coupled to the at least one processor 801. In the embodiment of the present application, a specific connection medium between the processor 801 and the memory 802 is not limited, and fig. 8 illustrates an example in which the processor 801 and the memory 802 are connected by a bus 800. The bus 800 is shown in fig. 8 by a thick line, and the connection between other components is merely illustrative and not intended to be limiting. The bus 800 may be divided into an address bus, a data bus, a control bus, etc., and is shown in fig. 8 with only one thick line for ease of illustration, but does not represent only one bus or type of bus. Alternatively, the processor 801 may also be referred to as a controller, without limitation to name a few.
In the embodiment of the present application, the memory 802 stores instructions executable by the at least one processor 801, and the at least one processor 801 may execute the data acquisition method discussed above by executing the instructions stored in the memory 802. The processor 801 may implement the functions of the various modules in the apparatus shown in fig. 7.
The processor 801 is a control center of the apparatus, and may connect various parts of the entire apparatus by using various interfaces and lines, and perform various functions of the apparatus and process data by operating or executing instructions stored in the memory 802 and calling up data stored in the memory 802, thereby performing overall monitoring of the apparatus.
In one possible embodiment, the processor 801 may include one or more processing units, and the processor 801 may integrate an application processor, which mainly handles operating systems, current user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 801. In some embodiments, the processor 801 and the memory 802 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 801 may be a general-purpose processor, such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like, that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the data acquisition method disclosed in the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
Memory 802, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 802 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charged Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 802 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 802 in the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
The processor 801 is programmed to solidify the code corresponding to the data acquisition method described in the foregoing embodiment into the chip, so that the chip can execute the steps of the data acquisition method of the embodiment shown in fig. 2 when running. How to program the processor 801 is well known to those skilled in the art and will not be described in detail herein.
Based on the same inventive concept, the present application also provides a storage medium storing computer instructions, which when executed on a computer, cause the computer to perform the method for data acquisition discussed above.
In some possible embodiments, the various aspects of the method of data acquisition provided by the present application may also be implemented in the form of a program product comprising program code for causing an apparatus to perform the steps of the method of data acquisition according to various exemplary embodiments of the present application described above in this specification when the program product is run on the apparatus.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (13)

1. A method of data acquisition, comprising:
acquiring a data acquisition task; the data acquisition task comprises first equipment description information used for determining acquired equipment;
determining at least one parsing rule associated with the data collection task; the at least one analysis rule belongs to an analysis rule set, and the analysis rule set comprises analysis rules for analyzing data of different network protocols;
and analyzing the data generated by the acquired equipment according to the at least one analysis rule to obtain the acquired data of the acquired equipment.
2. The method of claim 1, wherein obtaining a data collection task comprises:
acquiring an IP address of a device to be acquired;
establishing communication connection with the collected equipment according to the IP address;
acquiring first device description information of the acquired device; wherein the first device description information includes the manufacturer of the acquired device and the IP address;
and generating a data acquisition task according to the first equipment description information.
3. The method of claim 1, wherein the data collection task further comprises a first collection item, and wherein determining at least one parsing rule associated with the data collection task comprises:
determining a first analysis rule subset matched with the first equipment description information in an analysis rule set;
determining a first analysis rule required for analyzing the data corresponding to the first acquisition item in the first analysis rule subset;
if the first analysis rule is determined to be associated with a second acquisition item, determining a second analysis rule required for analyzing data corresponding to the second acquisition item; wherein the at least one parsing rule associated with the first device description information comprises the first parsing rule and the second parsing rule.
4. The method of claim 3, wherein parsing the data generated by the device to obtain the collected data of the device to be collected according to the at least one parsing rule comprises:
if the data acquisition task does not comprise the external acquisition item parameter value corresponding to the first acquisition item, analyzing the data corresponding to the second acquisition item according to the second analysis rule to obtain the data acquisition result of the second acquisition item; analyzing the data corresponding to the first acquisition item according to the data acquisition result and the first analysis rule to obtain the acquisition data of the acquired equipment; alternatively, the first and second electrodes may be,
if the data acquisition task further comprises an external acquisition item parameter value corresponding to the first acquisition item, analyzing data corresponding to the first acquisition item according to the external acquisition item parameter value and the first analysis rule to obtain the acquired data of the acquired equipment.
5. The method of claim 1, wherein determining at least one parsing rule associated with the data collection task comprises:
if the task identifier of the data acquisition task is the same as the task identifier of the cached historical data acquisition task, determining an analysis rule associated with the historical data acquisition task as an analysis rule associated with the first equipment description information; wherein the task identifier of the data collection task is obtained by calculating the first device description information and/or collection items in the data collection task.
6. The method according to claim 1, wherein the at least one parsing rule includes a combination manner between the collection items corresponding to the parsing rules, and the analyzing the data generated by the collected device according to the at least one parsing rule to obtain the collected data of the collected device includes:
acquiring initial data generated by the acquired equipment corresponding to each acquisition item in the data acquisition task;
analyzing each initial data to obtain analyzed data corresponding to each acquisition item;
and according to the combination mode, combining the analyzed data to obtain the acquired data of the acquired equipment.
7. The method according to any one of claims 1-6, further comprising:
if the configuration information meeting the preset format is determined, analyzing the configuration information to obtain an analysis rule to be added;
and if the analysis rule set does not have the analysis rule with the same analysis rule to be added, writing the analysis rule to be added into the analysis rule set.
8. The method according to any of claims 1-6, wherein each parsing rule in the set of parsing rules is associated with a processing unit, each processing unit being configured to implement a parsing rule.
9. The method of claim 8, wherein each processing unit comprises an executor and a parser, the executor is used for acquiring data generated by the acquired device corresponding to a parsing rule, and the parser is used for parsing the data acquired by the corresponding executor.
10. The method of any one of claims 1-6, wherein the data collection task further comprises one or more of collection items, combinations of collection items, or filtering rules for filtering the collected data.
11. An apparatus for data acquisition, comprising:
an acquisition module: for obtaining a data acquisition task; the data acquisition task comprises first equipment description information used for determining acquired equipment;
a processing module: for determining at least one parsing rule associated with the data collection task; the at least one analysis rule belongs to an analysis rule set, and the analysis rule set comprises analysis rules for analyzing data corresponding to equipment of different network protocols; and analyzing the data generated by the acquired equipment corresponding to the first equipment description information according to the at least one analysis rule to obtain the acquired data of the acquired equipment.
12. An apparatus for data acquisition, comprising:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory and executing the method according to any one of claims 1 to 10 according to the obtained program instructions.
13. A storage medium having stored thereon computer-executable instructions for causing a computer to perform the method of any one of claims 1 to 10.
CN201911301521.XA 2019-12-17 2019-12-17 Data acquisition method, device and storage medium Active CN110912782B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911301521.XA CN110912782B (en) 2019-12-17 2019-12-17 Data acquisition method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911301521.XA CN110912782B (en) 2019-12-17 2019-12-17 Data acquisition method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110912782A true CN110912782A (en) 2020-03-24
CN110912782B CN110912782B (en) 2022-08-16

Family

ID=69826004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911301521.XA Active CN110912782B (en) 2019-12-17 2019-12-17 Data acquisition method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110912782B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767276A (en) * 2020-06-29 2020-10-13 北京百度网讯科技有限公司 Data storage method and device, electronic equipment and storage medium
CN112131283A (en) * 2020-09-30 2020-12-25 重庆市海普软件产业有限公司 Intelligent acquisition system capable of being flexibly expanded
CN112491909A (en) * 2020-12-01 2021-03-12 北京鸿腾智能科技有限公司 Flow identification method, device, equipment and storage medium based on DOH protocol
CN113515543A (en) * 2021-03-23 2021-10-19 广东便捷神科技股份有限公司 Automatic goods picking method and system for unmanned vending machine
CN114900387A (en) * 2022-05-10 2022-08-12 中移(杭州)信息技术有限公司 Cross-platform fusion access method, system, gateway and storage medium of equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7827132B2 (en) * 2006-09-14 2010-11-02 International Business Machines Corporation Peer based event conversion
CN103840955A (en) * 2012-11-22 2014-06-04 中国银联股份有限公司 Operation maintenance system of distributed IT system, and operation maintenance management method thereof
US20170293292A1 (en) * 2016-04-08 2017-10-12 Electronics And Telecommunications Research Institute Rule based real-time data stream-processing method and apparatus thereof
CN107643932A (en) * 2017-08-31 2018-01-30 深圳天珑无线科技有限公司 A kind of collecting method, harvester and storage device
CN108520043A (en) * 2018-03-30 2018-09-11 纳思达股份有限公司 Data object acquisition method, apparatus and system, computer readable storage medium
CN109450922A (en) * 2018-11-29 2019-03-08 厦门科灿信息技术有限公司 A kind of communication data analytic method, device and relevant device
CN109768623A (en) * 2019-02-02 2019-05-17 鼎信信息科技有限责任公司 Monitoring method, device, computer equipment and the storage medium of electric system
CN109766206A (en) * 2018-12-29 2019-05-17 北京中电普华信息技术有限公司 A kind of log collection method and system
CN110309113A (en) * 2018-03-06 2019-10-08 阿里巴巴集团控股有限公司 Log analytic method, system and equipment
CN110417734A (en) * 2019-06-24 2019-11-05 广州迈峰网络科技有限公司 Remote device data acquisition method, device and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7827132B2 (en) * 2006-09-14 2010-11-02 International Business Machines Corporation Peer based event conversion
CN103840955A (en) * 2012-11-22 2014-06-04 中国银联股份有限公司 Operation maintenance system of distributed IT system, and operation maintenance management method thereof
US20170293292A1 (en) * 2016-04-08 2017-10-12 Electronics And Telecommunications Research Institute Rule based real-time data stream-processing method and apparatus thereof
CN107643932A (en) * 2017-08-31 2018-01-30 深圳天珑无线科技有限公司 A kind of collecting method, harvester and storage device
CN110309113A (en) * 2018-03-06 2019-10-08 阿里巴巴集团控股有限公司 Log analytic method, system and equipment
CN108520043A (en) * 2018-03-30 2018-09-11 纳思达股份有限公司 Data object acquisition method, apparatus and system, computer readable storage medium
CN109450922A (en) * 2018-11-29 2019-03-08 厦门科灿信息技术有限公司 A kind of communication data analytic method, device and relevant device
CN109766206A (en) * 2018-12-29 2019-05-17 北京中电普华信息技术有限公司 A kind of log collection method and system
CN109768623A (en) * 2019-02-02 2019-05-17 鼎信信息科技有限责任公司 Monitoring method, device, computer equipment and the storage medium of electric system
CN110417734A (en) * 2019-06-24 2019-11-05 广州迈峰网络科技有限公司 Remote device data acquisition method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何玉红: "浅析信息系统中设备数据采集方法", 《有色设备》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767276A (en) * 2020-06-29 2020-10-13 北京百度网讯科技有限公司 Data storage method and device, electronic equipment and storage medium
CN111767276B (en) * 2020-06-29 2024-03-15 北京百度网讯科技有限公司 Data storage method, device, electronic equipment and storage medium
CN112131283A (en) * 2020-09-30 2020-12-25 重庆市海普软件产业有限公司 Intelligent acquisition system capable of being flexibly expanded
CN112491909A (en) * 2020-12-01 2021-03-12 北京鸿腾智能科技有限公司 Flow identification method, device, equipment and storage medium based on DOH protocol
CN112491909B (en) * 2020-12-01 2023-09-01 三六零数字安全科技集团有限公司 DOH protocol-based traffic identification method, device, equipment and storage medium
CN113515543A (en) * 2021-03-23 2021-10-19 广东便捷神科技股份有限公司 Automatic goods picking method and system for unmanned vending machine
CN113515543B (en) * 2021-03-23 2024-02-13 广东便捷神科技股份有限公司 Automatic goods picking method and system for vending machine
CN114900387A (en) * 2022-05-10 2022-08-12 中移(杭州)信息技术有限公司 Cross-platform fusion access method, system, gateway and storage medium of equipment

Also Published As

Publication number Publication date
CN110912782B (en) 2022-08-16

Similar Documents

Publication Publication Date Title
CN110912782B (en) Data acquisition method, device and storage medium
CN110933146B (en) Data conversion method and device and server
CN109194617B (en) Automatic parsing and packaging method and device for XML (extensive markup language) message
CN108696381B (en) Protocol configuration method and device
US7483959B2 (en) Method and system for extensible data gathering
EP3172866B1 (en) System and method for metadata enhanced inventory management of a communications system
Bockermann et al. The streams framework
US20040210877A1 (en) Method of providing open access to application profiling data
US7650346B2 (en) User-defined type consistency checker
CN112436964B (en) Equipment adaptation method and network management device
Chen et al. Introduction to OPNET network simulation
CN111984505B (en) Fortune dimension data acquisition device and acquisition method
CN109446648A (en) Service of simulation method for building up and device
CN114095535B (en) Method for automatically mapping time sequence variable of physical equipment into digital model
CN114025027A (en) Data transmission script running method and device, storage medium and electronic device
CN111488144A (en) Data processing method and equipment
KR100974621B1 (en) Radio frequency identification business-aware framework
CN112311679B (en) State detection method, state detection device, electronic equipment and readable storage medium
CN116743886A (en) Industrial control equipment data acquisition system based on Internet of things
CN115878213A (en) Dynamic loading method for Internet of things equipment driver
CN112688884B (en) Encrypted flow custom application identification method, system, device and storage medium
CN111914299B (en) Method, device and equipment for optimizing predictive machine interface and storage medium
JP2770758B2 (en) OSI management agent system
CN117155779A (en) Binding method, storage medium, monitoring terminal and Internet of things system
CN115941797A (en) Service calling relation determining method and device and electronic equipment

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