CN115237399A - Method for collecting data, storage medium, processor and engineering vehicle - Google Patents

Method for collecting data, storage medium, processor and engineering vehicle Download PDF

Info

Publication number
CN115237399A
CN115237399A CN202210827904.6A CN202210827904A CN115237399A CN 115237399 A CN115237399 A CN 115237399A CN 202210827904 A CN202210827904 A CN 202210827904A CN 115237399 A CN115237399 A CN 115237399A
Authority
CN
China
Prior art keywords
data
terminal
nifi
template file
preset
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.)
Pending
Application number
CN202210827904.6A
Other languages
Chinese (zh)
Inventor
路培杰
刘文虎
张超
王鑫鹏
金飞亮
谭新亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongke Yungu Technology Co Ltd
Original Assignee
Zhongke Yungu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongke Yungu Technology Co Ltd filed Critical Zhongke Yungu Technology Co Ltd
Priority to CN202210827904.6A priority Critical patent/CN115237399A/en
Publication of CN115237399A publication Critical patent/CN115237399A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a method, a storage medium, a processor and an engineering vehicle for collecting data, wherein the method is applied to a first terminal provided with a nifi application program, and comprises the following steps: acquiring a first operation instruction aiming at a first icon triggered by a user through an operation interface of the nifi application program, wherein the first icon is a display icon of a preset nifi component in the nifi application program; acquiring configuration parameters aiming at each preset nifi component, which are input by a user, according to a first operation instruction; generating a first template file corresponding to the target device according to the configuration parameters of each preset nifi component; and sending the first template file to a second terminal corresponding to the target equipment so as to perform corresponding data acquisition operation according to the first template file through the second terminal. Through the technical scheme, a large number of components do not need to be repeatedly developed, the time period of data acquisition is shortened, and the efficiency of data acquisition is greatly improved.

Description

