A loosely coupled, highly scalable, non-buried point data acquisition method based on embedded Linux

By adopting a loosely coupled, highly scalable and zero-burden data collection method in the embedded Linux system, the network pressure and maintenance cost problems caused by embedded device data collection are solved, and full data collection and storage are achieved with high efficiency and no buried points. , dynamic adaptation capability, reducing terminal load.

CN114116402BActive Publication Date: 2024-09-17SHANDONG ARTAPLAY INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111439555.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2024-09-17
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

Embedded device data collection causes increased network pressure and system maintenance costs, making it difficult to achieve efficient, full data collection and storage without hidden points using existing technology.

Method used

Adopting a loosely coupled, highly scalable and point-free data collection method based on embedded Linux, and realizing unified uploading and Storage, supporting indexing and display of JSON structured data.

Benefits of technology

It realizes data collection without buried points, reduces adaptation development costs, improves the comprehensiveness and availability of data collection, supports full data collection and archiving, has strong dynamic adaptation capabilities, and reduces terminal load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116402B
    Figure CN114116402B
Patent Text Reader

Abstract

A loosely coupled, highly scalable, non-embedded data collection method based on embedded Linux has the advantages of more comprehensive data collection, convenient and fast without embedding, reduced adaptation development costs, high availability, etc. Compared with conventional embedded Linux information reporting, the logs are normalized and standardized, full data collection and archiving after data collection are supported, and each field supports indexing. Compared with ordinary non-embedded data collection methods, it supports dynamic adaptability of data collection, which can not only ensure the comprehensiveness of collected data, but also reduce terminal load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data acquisition, and in particular to a loosely coupled, highly expansible, non-buried-point data acquisition method based on embedded Linux. Background Art

[0002] With the development of embedded Linux systems, the types of embedded devices are becoming more and more complex, and more and more devices are collecting data. A large number of devices need to be connected to the Internet and transmit data, as well as different functional requirements corresponding to different implementation environments. The storage and transmission of redundant data fields of the huge basic functional system and a large number of device instances not only puts tremendous pressure on the network and cloud system, but also increases the workload and maintenance cost of system development. Summary of the invention

[0003] In order to overcome the shortcomings of the above technologies, the present invention provides a universal, loosely coupled data collection method without buried points, supports full data collection, and uniformly uploads and stores data of different types of devices for big data analysis and processing.

[0004] The technical solution adopted by the present invention to overcome the technical problems is:

[0005] A loosely coupled, highly scalable, non-buried point data acquisition method based on embedded Linux, comprising the following steps:

[0006] a) Set up an embedded Linux transplant log library. Each Linux program transfers the log to the message queue. The thread in the embedded Linux transplant log library reads the log from the message queue and writes it to the disk.

[0007] b) a log collection module is provided, wherein the log collection module is composed of several embedded terminals, each of which is composed of a Linux transplant log library and a log processing engine, and the log processing engine reads the logs in the Linux transplant log library and generates corresponding JSON structured data;

[0008] c) Setting a data storage module, wherein the data storage module is divided into a MySQL database and a Kafka cache, storing the JSON structured data of the MySal type in the MySQL database, and storing the JSON structured data of the Kafka type in the Kafka cache;

[0009] d) Setting a data aggregation index module, wherein the data aggregation index module indexes the JSON structured data in the data storage module according to each field;

[0010] e) Setting a data visualization module, which displays the indexed data.

[0011] Furthermore, in step a), the embedded Linux transplant log library adopts a producer-consumer model, where the message queue is first cached in memory and then another thread is enabled to read the log from the queue and write it to the disk.

[0012] Furthermore, in step b), the log processing engine uses a string to preliminarily filter the log to generate an original log file, and flent bit reads the original log file, filters the original log according to the regular expression sent by the server, and generates corresponding JSON structured data.

[0013] Furthermore, the JSON structured data in step b) includes terminal ID, service name, event name, occurrence time and custom information.

[0014] Furthermore, in step b), the JSON structured data is uploaded to the headend server via APK.

[0015] Furthermore, in step d), the data aggregation indexing module is composed of logstash and Elasticsearch. Logstash receives Kafka-type JSON structured data and MySQL-type JSON structured data and transfers them to Elasticsearch. Elasticsearch indexes and aggregates the Kafka-type JSON structured data and MySQL-type JSON structured data, so that the corresponding data is indexed according to each field.

[0016] Furthermore, in step e), the data aggregation index module is composed of klbana.

[0017] The beneficial effects of the present invention are: compared with ordinary data collection, the collected data is more comprehensive, convenient and fast without embedding points, reduced adaptation development costs, high availability, etc. Compared with conventional embedded Linux information reporting, the logs are normalized and standardized, full data collection and archiving after data collection are supported, and each field supports indexing. Compared with ordinary data collection methods without embedding points, it supports dynamic adaptability of data collection, which can not only ensure the comprehensiveness of collected data, but also reduce terminal load. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is a flow chart of data collection without embedding points of the present invention;

[0019] Figure 2 This is the schematic diagram of the embedded Linux log library. DETAILED DESCRIPTION

[0020] The following is combined with Figure 1 , Attachment Figure 2 The present invention is further described.

[0021] A loosely coupled, highly scalable, non-buried point data acquisition method based on embedded Linux, comprising the following steps:

