Data processing method, device, equipment and medium based on Flume data center
By using the Flume distributed data processing system and the master-slave heartbeat mechanism in the data center, the status of the service process is detected and the standby process or data balancing is enabled, which solves the problems of data loss and excessive storage space usage during the data processing process. , achieving efficient and secure data transmission and storage.
Patent Information
- Application Number
- CN202010579722.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-23
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-06-23
AI Technical Summary
Existing data centers are prone to data loss and excessive storage space usage during data processing. This is mainly due to the inability to promptly alert and repair when the process exits abnormally, resulting in data redundancy.
Using a distributed data center based on Flume, the real-time status of the service process of the agent node is detected through the master-slave heartbeat mechanism, and the backup service process is enabled or the data is output using a data balancing method to ensure the security and stability of data transmission while reducing storage Space occupied.
It effectively reduces the occupancy rate of storage space, improves the security and stability of data transmission, avoids data loss, and simplifies the processing of data source access and storage media differences.
Smart Images

Figure CN111813621B_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of big data processing, and in particular to a data processing method, device, equipment and medium based on a Flume data center. [Background technology]
[0002] The data middle platform refers to the technology that uses data technology to collect, calculate, store, and process massive amounts of data to form a big data asset layer, thereby providing customers with efficient services.
[0003] The existing data center obtains data by directly connecting the process to the data source. When a process exits abnormally, the data center cannot issue an alarm or repair in time, which easily leads to data loss. Therefore, in the process of data processing implemented by the data center, in order to ensure that data is not lost, the same data is implemented in the service process of the data center, but this will lead to a large amount of data duplication and redundancy, which will occupy too much storage space. [Summary of the invention]
[0004] In view of this, an embodiment of the present invention provides a data processing method, device, equipment and medium based on the Flume data center, so as to solve the problem that data occupies too much storage space during data processing in the data center.
[0005] In a first aspect, an embodiment of the present invention provides a data processing method based on a Flume data center, including:
[0006] Obtain log rules, collect data according to the log rules, and send the data to a message queue;
[0007] The data is input into a distributed data platform through the message queue, wherein the distributed data platform includes a master device and multiple distributed clusters, each of the distributed clusters includes multiple slave devices as proxy nodes of the distributed clusters, and the distributed data platform is implemented based on Flume;
[0008] Outputting the data from the distributed data center to a storage medium;
[0009] Among them, in the process of outputting the data from the distributed data middle platform to the storage medium, the main device adopts a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables a backup service process according to the real-time status, and outputs the data based on the backup service process, or, according to the real-time status, outputs the data in a data balanced landing manner.
[0010] According to the above aspects and any possible implementation manner, an implementation manner is further provided, in which during the process of outputting the data from the distributed data middle platform to the storage medium, the master device uses a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, including:
[0011] The proxy node periodically sends heartbeat information to the master device, wherein the heartbeat information includes memory occupancy rate and central processing unit occupancy rate;
[0012] The master device determines the real-time status of the service process in the proxy node according to the heartbeat information;
[0013] When the memory occupancy rate of the service process in the proxy node exceeds a first preset threshold or the CPU occupancy rate exceeds a second preset threshold, determining that the real-time state of the service process in the proxy node is overloaded;
[0014] When the memory occupancy rate of the service process in the proxy node is lower than the third preset threshold or the CPU occupancy rate is lower than the fourth preset threshold, it is determined that the real-time status of the service process in the proxy node is overloaded.
[0015] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the enabling of a standby service process according to the real-time status and outputting the data based on the standby service process, or outputting the data in a data balanced landing manner according to the real-time status, comprises:
[0016] When the real-time status of the service process in the proxy node is overloaded, and the service process in the proxy node does not have the standby service process, enabling the standby service process, and outputting the data based on the standby service process;
[0017] When the real-time status of the service process in the proxy node is overloaded and the message queue adopts Kafka, the data is output in a data balanced landing manner according to the Kafka group id.
[0018] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein obtaining log rules, collecting data according to the log rules, and sending the data to a message queue includes:
[0019] Providing multi-data source access services through a pre-established configuration service center, wherein the pre-established configuration service center is operated in the form of a front-end interface;
[0020] The log rule input by the user is obtained through the front-end interface, the data is collected from multiple data sources according to the log rule and the service accessed by the multiple data sources, and the data is sent to Kafka.
[0021] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the step of outputting the data from the distributed data middle station to a storage medium comprises:
[0022] Provide a unified data interface through a pre-built data service center;
[0023] According to the unified data interface, the data is output from the distributed data center to the same non-volatile storage medium.
[0024] In a second aspect, an embodiment of the present invention provides a data processing device based on a Flume data center, including:
[0025] A first processing module, used for obtaining log rules, collecting data according to the log rules, and sending the data to a message queue;
[0026] A second processing module is used to input the data into a distributed data middle station through the message queue, wherein the distributed data middle station includes a master device and multiple distributed clusters, each of the distributed clusters includes multiple slave devices as proxy nodes of the distributed clusters, and the distributed data middle station is implemented based on Flume;
[0027] A third processing module, used to output the data from the distributed data middle station to a storage medium;
[0028] The fourth processing module is used for, in the process of outputting the data from the distributed data middle station to the storage medium, the main device adopts a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables a backup service process according to the real-time status, outputs the data based on the backup service process, or, according to the real-time status, outputs the data in a data balanced landing manner.
[0029] Furthermore, the fourth processing module includes:
[0030] A first subunit is used for the proxy node to periodically send heartbeat information to the master device, wherein the heartbeat information includes memory occupancy rate and central processing unit occupancy rate;
[0031] A second subunit is used for the main device to determine the real-time status of the service process in the proxy node according to the heartbeat information;
[0032] A third subunit is used to determine that the real-time state of the service process in the proxy node is overloaded when the memory occupancy rate of the service process in the proxy node exceeds a first preset threshold or the CPU occupancy rate exceeds a second preset threshold;
[0033] The fourth subunit is used to determine that the real-time status of the service process in the proxy node is overloaded when the memory occupancy rate of the service process in the proxy node is lower than the third preset threshold or the CPU occupancy rate is lower than the fourth preset threshold.
[0034] Furthermore, the fourth processing module further includes:
[0035] a fifth subunit, configured to enable the standby service process and output the data based on the standby service process when the real-time status of the service process in the proxy node is overloaded and the standby service process does not exist in the service process in the proxy node;
[0036] The sixth subunit is used to output the data in a data balanced manner according to the Kafka group id when the real-time status of the service process in the proxy node is overloaded and the message queue adopts Kafka.
[0037] Furthermore, the first processing module includes:
[0038] A seventh subunit is used to provide a multi-data source access service through a pre-established configuration service center, wherein the pre-established configuration service center is operated in a front-end interface manner;
[0039] The eighth subunit obtains the log rule input by the user through the front-end interface, collects the data from multiple data sources according to the log rule and the service accessed by the multiple data sources, and sends the data to Kafka.
[0040] Furthermore, the third processing module includes:
[0041] The ninth subunit is used to provide a unified data interface through a pre-established data service center;
[0042] The tenth subunit is used to output the data from the distributed data middle station to the same non-volatile storage medium according to the unified data interface.
[0043] In a third aspect, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned data processing method based on the Flume data center when executing the computer program.
[0044] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, comprising: a computer program, which, when executed by a processor, implements the steps of the above-mentioned data processing method based on the Flume data center.
[0045] In an embodiment of the present invention, log rules are first obtained, data is collected according to the log rules, and the data is sent to a message queue, so that the collected data can be output to the next receiving device in an orderly and uniform format; then the data is input into a distributed data middle station through a message queue, wherein the distributed data middle station includes a master device and multiple distributed clusters, each distributed cluster includes multiple slave devices, and as a proxy node of the distributed cluster, the distributed data middle station is implemented based on Flume. On the premise of having the advantages of the Flume cluster, the master device is connected to each proxy node as the root node of the distributed data middle station to monitor each proxy node in real time, which provides a technical basis for the implementation of different output methods of subsequent data; finally, the data is output from the distributed data middle station to a storage medium, wherein, in the process of outputting data from the distributed data middle station to the storage medium, the master device adopts a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables the backup service process according to the real-time status, outputs data based on the backup service process, or, according to the real-time status, outputs data in a data balanced landing manner, which can determine the data output method according to the real-time status of the service process in the proxy node, thereby effectively reducing the occupancy rate of the storage space.
Brief Description of the Drawings
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 This is a flow chart of a data processing method based on Flume data center in one embodiment of the present invention;
[0048] Figure 2 This is a system architecture diagram of data processing based on Flume data center in one embodiment of the present invention;
[0049] Figure 3 It is a schematic diagram of a data processing device based on Flume data center in one embodiment of the present invention;
[0050] Figure 4 is a schematic diagram of a computer device in one embodiment of the present invention. [Specific implementation method]
[0051] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0052] It should be clear that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0054] It should be understood that the term "and / or" used in this article is only a description of the same field of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0055] It should be understood that, although the terms first, second, third, etc. may be used to describe preset ranges, etc. in the embodiments of the present invention, these preset ranges should not be limited to these terms. These terms are only used to distinguish preset ranges from each other. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0056] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0057] Figure 1 A flow chart of the data processing method based on Flume data center in this embodiment is shown. The data processing method based on Flume data center can be applied to a data processing system based on Flume data center, and the data processing system based on Flume data center can be used to implement massive data processing (mainly referring to data collection and output). The data processing system based on Flume data center can be specifically applied to a computer device, wherein the computer device is a device that can perform human-computer interaction with a user, including but not limited to computers, smart phones, tablets and other devices.
[0058] like Figure 1 As shown in the figure, the data processing method based on Flume data center includes the following steps:
[0059] S10: Obtain log rules, collect data according to the log rules, and send the data to the message queue.
[0060] Among them, the log rules can be specifically implemented based on log field information, delimiters between log fields, or delimiters between log lines. The data processing system based on the Flume data center obtains the log rules input by the user, and can filter the data to be collected according to the log field information selected by the user, and divide the data to be collected of different log level types according to the set delimiters between log fields and delimiters between log lines, and output the collected data according to the data format set by the delimiters between log fields and delimiters between log lines, so that the collected data can be neat and unified in data format. In one embodiment, the data processing system based on the Flume data center will collect data according to the log rules, and the collected data conforms to the data format expected by the log rules. After collecting the data, the data is uniformly sent to the message queue to use the message queue as a component of message communication to orderly transmit the data to the next receiving device. It can be understood that the data source of the collected data can include a variety of different data sources such as web (webpage), file (file) or Kafka (belonging to the message queue), wherein the message queue can be used as a component of message communication. In this embodiment, the collected data are uniformly sent to the message queue, which can ensure that the collected data is output to the next receiving device smoothly and orderly.
[0061] Further, in step S10, the log rules are obtained, data is collected according to the log rules, and the data is sent to the message queue, which specifically includes the following steps:
[0062] S11: providing a multi-data source access service through a pre-established configuration service center, wherein the pre-established configuration service center is operated in the form of a front-end interface.
[0063] Among them, the configuration service center (config server) is an application in the microservice architecture, which can uniformly configure and manage different project environments, including the unified management of different types of data. In one embodiment, the operation of configuration services can be provided on the front-end interface (such as a web page), and users can adapt to different access data sources by performing unified configuration of data in the pre-established configuration center. It can be understood that the existing data collection practices generally implement the configuration of different access data sources by modifying the configuration file. This practice can only receive data from a single source, for example, it can only receive data from one of the data sources of web, file or Kafka, and each change of access to different data sources requires a cumbersome process. In one embodiment, by setting up a web service with the function of a configuration service center, simultaneous access to multiple data sources can be achieved based on the unified configuration management of the user in the configuration service center.
[0064] S12: Obtain the log rules input by the user through the front-end interface, collect data from multiple data sources according to the log rules and the services accessed by multiple data sources, and send the data to Kafka.
[0065] Among them, Kafka is a high-throughput distributed publish-subscribe messaging system that can unify online and offline message processing and provide real-time messages through clusters.
[0066] In one embodiment, the user can also obtain log rules through the front-end interface. The data processing system based on the Flume data center will collect data from different data sources according to the log rules and the multi-data access services provided by the configuration service center, and send the collected data to Kafka to use Kafka to achieve high-throughput, distributed data processing functions and transmit the data to the next receiving device.
[0067] In steps S11-S12, the services of multi-data source access are implemented through the pre-established configuration service center, and the log rules entered by the user in the front-end interface are used to realize the diversification of data source access, and the unified configuration management of data collection is implemented, which effectively improves the efficiency of data collection.
[0068] S20: Input data into the distributed data platform through the message queue, wherein the distributed data platform includes a master device and multiple distributed clusters. Each distributed cluster includes multiple slave devices as proxy nodes of the distributed cluster. The distributed data platform is implemented based on Flume.
[0069] Among them, the data middle platform refers to the technology that uses data technology to collect, calculate, store, and process massive data to form a big data asset layer, thereby providing customers with efficient services. Flume is a highly available, highly reliable, distributed system for massive log collection, aggregation, and transmission provided by Cloudera. Flume generally exists in a cluster.
[0070] In one embodiment, the distributed data middle station is established based on the Flume framework and has the advantages of the current Flume cluster. Different from the prior art, this embodiment sets the distributed data middle station as a master-slave device architecture. In the distributed data middle station, a master device and multiple slave devices are included, wherein the slave devices build multiple distributed clusters, and a distributed cluster includes at least two slave devices. The slave device acts as a proxy node of the distributed cluster. It can be understood that the master device and the slave device can specifically refer to electronic devices such as computers, mobile phones, and tablets. The master device is connected to each proxy node as the root node of the distributed data middle station to monitor each proxy node in real time, providing a technical basis for the realization of different output methods of subsequent data.
[0071] S30: Output the data from the distributed data center to the storage medium.
[0072] In one embodiment, the traditional Flume cluster data is output to a single storage medium (eg, file / hdfs / kafka, etc.). The data receiving device of the storage medium needs to write different call interfaces for different data to achieve data output.
[0073] Furthermore, in step S30, the data is output from the distributed data center to the storage medium, which specifically includes the following steps:
[0074] S31: Provide a unified data interface through a pre-established data service center.
[0075] In view of the differences in storage media for different data, a data service center (dataserver) is used in this embodiment to replace the traditional method of individually writing different interfaces to retrieve data. The pre-established data service center is specifically implemented using a daemon method to provide a unified interface for data access to the outside world. The data service center is a web service that interacts through the HTTP protocol. The user requests data through the HTTP API, and the service provider returns after background processing. Among them, a daemon is a special process that runs in the background and is used to perform specific system tasks. In one embodiment, a daemon method is used in the background to allow the data receiving device to interact based on the HTTP protocol, and request data through a unified interface for data access provided to the outside world, so as to uniformly output the data to the storage medium.
[0076] S32: According to the unified data interface, the data is output from the distributed data middle platform to the same non-volatile storage medium.
[0077] In one embodiment, the storage medium uses a non-volatile storage medium, such as HDFS (Hadoop Distributed File System). HDFS is a permanent storage medium, which is different from file and Kafka. HDFS has high availability and multi-replica set storage functions, and can provide data storage security.
[0078] In steps S31-S32, unified data output is achieved through a pre-established data service center, which can significantly improve the efficiency of data processing.
[0079] S40: In the process of data output from the distributed data middle platform to the storage medium, the master device adopts the master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables the backup service process according to the real-time status, outputs data based on the backup service process, or, according to the real-time status, outputs data in a balanced manner.
[0080] Among them, the heartbeat mechanism is a mechanism that sends a custom structure (heartbeat packet) at a fixed time to let other devices know that it is still online to ensure the validity of the connection.
[0081] Among them, real-time status refers to parameter data that can reflect the performance of the equipment.
[0082] It can be understood that each proxy node may correspond to a data access service process, and different proxy nodes jointly implement distributed data processing (data access, data output).
[0083] In one embodiment, the distributed data center uses a heartbeat mechanism as the basis to achieve communication between master and slave devices. It can be understood that the use of the heartbeat mechanism can better detect device anomalies, timely alarm and prompt repair, and can effectively improve the stability of device operation. It should be noted that the heartbeat mechanism used by the distributed data center is not only used to detect whether the connection between devices is valid, but also used to transmit the real-time status of the slave device to the master device, so that the master device can determine the data output method according to the real-time status of the service process in the proxy node.
[0084] Further, in step S40, in the process of outputting data from the distributed data center to the storage medium, the master device uses the master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, which specifically includes the following steps:
[0085] S411: The proxy node periodically sends heartbeat information to the master device, wherein the heartbeat information includes memory occupancy rate and central processing unit occupancy rate.
[0086] In one embodiment, the proxy node will send heartbeat information to the master device after a period of time. Specifically, the transmission of heartbeat information between the master and slave devices can be achieved through ZeroMQ message queues, etc., which can ensure that the heartbeat information is transmitted stably and accurately.
[0087] Furthermore, in addition to the heartbeat packet used to detect whether the device is online, the heartbeat information also includes parameter data reflecting the performance of the slave device, such as memory usage and central processing unit (CPU) usage. It can be understood that through the architecture of the master-slave device and the heartbeat mechanism, the master device can detect the performance utilization of each proxy node (slave device) in near real time to determine the data output method to be adopted.
[0088] S412: The master device determines the real-time status of the service process in the proxy node according to the heartbeat information.
[0089] It can be understood that the heartbeat information includes parameter data reflecting the performance of the slave device, such as memory occupancy rate and central processing unit occupancy rate, and the master device can determine the real-time status of the service process in the proxy node based on these parameter data.
[0090] S413: When the memory occupancy rate of the service process in the proxy node exceeds a first preset threshold or the CPU occupancy rate exceeds a second preset threshold, determining that the real-time status of the service process in the proxy node is overloaded.
[0091] It can be understood that in the distributed data center based on Flume, the performance utilization rates of different slave devices are different. At the same time, slave device A may be in an overloaded state, while slave device B is in an overloaded state. Specifically, when the service process memory occupancy rate in the proxy node exceeds the first preset threshold or the CPU occupancy rate exceeds the second preset threshold, it is considered that the proxy node is under great pressure and is in a real-time overload state.
[0092] S414: When the memory occupancy rate of the service process in the proxy node is lower than the third preset threshold or the CPU occupancy rate is lower than the fourth preset threshold, determining that the real-time status of the service process in the proxy node is overloaded.
[0093] It can be understood that when the service process memory occupancy rate in the proxy node is lower than the third preset threshold or the CPU occupancy rate is lower than the fourth preset threshold, it is considered that the operating pressure of the proxy node is relatively small and is in a real-time state of excessive load.
[0094] Understandably, too much load or excessive load is not good. Too much load means that the service process is at risk of crashing, and backup is recommended at this time. Excessive load means that resources are not used fully and are wasted.
[0095] In steps S411-S414, the real-time status of the proxy node is determined based on parameter data reflecting the performance of the slave device, such as memory occupancy rate and central processing unit occupancy rate, so as to select a data output method according to the real-time status of each proxy node.
[0096] Further, in step S40, the standby service process is enabled according to the real-time status, and data is output based on the standby service process, or data is output in a data balancing manner according to the real-time status, which specifically includes the following steps:
[0097] S41: when the real-time status of the service process in the proxy node is overloaded, and there is no standby service process in the service process in the proxy node, the standby service process is enabled, and data is output based on the standby service process;
[0098] Understandably, the data center in the prior art obtains data by directly connecting the process to the data source. When a process exits abnormally, the data center cannot issue an alarm or repair in time, which easily leads to data loss. Therefore, in the process of data processing implemented by the data center, in order to ensure that data is not lost, the same copy of data is implemented in the service process of the data center, that is, the backup service process is enabled.
[0099] In one embodiment, whether the proxy node enables the backup service process is not a rigid requirement. When the real-time status of the service process in the proxy node is overloaded, the proxy node will detect whether there is a backup service process in its service process. If not, given that the overload may cause the service process to crash and cause data loss, this embodiment will enable the backup service process and output data under the protection of the data backup of the enabled backup service process. It can be understood that the backup service process occupies storage space and has no significant impact on the occupancy rate of the memory and CPU, and can maintain the security and stability of data transmission in the real-time state of the proxy node being overloaded.
[0100] S42: When the real-time status of the service process in the proxy node is overloaded and the message queue adopts Kafka, data is output in a data balancing manner according to the Kafka group id.
[0101] Among them, outputting data in a balanced manner according to the Kafka group id is a mechanism for Kafka data output. In this embodiment, the Kafka group id can be used to output data strictly according to the Kafka group id without enabling the backup service process, thereby ensuring the integrity and stability of the data. When the real-time status of the service process in the proxy node is overloaded, part of the performance can be sacrificed, and data can be output strictly in batches according to the Kafka group id, which can significantly reduce the storage pressure of the storage space, while also ensuring that the data is output accurately and orderly.
[0102] Understandably, as the performance of hardware devices improves, the real-time status of devices is generally overloaded. In the architecture of a distributed cluster, since different proxy nodes back up service processes, it will cause a large amount of data redundancy (the amount of data collected today is relatively large), resulting in a waste of storage space. By adopting the data balancing landing method of this embodiment, it is possible to ensure the integrity and stability of data without using a backup service process, freeing up storage space.
[0103] In steps S41-S42, different data output modes are adopted according to the two real-time states of overload and excess load, so as to increase the storage space as much as possible under the premise of ensuring accurate data transmission.
[0104] In one embodiment, the system architecture diagram of data processing based on Flume data center is as follows: Figure 2 shown.
[0105] from Figure 2As can be seen in the figure, in the scenario of multiple source data access provided by the configuration service center, data from different data sources can be received, and the data can be converted into a unified format according to (log rules) and sent to Kafk. After receiving data from different data sources, the distributed data access process will be implemented through the HA high-availability cluster (composed of at least two agent nodes), and each AGENT agent node corresponds to a data access process. Among them, in the data access process, the HA high-availability cluster adopts the heartbeat mechanism of the master-slave device, which can detect the status of the service process in real time, ensure that the anomaly is notified in time, and start the backup process in time to prevent data loss. Finally, a unified data acquisition interface will be provided according to the data configuration center, which can realize data retrieval without considering the differences in storage media and writing different interfaces separately. The embodiment of the present invention simplifies the complexity of data source access and unifies the data format by configuring services; standardizes the data retrieval interface by means of data services, shields the differences in storage media, and significantly reduces the difficulty of data analysis development processes; through the heartbeat mechanism, the real-time data middle platform based on the Flume architecture can better detect anomalies, issue alarms and prompt repairs in a timely manner, and effectively improve the stability of equipment operation; through the deployment method of kafka group id, the storage space of storage media such as HDFS is greatly reduced.
[0106] In an embodiment of the present invention, log rules are first obtained, data is collected according to the log rules, and the data is sent to a message queue, so that the collected data can be output to the next receiving device in an orderly and uniform format; then the data is input into a distributed data middle station through a message queue, wherein the distributed data middle station includes a master device and multiple distributed clusters, each distributed cluster includes multiple slave devices, and as a proxy node of the distributed cluster, the distributed data middle station is implemented based on Flume. On the premise of having the advantages of the Flume cluster, the master device is connected to each proxy node as the root node of the distributed data middle station to monitor each proxy node in real time, which provides a technical basis for the implementation of different output methods of subsequent data; finally, the data is output from the distributed data middle station to a storage medium, wherein, in the process of outputting data from the distributed data middle station to the storage medium, the master device adopts a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables the backup service process according to the real-time status, outputs data based on the backup service process, or, according to the real-time status, outputs data in a data balanced landing manner, which can determine the data output method according to the real-time status of the service process in the proxy node, thereby effectively reducing the occupancy rate of the storage space.
[0107] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0108] Based on the data processing method based on Flume data center provided in the embodiment, the embodiment of the present invention further provides a device embodiment for implementing each step and method in the above method embodiment.
[0109] Figure 3 The principle block diagram of the data processing device based on the Flume data center station is shown in one-to-one correspondence with the data processing method based on the Flume data center station in the embodiment. Figure 3 As shown, the data processing device based on the Flume data center station includes a first processing module 10, a second processing module 20, a third processing module 30 and a fourth processing module 40. Among them, the implementation functions of the first processing module 10, the second processing module 20, the third processing module 30 and the fourth processing module 40 correspond one to one with the steps corresponding to the data processing method based on the Flume data center station in the embodiment. To avoid redundancy, this embodiment will not be described in detail one by one.
[0110] The first processing module 10 is used to obtain log rules, collect data according to the log rules, and send the data to a message queue.
[0111] The second processing module 20 is used to input data into the distributed data middle platform through the message queue, wherein the distributed data middle platform includes a master device and multiple distributed clusters, each distributed cluster includes multiple slave devices as proxy nodes of the distributed cluster, and the distributed data middle platform is implemented based on Flume.
[0112] The third processing module 30 is used to output data from the distributed data center to the storage medium.
[0113] The fourth processing module 40 is used for the process of outputting data from the distributed data middle station to the storage medium. The master device adopts the master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables the backup service process according to the real-time status, outputs data based on the backup service process, or outputs data in a data balanced landing manner according to the real-time status.
[0114] Further, the fourth processing module 40 includes:
[0115] The first subunit is used for the proxy node to periodically send heartbeat information to the main device, wherein the heartbeat information includes memory occupancy rate and central processing unit occupancy rate;
[0116] The second subunit is used for the master device to determine the real-time status of the service process in the proxy node according to the heartbeat information;
[0117] A third subunit is used to determine that the real-time state of the service process in the proxy node is overloaded when the memory occupancy rate of the service process in the proxy node exceeds a first preset threshold or the CPU occupancy rate exceeds a second preset threshold;
[0118] The fourth subunit is used to determine that the real-time status of the service process in the proxy node is overloaded when the memory occupancy rate of the service process in the proxy node is lower than the third preset threshold or the CPU occupancy rate is lower than the fourth preset threshold.
[0119] Furthermore, the fourth processing module 40 further includes:
[0120] A fifth subunit is used for activating a backup service process and outputting data based on the backup service process when the real-time status of the service process in the proxy node is overloaded and there is no backup service process in the service process in the proxy node;
[0121] The sixth subunit is used to output data in a balanced manner according to the Kafka group id when the real-time status of the service process in the proxy node is overloaded and the message queue adopts Kafka.
[0122] Furthermore, the first processing module 10 includes:
[0123] A seventh subunit is used to provide a multi-data source access service through a pre-established configuration service center, wherein the pre-established configuration service center is operated in a front-end interface manner;
[0124] The eighth subunit obtains the log rules input by the user through the front-end interface, collects data from multiple data sources according to the log rules and the services accessed by multiple data sources, and sends the data to Kafka.
[0125] Further, the third processing module 30 includes:
[0126] The ninth subunit is used to provide a unified data interface through a pre-established data service center;
[0127] The tenth sub-unit is used to output data from the distributed data middle platform to the same non-volatile storage medium according to the unified data interface.
[0128] In an embodiment of the present invention, log rules are first obtained, data is collected according to the log rules, and the data is sent to a message queue, so that the collected data can be output to the next receiving device in an orderly and uniform format; then the data is input into a distributed data middle station through a message queue, wherein the distributed data middle station includes a master device and multiple distributed clusters, each distributed cluster includes multiple slave devices, and as a proxy node of the distributed cluster, the distributed data middle station is implemented based on Flume. On the premise of having the advantages of the Flume cluster, the master device is connected to each proxy node as the root node of the distributed data middle station to monitor each proxy node in real time, which provides a technical basis for the implementation of different output methods of subsequent data; finally, the data is output from the distributed data middle station to a storage medium, wherein, in the process of outputting data from the distributed data middle station to the storage medium, the master device adopts a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables the backup service process according to the real-time status, outputs data based on the backup service process, or, according to the real-time status, outputs data in a data balanced landing manner, which can determine the data output method according to the real-time status of the service process in the proxy node, thereby effectively reducing the occupancy rate of the storage space.
[0129] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data processing method based on the Flume data center in the embodiment is implemented. To avoid repetition, it is not described here one by one. Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the data processing device based on the Flume data center in the embodiment are implemented. To avoid repetition, it is not described here one by one.
[0130] Figure 4 Schematic diagram of a computer device provided by an embodiment of the present invention. Figure 4 As shown, the computer device 50 of this embodiment includes: a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and executable on the processor 51. When the computer program 53 is executed by the processor 51, the data processing method based on the Flume data center in the embodiment is implemented. To avoid repetition, it is not described one by one here. Alternatively, when the computer program 53 is executed by the processor 51, the functions of each model / unit in the data processing device based on the Flume data center in the embodiment are implemented. To avoid repetition, it is not described one by one here.
[0131] The computer device 50 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 50 may include, but is not limited to, a processor 51 and a memory 52. Those skilled in the art will appreciate that Figure 4This is only an example of the computer device 50 and does not constitute a limitation of the computer device 50. The computer device 50 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0132] The processor 51 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0133] The memory 52 may be an internal storage unit of the computer device 50, such as a hard disk or memory of the computer device 50. The memory 52 may also be an external storage device of the computer device 50, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 50. Further, the memory 52 may also include both an internal storage unit of the computer device 50 and an external storage device. The memory 52 is used to store computer programs and other programs and data required by the computer device. The memory 52 may also be used to temporarily store data that has been output or is to be output.
[0134] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0135] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A data processing method based on Flume data center, characterized in that: The method comprises: Obtain log rules, collect data according to the log rules, and send the data to a message queue; The data is input into a distributed data platform through the message queue, wherein the distributed data platform includes a master device and multiple distributed clusters, each of the distributed clusters includes multiple slave devices as proxy nodes of the distributed clusters, and the distributed data platform is implemented based on Flume; Outputting the data from the distributed data center to a storage medium; Wherein, in the process of outputting the data from the distributed data middle platform to the storage medium, the master device adopts a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables a backup service process according to the real-time status, and outputs the data based on the backup service process, or, according to the real-time status, outputs the data in a data balanced landing manner; In the process of outputting the data from the distributed data center to the storage medium, the master device uses a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, including: The proxy node periodically sends heartbeat information to the master device, wherein the heartbeat information includes memory occupancy rate and central processing unit occupancy rate; The master device determines the real-time status of the service process in the proxy node according to the heartbeat information; The enabling of the standby service process according to the real-time status and outputting the data based on the standby service process, or outputting the data in a data balanced manner according to the real-time status, includes: When the real-time status of the service process in the proxy node is overloaded, and the service process in the proxy node does not have the standby service process, enabling the standby service process, and outputting the data based on the standby service process; When the real-time status of the service process in the proxy node is overloaded and the message queue adopts Kafka, the data is output in a data balancing manner according to the Kafka group id; The obtaining of log rules, collecting data according to the log rules, and sending the data to a message queue includes: A multi-data source access service is provided through a pre-established configuration service center, wherein the pre-established configuration service center is operated in the form of a front-end interface.
2. The method according to claim 1, characterized in that In the process of outputting the data from the distributed data center to the storage medium, the master device uses a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node. After the master device determines the real-time status of the service process in the proxy node according to the heartbeat information, the method further includes: When the memory occupancy rate of the service process in the proxy node exceeds a first preset threshold or the CPU occupancy rate exceeds a second preset threshold, determining that the real-time state of the service process in the proxy node is overloaded; When the memory occupancy rate of the service process in the proxy node is lower than the third preset threshold or the CPU occupancy rate is lower than the fourth preset threshold, it is determined that the real-time status of the service process in the proxy node is overloaded.
3. The method according to claim 1, characterized in that The method further comprises: obtaining log rules, collecting data according to the log rules, and sending the data to a message queue, and after providing a service of accessing multiple data sources through a pre-established configuration service center, the method further comprises: The log rule input by the user is obtained through the front-end interface, the data is collected from multiple data sources according to the log rule and the service accessed by the multiple data sources, and the data is sent to Kafka.
4. The method according to any one of claims 1 to 3, characterized in that: The step of outputting the data from the distributed data platform to a storage medium includes: Provide a unified data interface through a pre-built data service center; According to the unified data interface, the data is output from the distributed data center to the same non-volatile storage medium.
5. A data processing device based on Flume data center, characterized in that: The device comprises: A first processing module, used for obtaining log rules, collecting data according to the log rules, and sending the data to a message queue; A second processing module is used to input the data into a distributed data middle station through the message queue, wherein the distributed data middle station includes a master device and multiple distributed clusters, each of the distributed clusters includes multiple slave devices as proxy nodes of the distributed clusters, and the distributed data middle station is implemented based on Flume; A third processing module, used to output the data from the distributed data middle station to a storage medium; A fourth processing module is used for, in the process of outputting the data from the distributed data middle platform to the storage medium, the master device adopts a master-slave heartbeat mechanism to detect the real-time status of the service process in the proxy node, and enables a backup service process according to the real-time status, and outputs the data based on the backup service process, or, according to the real-time status, outputs the data in a data balanced landing manner; The fourth processing module comprises: A first subunit is used for the proxy node to periodically send heartbeat information to the master device, wherein the heartbeat information includes memory occupancy rate and central processing unit occupancy rate; A second subunit is used for the main device to determine the real-time status of the service process in the proxy node according to the heartbeat information; The fourth processing module further includes: a fifth subunit, configured to enable the standby service process and output the data based on the standby service process when the real-time status of the service process in the proxy node is overloaded and the standby service process does not exist in the service process in the proxy node; A sixth subunit is used for outputting the data in a data balancing manner according to a Kafka group id when the real-time status of the service process in the proxy node is overloaded and the message queue adopts Kafka; The obtaining of log rules, collecting data according to the log rules, and sending the data to a message queue includes: A multi-data source access service is provided through a pre-established configuration service center, wherein the pre-established configuration service center is operated in the form of a front-end interface.
6. The device according to claim 5, characterized in that The fourth processing module further includes: A third subunit is used to determine that the real-time state of the service process in the proxy node is overloaded when the memory occupancy rate of the service process in the proxy node exceeds a first preset threshold or the CPU occupancy rate exceeds a second preset threshold; The fourth subunit is used to determine that the real-time status of the service process in the proxy node is overloaded when the memory occupancy rate of the service process in the proxy node is lower than the third preset threshold or the CPU occupancy rate is lower than the fourth preset threshold.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the data processing method based on the Flume data center as described in any one of claims 1 to 4 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the data processing method based on the Flume data center are implemented as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Data real-time processing method, device and equipment and storage medium
CN111125161A
Distributed data monitoring device
US20190138410A1