Method for collecting data, storage medium, processor and engineering vehicle
Technical Field
The application relates to the technical field of computers, in particular to a method, a storage medium, a processor and an engineering vehicle for collecting data.
Background
Along with the improvement of the intelligent degree of the industrial Internet of things equipment, the industrial Internet of things equipment can generate a large amount of real-time data. Currently, the generated real-time data is usually sent to a cloud terminal through a wireless network, and the cloud terminal analyzes and stores the real-time data and displays and analyzes the real-time data. However, due to the diversity of industrial internet of things equipment, the adopted data bus transmission protocols are different, even private protocols are adopted for encryption transmission, so that data multiple isomerism is caused, and the data volume is expanded rapidly.
For data encrypted and transmitted by a private protocol, a traditional data acquisition method generally acquires data of industrial internet of things equipment by writing an application code, the industrial internet of things data needs to be acquired through an equipment sensor and then collected to an edge terminal through a PLC (programmable logic controller) bus of the equipment, and the edge terminal transmits the encrypted and converted data to a cloud end through a wireless network. However, the acquisition process needs customized embedded development at the edge and the cloud according to the type of the industrial internet of things equipment, the development cost is high, and the development period is long. And according to different types of industrial Internet of things equipment, codes adopted by the equipment need to be developed again, so that the development workload is increased, and the acquisition efficiency of equipment data is greatly reduced.
Disclosure of Invention
The embodiment of the application aims to provide a method, a storage medium, a processor and an engineering vehicle for collecting data.
In order to achieve the above object, a first aspect of the present application provides a method for collecting data, the method being applied to a first terminal installed with a nifi application program, the method comprising:
acquiring a first operation instruction aiming at a first icon triggered by a user through an operation interface of the nifi application program, wherein the first icon is a display icon of a preset nifi component in the nifi application program, and the preset nifi component is determined from a plurality of nifi components according to a specific protocol type of target equipment;
acquiring configuration parameters, which are input by a user and aim at each preset nifi component, according to a first operation instruction, wherein the configuration parameters are determined according to a specific protocol type adopted by target equipment and a data type which can be acquired by the target equipment;
generating a first template file corresponding to the target device according to the configuration parameters of each preset nifi component;
and sending the first template file to a second terminal corresponding to the target equipment so as to perform corresponding data acquisition operation according to the first template file through the second terminal.
A second aspect of the present application provides a processor configured to execute the above method for collecting data, the method being applied to a first terminal installed with a nifi application.
A third aspect of the application provides a machine-readable storage medium having stored thereon instructions, which, when executed by a processor, cause the processor to be configured to execute the above-mentioned method for collecting data, the method being applied to a first terminal installed with a nifi application.
A fourth aspect of the present application provides a method for acquiring data, where the method is applied to a second terminal corresponding to a target device, and the method includes: receiving a first template file sent by a first terminal, wherein the first template file is generated after a user carries out corresponding parameter configuration on a preset nifi component through an operation interface of a nifi application program, and the nifi application program is installed on the first terminal; converting the first template file into a corresponding configuration file with a specific format; and under the condition of receiving a data acquisition instruction sent by the cloud platform, acquiring the equipment data of the target equipment in real time according to the configuration file with the specific format.
A fifth aspect of the present application provides a processor configured to execute the method for acquiring data described above, where the method is applied to a second terminal corresponding to a target device.
A sixth aspect of the present application provides a machine-readable storage medium, which stores instructions that, when executed by a processor, cause the processor to be configured to execute the above-mentioned method for acquiring data, the method being applied to a second terminal corresponding to a target device.
A seventh aspect of the present application provides a method for acquiring data, where the method is applied to a cloud platform, and the method includes: receiving plaintext data of the target equipment, which is sent by a second terminal of the target equipment, wherein the plaintext data is determined after analyzing ciphertext data through an analyzer corresponding to a specific protocol type adopted by the target equipment, and the ciphertext data is acquired by the second terminal in real time according to a configuration file with a specific format; temporarily storing the plaintext data to a specified theme of kafka through a message queue, wherein the specified theme is a theme corresponding to a specific protocol type of the target equipment; receiving a second template file sent by the first terminal, wherein the second template file is generated after a user carries out corresponding parameter configuration on a preset data processing component through an operation interface of a nifi application program of the first terminal; preprocessing the plaintext data according to the second template file to obtain structured plaintext data; and storing the structured plaintext data to a database.
An eighth aspect of the present application provides a processor configured to execute the method for acquiring data, where the method is applied to a cloud platform.
A ninth aspect of the present application provides a machine-readable storage medium, having stored thereon instructions, which when executed by a processor, cause the processor to be configured to execute the above method for collecting data, the method being applied to a cloud platform.
A tenth aspect of the present application provides a method for collecting data, the method comprising: the method comprises the steps that a first terminal obtains a first operation instruction aiming at a first icon triggered by a user through an operation interface of a nifi application program, the first icon is a display icon of a preset nifi component in the nifi application program, and the preset nifi component is determined from a plurality of nifi components according to a specific protocol type of target equipment; the first terminal obtains configuration parameters, which are input by a user and aim at each preset nifi component, according to the first operation instruction, wherein the configuration parameters are determined according to a specific protocol type adopted by the target equipment and a data type which can be acquired by the target equipment; the method comprises the steps that a first terminal generates a first template file corresponding to target equipment according to configuration parameters of each preset nifi component, and sends the first template file to a second terminal corresponding to the target equipment; the second terminal receives the first template file and converts the first template file into a corresponding configuration file with a specific format; the cloud platform sends a data acquisition instruction to the second terminal; under the condition that the second terminal receives a data acquisition instruction, the second terminal acquires equipment data of target equipment in real time according to a configuration file with a specific format; and the second terminal sends the equipment data to the cloud platform.
An eleventh aspect of the present application provides a processor configured to perform the above-described method for acquiring data.
A twelfth aspect of the application provides a machine-readable storage medium having instructions stored thereon, which when executed by a processor, cause the processor to be configured to perform the method for acquiring data described above.
A thirteenth aspect of the present application provides an engineering vehicle, including: a second terminal; and the processor is configured to execute the method for acquiring data, and the method is applied to a second terminal corresponding to the target device.
A fourteenth aspect of the present application provides a system for collecting data, the system comprising: a first apparatus comprising the processor described above, the processor being configured to perform the method described above for acquiring data; a second apparatus comprising the processor described above, the processor configured to perform the method described above for acquiring data; and a cloud device comprising the processor configured to perform the method for collecting data.
Through the technical scheme, different parameter configurations can be carried out on the preset nifi component on the visual interface, so that the template file corresponding to the preset nifi component is generated. When the target device adopts different protocol types, the data acquisition of different target devices can be realized by configuring different parameters for the preset nifi component, the labor cost and the time cost required by development are reduced conveniently and rapidly, a large number of components are not required to be developed repeatedly, the time period of the data acquisition is further shortened, and the efficiency of the data acquisition is also greatly improved.
Additional features and advantages of embodiments of the present application will be described in detail in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the embodiments of the disclosure, but are not intended to limit the embodiments of the disclosure. In the drawings:
fig. 1 schematically shows an application environment diagram of a method for acquiring data according to an embodiment of the application;
FIG. 2 schematically illustrates a first flowchart of a method for acquiring data according to an embodiment of the present application;
FIG. 3 schematically illustrates a schematic diagram of a first component parameter configuration of a method for acquiring data according to an embodiment of the present application;
FIG. 4 schematically illustrates a schematic diagram of a second component parameter configuration of a method for acquiring data according to an embodiment of the present application;
FIG. 5 schematically illustrates a schematic diagram of a third component parameter configuration of a method for collecting data according to an embodiment of the present application;
FIG. 6 schematically illustrates a schematic diagram of a fourth component parameter configuration of a method for collecting data according to an embodiment of the present application;
FIG. 7 schematically illustrates a second flowchart of a method for acquiring data according to an embodiment of the present application;
FIG. 8 schematically illustrates a third schematic flow chart of a method for acquiring data according to an embodiment of the present application;
FIG. 9 schematically illustrates a fifth component parameter configuration of a method for acquiring data in accordance with an embodiment of the present application;
FIG. 10 schematically illustrates a fourth flowchart of a method for acquiring data according to an embodiment of the present application;
FIG. 11 schematically illustrates a block diagram of a system for acquiring data according to an embodiment of the present application;
fig. 12 schematically shows an internal structural diagram of a computer apparatus according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the specific embodiments described herein are only used for illustrating and explaining the embodiments of the present application and are not used for limiting the embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The method for collecting data provided by the application can be applied to the application environment shown in fig. 1. The first terminal 101 communicates with the second terminal 102 and the cloud platform 103 through a network. The second terminal 102 communicates with the first terminal 101 and the cloud platform 103 through a network. The cloud platform 103 communicates with the first terminal 101 and the second terminal 102 through a network. The first terminal 101 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The first terminal 101 may have a nifi application installed. The second terminal 102 may refer to a second terminal corresponding to a target device. The second terminal 102 may have a mini application installed. Wherein the target device may be an engineering vehicle. If the target device is an engineering vehicle, the second terminal 102 may be a device installed on the engineering vehicle, and the device has a display screen and may be used to display data acquisition time and the like.
Fig. 2 schematically shows a flow diagram of a method for acquiring data according to an embodiment of the present application. As shown in fig. 2, in an embodiment of the present application, a method for collecting data is provided, which is mainly illustrated by applying the method to the first terminal 101 in fig. 1, where the first terminal 101 is installed with a nifi application, and the method is applied to the first terminal 101 installed with the nifi application, and the method includes the following steps:
step 201, a first operation instruction aiming at a first icon triggered by a user through an operation interface of the nifi application program is obtained, the first icon is a display icon of a preset nifi component in the nifi application program, and the preset nifi component is determined from a plurality of nifi components according to a specific protocol type of a target device.
Step 202, obtaining configuration parameters, which are input by a user and are specific to each preset nifi component, according to the first operation instruction, wherein the configuration parameters are determined according to a specific protocol type adopted by the target device and a data type which can be acquired by the target device.
Step 203, generating a first template file corresponding to the target device according to the configuration parameters of each preset nifi component.
And 204, sending the first template file to a second terminal corresponding to the target equipment so as to perform corresponding data acquisition operation according to the first template file through the second terminal.
Before data collection, a nifi application program can be installed on a first terminal, and a minifi application program can be installed on a second terminal of the target device. Wherein the nifi application may comprise an operation interface. The operation interface may include a plurality of display icons. The target device may refer to a device that needs data acquisition. For example, the target device may refer to a work vehicle. When the nifi application program is installed, normal data transmission between the first terminal and the second terminal can be ensured by modifying the configuration information of nifi.
Under the condition that the first terminal and the second terminal finish the installation of the corresponding application programs, the processor can acquire a first operation instruction which is triggered by a user through an operation interface of the nifi application program and aims at the first icon. Wherein the operation interface may refer to a web interface of the nifi application. The operation interface may include a plurality of first icons. The first icon may be a display icon of a preset nifi component in the nifi application. The preset nifi component may be determined from a plurality of nifi components according to a specific protocol type of the target device. The nifi component may refer to a component of data collection. For example, nifi components may include TailFile, extractText, edgeDataProcessExecuteStreamCommand, postHttp, and the like.
After the first operation instruction, triggered by the user, for the first icon is acquired, the processor may acquire, according to the first operation instruction, the configuration parameter, input by the user, for each preset nifi component. The configuration parameters may be determined according to a specific protocol type adopted by the target device and a data type that can be collected by the target device. The specific protocol type may refer to a private protocol, i.e., a private protocol. The data types collected by the target equipment can comprise working condition data, running track data, communication log data and the like of the target equipment.
The processor may generate a first template file corresponding to the target device according to the configuration parameters of each preset nifi component. Wherein, the first template file may refer to a template file in xml format. Under the condition of generating the first template file, the processor may send the first template file to a second terminal corresponding to the target device through a downlink remote upgrade channel, so as to perform a corresponding data acquisition operation according to the first template file through the second terminal.
In one embodiment, as shown in FIG. 3, a schematic diagram of a component parameter configuration is provided. Wherein, tailFile, extractText, edgeDataProcesses, executeStreamCommand and PostHttp are display icons of preset nifi components in the nifi application program.
The configuration parameters input by the user for the TailFile component may include the position, name, whether incremental acquisition is performed or not, and the like of the data file, and the configured TailFile component may be used for monitoring the change condition of the device data in real time and acquiring the device data in real time. The configuration parameters of the user for the ExtractText component may include a regular expression for data verification, and the configured ExtractText component may be used for verifying and evaluating the collected device data. The configuration parameters of the user for the EdgeDataProcess component may include an analysis protocol type and a bus protocol type adopted by the target device, and the configured EdgeDataProcess component may be used to analyze the acquired device data of the target device. The configuration parameters of the user for the executestatreamcommand component may include a shell script or the like that performs data processing. The configuration parameters of the user for the PostHttp component can include the address, the protocol type and the like of the cloud platform, and the PostHttp component which is configured can be used for sending the acquired data to the cloud platform. The processor can obtain configuration parameters, input by a user, for each preset nifi component according to the first operation instruction, and generate a first template file corresponding to the target device according to the configuration parameters of each preset nifi component, so as to send the first template file to the corresponding second terminal.
It should be noted that the preset nifi component can be custom-developed according to the nifi specification, and each developed component can be reused without redeveloping different components according to different types of target device protocols. Namely, the data acquisition can be realized according to the template file by configuring the configuration parameters of each developed component and generating the corresponding template file after the configuration is completed. And when the user performs parameter configuration on each preset nifi component, the configuration sequence of the nifi component is not limited, but before the configuration is completed and the template file is generated, the user can customize the flow direction of the data, so that the data processing operation and the data storage operation are completed according to the flow direction of the data after the template file is generated.
Through the technical scheme, different parameter configurations can be carried out on the preset nifi component on the visual interface, so that the template file corresponding to the preset nifi component is generated. When the target equipment adopts different protocol types, the data acquisition of different target equipment can be realized by configuring different parameters for the preset nifi component, the convenience and the rapidness are realized, meanwhile, the labor cost and the time cost required by development are greatly reduced, a large number of components are not required to be repeatedly developed, the time period of the data acquisition is further shortened, and the efficiency of the data acquisition is also greatly improved.
In one embodiment, the method further comprises: receiving a data processing request initiated by a user, wherein the data processing request is initiated after the user performs corresponding data acquisition operation at a second terminal according to a first template file to obtain device data of a target device; loading a second icon to the operation interface according to the data processing request, wherein the second icon is a display icon of a preset data processing component in the nifi application program; acquiring a second operation instruction aiming at a second icon, which is triggered by a user through an operation interface; acquiring configuration parameters, which are input by a user and aim at each preset data processing component, according to a second operation instruction, wherein the configuration parameters are determined according to a specific protocol type adopted by target equipment and a queue code of data to be processed; generating a second template file corresponding to the target equipment according to the configuration parameters of each preset data processing assembly; and sending the second template file to the cloud platform so as to perform corresponding data processing operation and data storage operation on the data acquired by the second terminal according to the second template file through the cloud platform.
Under the condition that the second terminal performs corresponding data acquisition operation according to the first template file to acquire the device data of the target device, the processor can receive a data processing request initiated by a user and can load the second icon to the operation interface according to the data processing request. Wherein the operation interface may refer to a web interface of the nifi application. The operation interface may include a plurality of display icons. For example, the display icon may be a second icon. The second icon may be a display icon of a preset data processing component in the nifi application. The preset data processing component may refer to a component capable of data processing and data storage. The preset data processing component may be determined from a plurality of data processing components according to the type of data collected. For example, the preset data processing component may be Consumer Kafka _2.0, dataProcessor, convertJsonToAvro, queryRecord, puthbaseJson, appendeCapeProcessor, etc.
The processor can acquire a second operation instruction, triggered by the user through the operation interface, for the second icon, and can acquire the configuration parameters, input by the user, for each preset data processing component according to the second operation instruction. The configuration parameters may be determined according to the specific protocol type adopted by the target device and the queue code of the data to be processed. Because the cloud platform stores the device data to the corresponding specified theme of kafka through the specific protocol type of the target device, when the device data is processed, a user can firstly perform parameter configuration on each preset data processing component. Specifically, the user may input a specific protocol type of the target device corresponding to the device data to determine the specified subject of kafka corresponding to the device data of the target device. The user may then also enter a queue code for the device data, i.e., the consumption address of the device data in the specified topic of kafka.
In a case where the user inputs the configuration parameters for each preset data processing component, the processor may acquire the configuration parameters according to the second operation instruction. The processor may generate a second template file corresponding to the target device according to the configuration parameters of each preset data processing component. The second template file may refer to a configuration file in a yml format, i.e., a minifi configuration file. Under the condition of generating the second template file, the processor may send the second template file to the cloud platform so as to perform corresponding data processing operation and data storage operation on the data acquired by the second terminal according to the second template file through the cloud platform.
In one embodiment, as shown in FIG. 4, a schematic diagram of a component parameter configuration is provided. Wherein, consumer Kafka _2.0, dataProcessor, convertetJsonToAvro, queryRecord, convertevrotoJson and PuthbaseJson are preset data processing components adopted when the data type is the working condition data. In a case that the data processing group is loaded to the operation interface of the nifi application program according to the data processing request, the processor may obtain a second operation instruction and obtain, according to the second operation instruction, the configuration parameter for each preset data processing component, which is input by the user.
Specifically, the configuration parameters input by the user for the ConsumerKafka _2.0 component may include topic, consumption address, consumption policy, and the like of Kafka, and the ConsumerKafka _2.0 component that is configured may obtain data that needs to be processed from Kafka. That is, the Consumer Kafka _2.0 component can be used to access data sources in Kafka. The configuration parameters which can be input by the user aiming at the DataProcessor component comprise metadata of data processing, batch size and the like, and the configured DataProcessor component can be used for cleaning and converting the data. The configuration parameters entered by the user for the ConvertetJsonToAvro component may include metadata of the data structure, and the configured ConvertetJsonToAvro component may be used to convert the Json formatted data into Avro formatted data. The parameters of the configuration input by the user for the query record component can include SQL statements, and the configured query record component can be used for screening data. The user may configure the convertatavrotojson component, and the configured convertatrotojson component may be used to convert data in the Avro format into data in the Json format. The parameters entered by the user for the PutHbaseJson component may include the address of the zookeeper cluster and the name of the table in hbase, and the configured PutHbaseJson component may be used to store data to the hbase database.
The processor can obtain the configuration parameters of the data processing assembly according to the second operation instruction, and generate a second template file corresponding to the target device according to the configuration parameters of the data processing assembly so as to send the second template file to the cloud platform. It should be noted that, when a user performs parameter configuration on each preset data processing component, the configuration order of the preset data processing component may not be limited, but before the configuration is completed and the template file is generated, the user may customize the flow direction of the data, so that after the template file is generated, the data processing operation and the data storage operation are completed according to the flow direction of the data.
In one embodiment, as shown in FIG. 5, a schematic diagram of a component parameter configuration is provided. Wherein, consumer Kafka _2.0, appendix EscapeProcessor, mergeContent, updateAttribute and PutHdfs are preset data processing components adopted when the data type is track data. In a case that the data processing group is loaded to the operation interface of the nifi application program according to the data processing request, the processor may obtain a second operation instruction and obtain, according to the second operation instruction, the configuration parameter for each preset data processing component, which is input by the user.
Specifically, the configuration parameters input by the user for the ConsumerKafka _2.0 component may include topic of Kafka, brokers of Kafka, a consumption address, a consumption policy, and the like, and the configured ConsumerKafka _2.0 component may obtain data that needs to be processed from Kafka. That is, the Consumer Kafka _2.0 component can be used to access data sources in Kafka. The user may not enter configuration parameters for the appendix EscapAppleprocessor component, which may be used to add linefeed operations to the data. The configuration parameters input by the user for the MergeContent component may include Merge Stratage, merge Format, delimiter Stratage, metadata Stratage, and Tar Modified Time, and the configured MergeContent component may be used to Merge data files to avoid generating a large number of small files in hdfs. The configuration parameters input by the user for the updateattrribute component may include automatic generation rules of a fileName, and the like, and the configured updateattrribute component may be used to name different data files, so as to store data into a specified hdfs file, thereby distinguishing data in hdfs. The configuration parameters input by the user for the PutHdfs component may include a path of hdfs, an address of a configuration file related to Hadoop, and the like, and the configured PutHdfs component may be used to store data in an hdfs directory of the hive database.
The processor can obtain the configuration parameters of the data processing assembly according to the second operation instruction, and generate a second template file corresponding to the target device according to the configuration parameters of the data processing assembly so as to send the second template file to the cloud platform. It should be noted that, when a user performs parameter configuration on each preset data processing component, the configuration sequence of the data processing component may not be limited, but before the configuration is completed and the template file is generated, the user may customize the flow direction of the data, so that after the template file is generated, the data processing operation and the data storage operation are completed according to the flow direction of the data.
In one embodiment, as shown in FIG. 6, a schematic diagram of a component parameter configuration is provided. Wherein, consumer Kafka _2.0, ZLRawDataProcessor and PutHbaseJson are preset data processing components adopted when the data type is log data. In a case that the data processing group is loaded to the operation interface of the nifi application program according to the data processing request, the processor may obtain a second operation instruction and obtain, according to the second operation instruction, the configuration parameter for each preset data processing component, which is input by the user.
Specifically, the configuration parameters input by the user for the ConsumerKafka _2.0 component may include topic, consumption address, consumption policy, and the like of Kafka, and the ConsumerKafka _2.0 component whose configuration is completed may obtain data that needs to be processed from Kafka. That is, the Consumer Kafka _2.0 component can be used to access data sources in Kafka. The configuration parameters input by the user for the ZLRawDataProcessor component may include the direction and type of data, and the configured ZLRawDataProcessor component may be used to convert data format, parse data, add data tags, add data fields, and the like. The parameters entered by the user for the PutHbaseJson component may include the address of the zookeeper cluster and the name of the table in hbase, and the configured PutHbaseJson component may be used to store data to the hbase database.
The processor can obtain the configuration parameters of the data processing assembly according to the second operation instruction, and generate a second template file corresponding to the target device according to the configuration parameters of the data processing assembly so as to send the second template file to the cloud platform. It should be noted that, when a user performs parameter configuration on each preset data processing component, the configuration order of the preset data processing component may not be limited, but before the configuration is completed and the template file is generated, the user may customize the flow direction of the data, so that after the template file is generated, the data processing operation and the data storage operation are completed according to the flow direction of the data.
The preset data processing components can be developed in a user-defined mode according to the nifi standard, and each developed component can be reused without being redeveloped according to the protocol type of the target equipment. By the technical scheme, the configuration parameters of each developed component can be configured, the corresponding template file is generated after the configuration is completed, the data can be timely and accurately processed and stored according to the template file, the data processing efficiency is greatly improved, and the follow-up data can be conveniently inquired and analyzed.
In one embodiment, a storage medium is provided, on which a program is stored, which when executed by a processor implements the above-described method for collecting data, the method being applied to a first terminal installed with a nifi application.
In one embodiment, a processor is provided, and the processor is used for running a program, wherein the program runs to execute the method for collecting data, and the method is applied to a first terminal installed with a nifi application program.
Fig. 7 schematically shows a flow diagram of a method for acquiring data according to an embodiment of the application. As shown in fig. 7, in an embodiment of the present application, a method for acquiring data is provided, which is mainly illustrated by applying the method to the second terminal 102 in fig. 1, and the method includes the following steps:
step 701, receiving a first template file sent by a first terminal, where the first template file is generated after a user performs corresponding parameter configuration on a preset nifi component through an operation interface of a nifi application program, and the first terminal is installed with the nifi application program.
Step 702, converting the first template file into a configuration file with a corresponding specific format.
And 703, acquiring the device data of the target device in real time according to the configuration file with the specific format under the condition of receiving the data acquisition instruction sent by the cloud platform.
Before data is collected, a nifi application program can be installed on a first terminal, and a minifi application program can be installed on a second terminal of the target device. The processor may receive a first template file transmitted by a first terminal. Wherein, the first terminal can be installed with the nifi application program. The first template file is generated after a user carries out corresponding parameter configuration on a preset nifi component through an operation interface of the nifi application program. The first template file may refer to a template file in xml format. The operation interface may refer to a web interface of the nifi application. The operation interface may include a plurality of first icons. The first icon may be a display icon of a preset nifi component in the nifi application. The preset nifi component may be determined from a plurality of nifi components according to a specific protocol type of the target device. The nifi component may refer to a component of data collection. For example, nifi components may include TailFile, extractText, edgeDataProcesses, executeStreamCommand, postHttp, and the like.
The processor may convert the first template file into a corresponding configuration file of a particular format. The configuration file of a specific format may refer to a configuration file of a yml format, that is, a configuration file of a minifi. The processor can receive a data acquisition instruction sent by the cloud platform, and then can acquire device data of the target device in real time according to the configuration file with the specific format. The target device may refer to a device that needs data acquisition. For example, the target device may refer to a work vehicle. And if the protocol type adopted by the target equipment is a specific protocol type, namely a private protocol, the equipment data acquired by the processor in real time according to the configuration file with the specific format is ciphertext data.
Through the technical scheme, the template file sent by the first terminal can be converted into the configuration file in the specific format, the device data of the target device can be collected in real time according to the configuration file in the specific format under the condition of receiving the data collection instruction, the time period of data collection is greatly shortened conveniently and quickly, and the data collection efficiency is greatly improved.
In one embodiment, collecting device data of a target device in real time according to a configuration file of a specific format includes: acquiring ciphertext data of target equipment in real time according to the configuration file with the specific format; analyzing the ciphertext data into plaintext data; and sending the plaintext data to a cloud platform for data storage.
The processor can acquire the ciphertext data of the target device in real time according to the configuration file with the specific format. The configuration file of a specific format may refer to a configuration file of a yml format, that is, a configuration file of a minifi. Ciphertext data may refer to data encrypted by a private protocol. That is, the specific protocol type employed by the target device is a private protocol. Under the condition that the ciphertext data of the target device are collected, the processor can analyze the ciphertext data into plaintext data, and can send the plaintext data to the cloud platform for data storage. Where plaintext data may refer to data that has not been encrypted.
In one embodiment, the specific protocol type adopted by the target device is a private protocol, and parsing the ciphertext data into plaintext data includes: loading a corresponding analyzer according to a private protocol to analyze the ciphertext data, wherein the analyzer is generated according to protocol types adopted by different types of target equipment; and the ciphertext data is analyzed into plaintext data in a preset format through an analyzer.
The specific protocol type adopted by the target device may be a private protocol. The parser may be generated according to the type of protocol employed by different types of target devices. Specifically, the cloud platform may obtain a bus transmission protocol and a data analysis protocol of the target device. Then, the cloud platform can generate a class file corresponding to the bus transmission protocol and the data analysis protocol of the target device according to the constructed analysis service, and compile the class file into a corresponding byte code file, namely an analyzer. Under the condition of generating the resolver, the cloud platform can send the resolver to the second terminal of the target device through a downlink remote upgrading channel.
Under the condition that the processor acquires the ciphertext data of the target device in real time according to the configuration file with the specific format, the processor can load a corresponding analyzer according to the private protocol to analyze the ciphertext data. Further, the processor may parse the ciphertext data into plaintext data in a predetermined format through the parser. The plaintext data in the preset format may refer to plaintext data in a format of "start symbol + command code + serial number + terminal ID number + protocol type + terminal type + protocol version + data length + data block + check code + end symbol".
In one embodiment, the second terminal is deployed with a mini application, and converting the first template file into a corresponding configuration file with a specific format includes: calling a file converter in the minifi application program; and converting the first template file into a mini configuration file through a file converter.
And the second terminal is deployed with a mini application program. The processor may convert the first template file into a corresponding configuration file of a particular format. Specifically, the processor may call a file converter in the minifi application, and may convert the first template file into the minifi configuration file through the file converter. Wherein, the first template file may refer to a file in xml format. The file converter may refer to a ToolKit converter in a minifi application. The ToolKit converter may convert the template file in xml format to a file in yml format. The yml format file is the minifi configuration file.
Through the technical scheme, the first template file sent by the first terminal can be converted into the configuration file corresponding to the specific format, the device data of the target device are collected and analyzed through the configuration file of the specific format, the convenience and the rapidness are achieved, meanwhile, the labor cost and the time cost required by development are greatly reduced, a large number of components do not need to be repeatedly developed, the time period of data acquisition is further shortened, and the efficiency of data acquisition is greatly improved.
In one embodiment, there is provided a work vehicle comprising: a second terminal; and the processor is configured to execute the method for acquiring data, and the method is applied to a second terminal corresponding to the target device.
In one embodiment, a storage medium is provided, on which a program is stored, which when executed by a processor implements the above-described method for collecting data, the method being applied to a second terminal corresponding to a target device.
In one embodiment, a processor is provided, and the processor is configured to execute a program, where the program executes the method for acquiring data, and the method is applied to a second terminal corresponding to a target device.
Fig. 8 schematically shows a flow diagram of a method for acquiring data according to an embodiment of the application. As shown in fig. 8, in an embodiment of the present application, a method for acquiring data is provided, and the embodiment is mainly exemplified by applying the method to the cloud platform 103 in fig. 1, where the method includes the following steps:
step 801, receiving plaintext data of the target device sent by a second terminal of the target device, where the plaintext data is determined after parsing ciphertext data through a parser corresponding to a specific protocol type adopted by the target device, and the ciphertext data is collected by the second terminal in real time according to a configuration file in a specific format.
And step 802, temporarily storing the plaintext data to a specified subject of the kafka through a message queue, wherein the specified subject refers to a subject corresponding to the specific protocol type of the target device.
Step 803, receiving a second template file sent by the first terminal, where the second template file is generated after a user performs corresponding parameter configuration on a preset data processing component through an operation interface of an nifi application program of the first terminal.
And step 804, preprocessing the plaintext data according to the second template file to obtain structured plaintext data.
Step 805, storing the structured plaintext data in a database.
After the second terminal collects ciphertext data in real time according to the configuration file with the specific format, the second terminal can load an analyzer corresponding to the specific protocol type adopted by the target device, and analyze the collected ciphertext data into plaintext data through the analyzer. Under the condition that the second terminal determines the plaintext data of the target device, the second terminal can send the plaintext data to the cloud platform.
The processor may receive plaintext data of the target device sent by the second terminal. The configuration file of a specific format may refer to a configuration file of a yml format, that is, a minifi configuration file. The particular protocol type may refer to a private protocol. Ciphertext data may refer to data encrypted by a private protocol. The plaintext data may refer to plaintext data in a preset format of "start symbol + command code + serial number + terminal ID number + protocol type + terminal type + protocol version + data length + data block + check code + end symbol".
The processor may temporarily store the plaintext data to a specified subject of kafka through the message queue, where the specified subject may refer to a subject corresponding to a specific protocol type of the target device. For example, as shown in FIG. 9, a schematic diagram of a component parameter configuration is shown. From Minifi and PublishKafka _2.0, among others, may refer to the acquisition component of the nifi application. from Minifi and publish kafka _2.0 may be connected via a message queue, which may provide a queue buffer. After the first terminal configures from Minifi and PublishKafka _2.0, a template file can be generated and sent to the cloud-end platform. The processor may receive the plaintext data for the target device via from Minifi and temporarily store the plaintext data to a specified subject of kafka via the message queue via PublishKafka _ 2.0. The specified subject of kafka may refer to a temporary storage space divided according to a specific protocol type of a target device.
The processor may receive a second template file transmitted by the first terminal. Wherein, the first terminal may refer to a terminal installed with a nifi application. The second template file may refer to a configuration file in yml format, i.e. a minifi configuration file. And the second template file is generated after the user performs corresponding parameter configuration on the preset data processing component through the operation interface of the nifi application program of the first terminal.
In the event that the processor receives the second template file, the processor may pre-process the plaintext data according to the second template file. Specifically, the processor may first obtain corresponding plaintext data according to the second template file. Then, the processor may perform structuring processing, such as data conversion and data cleaning, on the plaintext data according to the second template file to obtain structured plaintext data. That is, the preprocessing may include data conversion, data cleansing, and the like. The processor may store the structured plaintext data to a database. Among them, the database may include Hbase, hive, elastic search, and cantsandra, etc.
In one embodiment, the method further comprises: before receiving plaintext data of target equipment sent by a second terminal, determining a specific protocol type adopted by the target equipment; compiling according to a specific protocol type to generate a parser corresponding to the target equipment; and sending the parser to the second terminal so that the second terminal parses the acquired ciphertext data into plaintext data through the parser.
The processor may determine the specific protocol type employed by the target device before receiving the plaintext data of the target device sent by the second terminal. Wherein the specific protocol type may be a private protocol. Then, the processor may compile and generate an analyzer corresponding to the target device according to the specific protocol type, and may send the analyzer to the second terminal, so that the second terminal may analyze the acquired ciphertext data into plaintext data through the analyzer. Wherein the second terminal may refer to a second terminal of the target device. Ciphertext data may refer to data encrypted by a private protocol. The plaintext data may refer to plaintext data in a preset format of "start symbol + command code + serial number + terminal ID number + protocol type + terminal type + protocol version + data length + data block + check code + end symbol".
Through the technical scheme, the acquired plaintext data is converted into the structured data according to the template file, the structured data is stored in the corresponding database, and a large amount of data can be effectively processed and classified. And corresponding data can be inquired more conveniently and rapidly when the data needs to be analyzed subsequently.
In one embodiment, a storage medium is provided, on which a program is stored, and when the program is executed by a processor, the method for collecting data is implemented, and the method is applied to a cloud platform.
In one embodiment, a processor is provided, and is configured to execute a program, where the method for acquiring data is executed when the program runs, and the method is applied to a cloud platform.
Fig. 10 schematically shows a flow diagram of a method for acquiring data according to an embodiment of the present application. As shown in fig. 10, in an embodiment of the present application, there is provided a method for collecting data, the method comprising the steps of:
step 1001, a first terminal acquires a first operation instruction, which is triggered by a user through an operation interface of a nifi application program and aims at a first icon, wherein the first icon is a display icon of a preset nifi component in the nifi application program, and the preset nifi component is determined from a plurality of nifi components according to a specific protocol type of a target device.
In step 1002, the first terminal obtains, according to the first operation instruction, a configuration parameter for each preset nifi component, where the configuration parameter is input by the user and is determined according to a specific protocol type adopted by the target device and a data type that can be acquired by the target device.
In step 1003, the first terminal generates a first template file corresponding to the target device according to the configuration parameters of each preset nifi component, and sends the first template file to the second terminal corresponding to the target device.
Step 1004, the second terminal receives the first template file and converts the first template file into a configuration file with a corresponding specific format.
In step 1005, the cloud platform sends a data acquisition command to the second terminal.
Step 1006, when the second terminal receives the data acquisition instruction, the second terminal acquires the device data of the target device in real time according to the configuration file with the specific format.
Step 1007, the second terminal sends the device data to the cloud platform.
Wherein, the first terminal can be installed with the nifi application program. The nifi application may include an operation interface. The operation interface may refer to a web interface of the nifi application. A plurality of display icons can be included in the operation interface. For example, the display icon may be a first icon. The first icon is a display icon of a preset nifi component in the nifi application. The preset nifi components are determined from the plurality of nifi components according to the specific protocol type of the target device. The nifi component may refer to a component of data collection. For example, nifi components may include TailFile, extractText, edgeDataProcesses, executeStreamCommand, postHttp, and the like.
When data are collected, the first terminal may first obtain a first operation instruction, triggered by the user through an operation interface of the nifi application program, for the first icon. Then, the first terminal may obtain, according to the first operation instruction, the configuration parameter for each preset nifi component input by the user. The configuration parameters may be determined according to a specific protocol type adopted by the target device and a data type that can be collected by the target device. The particular protocol type may refer to a private protocol, i.e., a private protocol. The data types collected by the target device may include working condition data, operation track data, communication log data, and the like of the target device.
The first terminal can generate a first template file corresponding to the target device according to the configuration parameters of each preset nifi component. Wherein, the first template file may refer to a template file in xml format. Under the condition of generating the first template file, the first terminal may send the first template file to a second terminal corresponding to the target device through a downlink remote upgrade channel. The second terminal may receive the first template file and may convert the first template file into a corresponding configuration file of a specific format. The configuration file of a specific format may refer to a configuration file of a yml format, that is, a configuration file of a minifi.
The cloud platform can send a data acquisition instruction to the second terminal. And under the condition that the second terminal receives the data acquisition instruction, the second terminal acquires the equipment data of the target equipment in real time according to the configuration file with the specific format. The target device may refer to a device that needs to perform data acquisition. For example, the target device may refer to a work vehicle. If the protocol type adopted by the target device is a specific protocol type, the acquired device data may be ciphertext data. Under the condition that the second terminal collects the device data of the target device, the second terminal can send the device data to the cloud platform.
Through the technical scheme, different parameter configurations can be carried out on the preset nifi component on the visual interface, so that the template file corresponding to the preset nifi component is generated. When the target device adopts different protocol types, the data acquisition of different target devices can be realized by configuring different parameters for the preset nifi component, the labor cost and the time cost required by development are reduced conveniently and rapidly, a large number of components are not required to be developed repeatedly, the time period of the data acquisition is further shortened, and the efficiency of the data acquisition is also greatly improved.
In one embodiment, the second terminal is deployed with a mini application, and converting the first template file into a corresponding configuration file with a specific format includes: and the second terminal calls a file converter in the minifi application program so as to convert the first template file into a corresponding minifi configuration file through the file converter.
Wherein, the second terminal may be deployed with a mini application. And the second terminal is deployed with a mini application program. The second terminal may convert the first template file into a corresponding configuration file of a specific format. Specifically, the second terminal may call a file converter in the minifi application, and may convert the first template file into the minifi configuration file through the file converter. Wherein, the first template file may refer to a file in xml format. The file converter may refer to a ToolKit converter in a minifi application. The ToolKit converter may convert the template file in xml format to a file in yml format. The yml format file is the mini configuration file.
In one embodiment, the device data is ciphertext data, and the method further comprises: determining a specific protocol type adopted by the target equipment through a cloud platform; the cloud platform compiles and generates a resolver corresponding to the target equipment according to the specific protocol type, and sends the resolver to the second terminal; under the condition that the second terminal receives the parser, the second terminal loads the corresponding parser according to the private protocol, and the ciphertext data is parsed into plaintext data in a preset format through the parser; and the second terminal sends the plaintext data to the cloud platform.
Wherein the device data is ciphertext data. Ciphertext data may refer to data encrypted by a private protocol. That is, the protocol type adopted by the target device is a private protocol. The specific protocol type adopted by the target device can be determined through the cloud platform. The cloud platform can compile and generate a resolver corresponding to the target device according to the specific protocol type, and can send the resolver to the second terminal. The second terminal can load a corresponding parser according to the private protocol, and can parse the ciphertext data into plaintext data in a preset format through the parser. The second terminal can send the plaintext data to the cloud platform. Wherein the second terminal may refer to a second terminal of the target device. The plaintext data may refer to plaintext data in a preset format of "start symbol + command code + serial number + terminal ID number + protocol type + terminal type + protocol version + data length + data block + check code + end symbol".
In one embodiment, the method further comprises: the method comprises the steps that a first terminal receives a data processing request initiated by a user, wherein the data processing request is initiated after the user performs corresponding data acquisition operation according to a first template file at a second terminal to obtain device data of target equipment; the first terminal loads a second icon to the operation interface according to the data processing request, wherein the second icon is a display icon of a preset data processing component in the nifi application program; the first terminal acquires a second operation instruction aiming at the second icon, which is triggered by the user through the operation interface; the first terminal acquires configuration parameters input by a user and aiming at each preset data processing component according to the second operation instruction, wherein the configuration parameters are determined according to the specific protocol type adopted by the target equipment and the queue code of the data to be processed; the first terminal generates a second template file corresponding to the target equipment according to the configuration parameters of each preset data processing assembly; and the first terminal sends the second template file to the cloud platform.
Under the condition that the second terminal performs corresponding data acquisition operation according to the first template file to acquire device data of the target device, the first terminal can receive a data processing request initiated by a user and can load the second icon to an operation interface according to the data processing request. Wherein the operation interface may refer to a web interface of the nifi application. The operation interface may include a plurality of display icons. For example, the display icon may be a second icon. The second icon may be a display icon of a preset data processing component in the nifi application. The preset data processing component may refer to a component capable of data processing and data storage. The preset data processing component may be determined from a plurality of data processing components according to the type of data collected. For example, the preset data processing component may be Consumer Kafka _2.0, dataProcessor, convertJsonToAvro, queryRecord, puthbaseJson, appendeCapeProcessor, etc.
The first terminal can acquire a second operation instruction, triggered by the user through the operation interface, for the second icon, and can acquire the configuration parameters, input by the user, for each preset data processing component according to the second operation instruction. The configuration parameters may be determined according to a specific protocol type adopted by the target device and a queue code of data to be processed. The cloud platform stores the device data to the corresponding specified theme of kafka through the specific protocol type of the target device, so that when the device data are processed, a user can firstly perform parameter configuration on each preset data processing component. Specifically, the user may input a specific protocol type of the target device corresponding to the device data to determine the specified subject of kafka corresponding to the device data of the target device. The user may then also enter a queue code for the device data, i.e., the consumption address of the device data in the specified topic of kafka. In a case where the user inputs the configuration parameters for each preset data processing component, the first terminal may acquire the configuration parameters according to the second operation instruction.
The first terminal may generate a second template file corresponding to the target device according to the configuration parameter of each preset data processing component. The second template file may refer to a configuration file in a yml format, i.e., a minifi configuration file. The first terminal can send the second template file to the cloud platform so as to perform corresponding data processing operation and data storage operation on the data collected by the second terminal through the cloud platform according to the second template file.
In one embodiment, the method further comprises: the cloud platform receives plaintext data of the target device sent by the second terminal; the cloud platform temporarily stores the plaintext data to a specified theme of the kafka through a message queue, wherein the specified theme is a theme corresponding to a specific protocol type of the target device; under the condition that the cloud platform receives a second template file sent by the first terminal, the cloud platform preprocesses the plaintext data of the specified subject temporarily stored to kafka according to the second template file to obtain structured plaintext data; and the cloud platform stores the structured plaintext data to the database.
The cloud platform can receive plaintext data of the target device sent by a second terminal of the target device. The plaintext data may refer to plaintext data in a preset format of "start symbol + command code + serial number + terminal ID number + protocol type + terminal type + protocol version + data length + data block + check code + end symbol". Under the condition that the cloud platform receives plaintext data of the target device, the cloud platform can temporarily store the plaintext data to a specified subject of kafka through a message queue. Wherein the specified theme may refer to a theme corresponding to a specific protocol type of the target device.
The first terminal may refer to a terminal installed with a nifi application. The second template file may refer to a minifi configuration file. And the second template file is generated by the first terminal according to the configuration parameters of the preset data processing component after the user performs corresponding parameter configuration on the preset data processing component through the operation interface of the nifi application program of the first terminal. Under the condition that the first terminal generates the second template file and sends the second template file to the cloud platform, the cloud platform can receive the second template file and can preprocess the plaintext data of the specified subject temporarily stored to the kafka according to the second template file to obtain structured plaintext data. The preprocessing mode may include data conversion, data cleaning, and the like. Under the condition that the cloud platform obtains the structured plaintext data, the cloud platform can store the structured plaintext data to the database. Among them, the database can be based on Hbase, hive, elastic search, and cantsandra, etc.
In an embodiment, a storage medium is provided, on which a program is stored which, when being executed by a processor, carries out the above-mentioned method for acquiring data.
In one embodiment, a processor for executing a program is provided, wherein the program executes the method for collecting data described above.
In one embodiment, the target device may be an engineering vehicle. The work vehicle may refer to a vehicle capable of performing mechanical construction. For example, the work vehicle may be a loader, a bulldozer, an excavator, a mixer truck, and the like.
Fig. 2, 7, 8, and 10 are flow diagrams illustrating a method for collecting data in one embodiment. It should be understood that, although the steps in the flowcharts of fig. 2, 7, 8 and 10 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2, 7, 8, and 10 may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternatingly with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 11, a system for collecting data is provided, comprising a first device 1101, a second device 1102, and a cloud device 1103, wherein:
a first apparatus 1101 comprising a processor 1, wherein the processor 1 is configured to perform the method for collecting data described above, the first apparatus 1101 being installed in a first terminal, the first terminal being installed with a nifi application;
a second apparatus 1102 comprising a processor 2, wherein the processor 2 is configured to perform the above method for acquiring data, the second apparatus 1102 being mounted to a target device;
the cloud device 1103 includes a processor 3, wherein the processor 3 is configured to execute the above method for collecting data, and the cloud device 1103 is installed on a cloud platform.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 12. The computer apparatus includes a processor a01, a network interface a02, a display screen a04, an input device a05, and a memory (not shown in the figure) connected through a system bus. Wherein the processor a01 of the computer device is arranged to provide computing and control capabilities. The memory of the computer apparatus includes an internal memory a03 and a nonvolatile storage medium a06. The nonvolatile storage medium a06 stores an operating system B01 and a computer program B02. The internal memory a03 provides an environment for running the operating system B01 and the computer program B02 in the nonvolatile storage medium a06. The network interface a02 of the computer apparatus is used for communicating with an external terminal through a network connection. The computer program is executed by the processor a01 to implement a method for acquiring data. The display screen a04 of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device a05 of the computer device may be a touch layer covered on the display screen, a key, a trackball or a touch pad arranged on a casing of the computer device, or an external keyboard, a touch pad or a mouse.
Those skilled in the art will appreciate that the architecture shown in fig. 12 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
An embodiment of the present application provides an apparatus, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, the steps of the method for acquiring data described above are implemented.
The present application further provides a computer program product adapted to perform a program of initializing method steps for collecting data when executed on a data processing device.
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 embodiments of 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.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the present application pertains. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (24)