[0022] a) Set up the embedded Linux transplant log library. Each Linux program transmits the log to the message queue. The thread in the embedded Linux transplant log library reads the log from the message queue and writes it to the disk. Embedded Linux does not have a unified log information output, so the log library needs to be transplanted to achieve the unification and standardization of the log. The overall transplant process is to add the source code to the project, implement the corresponding log interface, and other applications only need to import the corresponding header file and initialize it when using the log library.

[0023] b) a log collection module is provided, wherein the log collection module is composed of several embedded terminals, each of which is composed of a Linux transplant log library and a log processing engine, and the log processing engine reads the logs in the Linux transplant log library and generates corresponding JSON structured data.

[0024] c) Setting a data storage module, wherein the data storage module is divided into a MySQL database and a Kafka cache, storing the JSON structured data of the MySal type in the MySQL database, and storing the JSON structured data of the Kafka type in the Kafka cache.

[0025] d) Setting a data aggregation index module, which indexes the JSON structured data in the data storage module according to each field.

[0026] e) Setting a data visualization module, which displays the indexed data.

[0027] Embodiment 1:

[0028] In step a), the embedded Linux transplant log library adopts the producer-consumer mode. The message queue is first cached to the memory, and then another thread is enabled to read the log from the queue and write it to the disk. In this way, the log can be written at high speed and high performance. The program only needs to be responsible for transferring the log to the message queue without having to worry about other writing work, which reduces the coupling of the program.

[0029] Embodiment 2:

[0030] In step b), the log processing engine uses a string to preliminarily filter the log to generate the original log file. Flent bit reads the original log file, filters the original log according to the regular expression sent by the server, and generates the corresponding JSON structured data. In step b), the JSON structured data contains the terminal ID, business name, event name, occurrence time and custom information. In step b), the JSON structured data is uploaded to the headend server through APK. Through APK, data is spit into the topic of Kafka. The advantages of Kafka are high throughput and low latency. Kafka can process hundreds of thousands of messages per second, and its minimum latency is only a few milliseconds. It is also scalable. The Kafka cluster supports hot expansion, persistence, reliability, and messages are persisted to the local disk. It also supports data backup to prevent data loss. The cluster is allowed to find which node fails (if the number of copies is n, n-1 nodes are allowed to fail), and supports thousands of clients to read and write at the same time.

[0031] Embodiment 3:

[0032] In step d), the data aggregation index module is composed of logstash and Elasticsearch. Logstash receives Kafka-type JSON structured data and MySQL-type JSON structured data and transfers them to Elasticsearch. Elasticsearch indexes and aggregates the Kafka-type JSON structured data and MySQL-type JSON structured data, so that the corresponding data is indexed according to each field.

[0033] Embodiment 4:

[0034] In step e), the data aggregation index module is composed of klbana. Through the Elasticsearch index, simple rule calculations can be performed on the data to produce corresponding data tables and pie charts, and support the import and export functions of configurations.

[0035] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A loosely coupled, highly scalable, non-embedded data acquisition method based on embedded Linux, characterized in that: The steps include: a) Set up an embedded Linux transplant log library. Each Linux program transfers the log to the message queue. The thread in the embedded Linux transplant log library reads the log from the message queue and writes it to the disk. b) a log collection module is provided, wherein the log collection module is composed of several embedded terminals, each of which is composed of a Linux transplant log library and a log processing engine, and the log processing engine reads the logs in the Linux transplant log library and generates corresponding JSON structured data; c) Setting a data storage module, wherein the data storage module is divided into a MySQL database and a Kafka cache, storing the JSON structured data of the MySal type in the MySQL database, and storing the JSON structured data of the Kafka type in the Kafka cache; d) Setting a data aggregation index module, wherein the data aggregation index module indexes the JSON structured data in the data storage module according to each field; e) Setting a data visualization module, which displays the indexed data.

2. According to claim 1, the loosely coupled, highly scalable, non-buried point data acquisition method based on embedded Linux is characterized in that: In step a), the embedded Linux transplant log library adopts the producer-consumer mode. The message queue is first cached in the memory and then another thread is enabled to read the log from the queue and write it to the disk.

3. According to claim 1, the loosely coupled, highly scalable, non-buried point data acquisition method based on embedded Linux is characterized in that: In step b), the log processing engine uses a string to perform preliminary screening of the log to generate an original log file. Flent bit reads the original log file, filters the original log according to the regular expression sent by the server, and generates corresponding JSON structured data.

4. The method for collecting data based on embedded Linux with loose coupling and high scalability without embedding points according to claim 1 is characterized in that: The JSON structured data in step b) includes the terminal ID, service name, event name, occurrence time and custom information.

5. The method for collecting data based on embedded Linux with loose coupling and high scalability without embedding points according to claim 1 is characterized in that: In step b), the JSON structured data is uploaded to the headend server via APK.

6. The method for data acquisition based on embedded Linux with loose coupling and high scalability without buried points according to claim 1 is characterized in that: In step d), the data aggregation index module is composed of logstash and Elasticsearch. Logstash receives Kafka-type JSON structured data and MySQL-type JSON structured data and transfers them to Elasticsearch. Elasticsearch indexes and aggregates the Kafka-type JSON structured data and MySQL-type JSON structured data, so that the corresponding data is indexed according to each field.

7. The method for collecting data based on embedded Linux with loose coupling and high scalability without buried points according to claim 1 is characterized in that: In step e), the data aggregation index module is composed of klbana.