1. A method for collecting data, the method being applied to a first terminal installed with a nifi application, the method comprising:
acquiring a first operation instruction aiming at a first icon triggered by the user through an operation interface of the nifi application program, wherein the first icon is a display icon of a preset nifi component in the nifi application program, and the preset nifi component is determined from a plurality of nifi components according to a specific protocol type of a target device;
acquiring configuration parameters, which are input by the user and aim at each preset nifi component, according to the first operating instruction, wherein the configuration parameters are determined according to a specific protocol type adopted by target equipment and a data type which can be acquired by the target equipment;
generating a first template file corresponding to the target device according to the configuration parameters of each preset nifi component;
and sending the first template file to a second terminal corresponding to the target equipment so as to carry out corresponding data acquisition operation according to the first template file through the second terminal.
2. The method for acquiring data as recited in claim 1, the method further comprising:
receiving a data processing request initiated by the user, wherein the data processing request is initiated after the user performs corresponding data acquisition operation at the second terminal according to the first template file to obtain device data of the target device;
loading a second icon to the operation interface according to the data processing request, wherein the second icon is a display icon of a preset data processing component in the nifi application program;
acquiring a second operation instruction, triggered by the user through the operation interface, for the second icon;
acquiring configuration parameters, which are input by the user and are specific to each preset data processing component, according to the second operation instruction, wherein the configuration parameters are determined according to a specific protocol type adopted by the target device and a queue code of data to be processed;
generating a second template file corresponding to the target equipment according to the configuration parameters of each preset data processing component;
and sending the second template file to a cloud platform so as to perform corresponding data processing operation and data storage operation on the data acquired by the second terminal according to the second template file through the cloud platform.
3. A method for acquiring data is applied to a second terminal corresponding to a target device, and the method comprises the following steps:
receiving a first template file sent by a first terminal, wherein the first template file is generated after a user performs corresponding parameter configuration on a preset nifi component through an operation interface of a nifi application program, and the nifi application program is installed on the first terminal;
converting the first template file into a corresponding configuration file with a specific format;
and under the condition of receiving a data acquisition instruction sent by a cloud platform, acquiring the equipment data of the target equipment in real time according to the configuration file with the specific format.
4. The method for collecting data according to claim 3, wherein the collecting device data of the target device in real time according to the configuration file of the specific format comprises:
acquiring ciphertext data of the target equipment in real time according to the configuration file with the specific format;
analyzing the ciphertext data into plaintext data;
and sending the plaintext data to a cloud platform for data storage.
5. The method of claim 4, wherein the specific protocol type adopted by the target device is a private protocol, and the parsing the ciphertext data into plaintext data comprises:
loading a corresponding analyzer according to the private protocol to analyze the ciphertext data, wherein the analyzer is generated according to protocol types adopted by different types of target equipment;
and analyzing the ciphertext data into plaintext data in a preset format through the analyzer.
6. The method for collecting data according to claim 3, wherein the second terminal is deployed with a minifi application, and the converting the first template file into a configuration file of a corresponding specific format comprises:
calling a file converter in the minifi application program;
and converting the first template file into a minifi configuration file through the file converter.
7. A method for collecting data, wherein the method is applied to a cloud platform, and the method comprises the following steps:
receiving plaintext data of target equipment, which is sent by a second terminal of the target equipment, wherein the plaintext data is determined after ciphertext data is analyzed through an analyzer corresponding to a specific protocol type adopted by the target equipment, and the ciphertext data is acquired by the second terminal in real time according to a configuration file with a specific format;
temporarily storing the plaintext data to a specified subject of kafka through a message queue, wherein the specified subject is a subject corresponding to a specific protocol type of the target device;
receiving a second template file sent by a first terminal, wherein the second template file is generated after a user carries out corresponding parameter configuration on a preset data processing component through an operation interface of a nifi application program of the first terminal;
preprocessing the plaintext data according to the second template file to obtain structured plaintext data;
and storing the structured plaintext data to a database.
8. The method for collecting data as in claim 7, further comprising:
before receiving plaintext data of the target equipment sent by the second terminal, determining a specific protocol type adopted by the target equipment;
compiling according to the specific protocol type to generate a parser corresponding to the target device;
and sending the analyzer to the second terminal so that the second terminal analyzes the acquired ciphertext data into plaintext data through the analyzer.
9. A method for collecting data, the method comprising:
the method comprises the steps that a first terminal obtains a first operation instruction aiming at a first icon triggered by a user through an operation interface of a nifi application program, wherein the first icon is a display icon of a preset nifi component in the nifi application program, and the preset nifi component is determined from a plurality of nifi components according to a specific protocol type of target equipment;
the first terminal acquires configuration parameters, which are input by the user and aim at each preset nifi component, according to a first operation instruction, wherein the configuration parameters are determined according to a specific protocol type adopted by target equipment and a data type which can be acquired by the target equipment;
the first terminal generates a first template file corresponding to the target equipment according to the configuration parameters of each preset nifi component, and sends the first template file to a second terminal corresponding to the target equipment;
the second terminal receives the first template file and converts the first template file into a corresponding configuration file with a specific format;
the cloud platform sends a data acquisition instruction to the second terminal;
under the condition that the second terminal receives the data acquisition instruction, the second terminal acquires the equipment data of the target equipment in real time according to the configuration file with the specific format;
and the second terminal sends the equipment data to the cloud platform.
10. The method for collecting data according to claim 9, wherein the second terminal is deployed with a minifi application, and converting the first template file into a configuration file of a corresponding specific format comprises:
and the second terminal calls a file converter in the minifi application program so as to convert the first template file into a corresponding minifi configuration file through the file converter.
11. The method for collecting data as recited in claim 9, wherein the device data is ciphertext data, the method further comprising:
determining a specific protocol type adopted by the target equipment through the cloud platform;
the cloud platform compiles and generates an analyzer corresponding to the target equipment according to the specific protocol type, and sends the analyzer to the second terminal;
under the condition that the second terminal receives the parser, the second terminal loads the corresponding parser according to the private protocol, and the ciphertext data is parsed into plaintext data in a preset format through the parser;
and the second terminal sends the plaintext data to a cloud platform.
12. The method for collecting data as in claim 9, further comprising:
the first terminal receives a data processing request initiated by a user, wherein the data processing request is initiated after the user performs corresponding data acquisition operation on the second terminal according to the first template file to obtain device data of the target device;
the first terminal loads a second icon to the operation interface according to the data processing request, wherein the second icon is a display icon of a preset data processing component in the nifi application program;
the first terminal acquires a second operation instruction which is triggered by the user through the operation interface and aims at the second icon;
the first terminal acquires configuration parameters, which are input by the user and aim at each preset data processing component, according to the second operation instruction, wherein the configuration parameters are determined according to a specific protocol type adopted by the target device and a queue code of data to be processed;
the first terminal generates a second template file corresponding to the target equipment according to the configuration parameters of each preset data processing component;
and the first terminal sends the second template file to a cloud platform.
13. The method for acquiring data as recited in claim 12, further comprising:
the cloud platform receives plaintext data of the target device sent by the second terminal;
the cloud platform temporarily stores the plaintext data to a specified subject of kafka through a message queue, wherein the specified subject is a subject corresponding to a specific protocol type of the target device;
under the condition that the cloud platform receives a second template file sent by the first terminal, the cloud platform preprocesses the plaintext data of the specified subject temporarily stored to kafka according to the second template file to obtain structured plaintext data;
and the cloud platform stores the structured plaintext data to a database.
14. Method for collecting data according to any of claims 9 to 13, characterized in that the target device is an engineering vehicle.
15. A processor configured to perform the method for acquiring data according to claim 1 or 2.
16. A machine-readable storage medium having instructions stored thereon, which when executed by a processor cause the processor to be configured to perform a method for acquiring data according to claim 1 or 2.
17. A processor configured to perform the method for acquiring data according to any one of claims 3 to 6.
18. A machine-readable storage medium having instructions stored thereon, which when executed by a processor causes the processor to be configured to perform a method for acquiring data according to any one of claims 3 to 6.
19. A work vehicle, characterized in that the work vehicle comprises:
a second terminal; and
the processor of claim 17.
20. A processor configured to perform the method for acquiring data according to claim 7 or 8.
21. A machine-readable storage medium having instructions stored thereon, which when executed by a processor causes the processor to be configured to perform the method for acquiring data according to claim 7 or 8.
22. A processor configured to perform the method for acquiring data according to any one of claims 9 to 13.
23. A machine-readable storage medium having instructions stored thereon, which when executed by a processor causes the processor to be configured to perform a method for acquiring data according to any one of claims 9 to 13.
24. A system for collecting data, the system comprising:
a first device comprising the processor of claim 15;
a second device comprising the processor of claim 17; and
a cloud-based device comprising the processor of claim 20.
CN202210827904.6A 2022-07-14 2022-07-14 Method for collecting data, storage medium, processor and engineering vehicle Pending CN115237399A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210827904.6A CN115237399A (en) 2022-07-14 2022-07-14 Method for collecting data, storage medium, processor and engineering vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210827904.6A CN115237399A (en) 2022-07-14 2022-07-14 Method for collecting data, storage medium, processor and engineering vehicle

Publications (1)

Publication Number Publication Date
CN115237399A true CN115237399A (en) 2022-10-25

Family

ID=83674320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210827904.6A Pending CN115237399A (en) 2022-07-14 2022-07-14 Method for collecting data, storage medium, processor and engineering vehicle

Country Status (1)

Country Link
CN (1) CN115237399A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115510038A (en) * 2022-11-17 2022-12-23 中国铁建高新装备股份有限公司 Equipment data management method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115510038A (en) * 2022-11-17 2022-12-23 中国铁建高新装备股份有限公司 Equipment data management method and system

Similar Documents

Publication Publication Date Title
CN109933522B (en) Test method, test system and storage medium for automatic case
US7992155B2 (en) Method and system to correlate and consolidate a plurality of events
US20130081001A1 (en) Immediate delay tracker tool
CN114490268A (en) Full link monitoring method, device, equipment, storage medium and program product
US20220138074A1 (en) Method, electronic device and computer program product for processing data
CN113867600A (en) Development method and device for processing streaming data and computer equipment
CN104462943A (en) Non-intrusive performance monitoring device and method for service system
US20210406004A1 (en) System and method for implementing a code audit tool
CN110795181A (en) Application program interface display method and device based on skip protocol and electronic equipment
CN110769002A (en) LabVIEW-based message analysis method, system, electronic device and medium
CN110188308B (en) Client automatic dotting reporting method, storage medium, equipment and system
CN115237399A (en) Method for collecting data, storage medium, processor and engineering vehicle
CN113448690B (en) Monitoring method and device
CN106610845B (en) Information management method, device, server and system
CN114116509A (en) Program analysis method, program analysis device, electronic device, and storage medium
CN112445691B (en) Non-invasive intelligent contract performance detection method and device
US9484743B2 (en) Power distribution network event analysis using data from different data sources
CN110704099A (en) Alliance chain construction method and device and electronic equipment
KR20170122874A (en) Apparatus for managing log of application based on data distribution service
CN113141407B (en) Page resource loading method and device and electronic equipment
CN113656044B (en) Android installation package compression method and device, computer equipment and storage medium
CN115203674A (en) Automatic login method, system, device and storage medium for application program
CN114791884A (en) Test environment construction method and device, storage medium and electronic equipment
US8495033B2 (en) Data processing
US20190377717A1 (en) Representing and analyzing cloud computing data as pseudo systems

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