Data processing method and device based on flume system, computer equipment and storage medium

Through the interception of the Interceptor component and the preset consumption mechanism of the Sink component, MemoryChannel and expansion components are used to achieve high throughput and data reliability in the flume system, solving the contradiction between throughput and data loss in the traditional flume system, and improving data Processing efficiency and reliability.

CN118535093APending Publication Date: 2024-08-23E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410646606.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

It is difficult for traditional flume systems to achieve both high throughput and no data loss, especially when disk I/O occurs frequently, resulting in reduced throughput.

Method used

Use the Interceptor component to intercept the target event pushed by the Source component to the Channel component, and obtain the event length and remaining capacity. If the capacity is sufficient, it will be pushed in the memory Channel and backed up to the target storage system. If it is insufficient, it will be stored in the expansion component. The Sink component will follow the preset The consumption mechanism reads and stores data from the appropriate components.

Benefits of technology

On the premise of retaining the high throughput characteristics of MemoryChannel, the backup component and expansion component are used to solve the problems of data loss and limited space, improving the throughput, fault tolerance and reliability of the flume system in the process of massive data collection, transmission and persistence. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535093A
    Figure CN118535093A
Patent Text Reader

Abstract

The invention provides a data processing method and device based on a flume system, computer equipment and a storage medium. The method comprises the following steps: intercepting a target event pushed to a Channel component by a Source component through an Interceptor component, obtaining the length of the target event and determining the residual capacity of the Channel component; the type of the Channel component is a Memory Channel, and the type of the Channel component is a Memory Channel; under the condition that the residual capacity is greater than or equal to the length of the target event, pushing the target event to a Channel component, and synchronizing the target event to a backup component of the target storage system; otherwise, storing the target event in a capacity expansion component of the target storage system; and selecting a target component from the Channel component, the backup component or the capacity expansion component through the Sink component according to a preset consumption mechanism, reading data from the target component, and storing the data to a preset destination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology, and in particular to a data processing method, device, computer equipment and storage medium based on a flume system. Background Art

[0002] Flume is a tool for data collection, transmission and loading, and is usually used to transfer data from multiple sources to the target system. Flume has four core components, namely Source component, Interceptor component, Channel component and Sink component. Among them, the Channel component has a variety of different working mechanisms. In order to prevent data loss due to unexpected situations such as process loss, machine shutdown or crash, the Channel component is generally set to the FileChannel mechanism in traditional technology. Under this mechanism, all events are written to disk, so there is no data loss. However, because the use of disk storage will frequently cause disk I / O, this solution will greatly reduce the throughput of Flume. Therefore, it is difficult for the Flume system in traditional technology to take into account both high throughput and data loss. Summary of the invention

[0003] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the problem that the flume system in traditional technology is difficult to achieve both high throughput and data loss-free characteristics.

[0004] In a first aspect, the present application provides a data processing method based on a flume system, comprising:

[0005] The Interceptor component intercepts the target event pushed by the Source component to the Channel component, obtains the length of the target event and determines the remaining capacity of the Channel component; the type of the Channel component is MemoryChannel;

[0006] When the remaining capacity is greater than or equal to the length of the target event, the target event is pushed to the Channel component and synchronized to the backup component of the target storage system;

[0007] Otherwise, the target event is stored in the expansion component of the target storage system;

[0008] The Sink component selects the target component from the Channel component, backup component or expansion component according to the preset consumption mechanism, reads data from the target component and stores it to the preset destination.

[0009] In one embodiment, a target component is selected from a Channel component, a backup component, or an expansion component according to a preset consumption mechanism by a Sink component, and data is read from the target component and stored in a preset destination, including:

[0010] When the remaining capacity is greater than or equal to the length of the target event and the Flume system is in a normal state, the Channel component is selected as the target component through the Sink component;

[0011] The Sink component reads data from the Channel component, stores the read data in a preset destination, and deletes the data in the backup component corresponding to the data successfully stored in the preset destination.

[0012] In one embodiment, a target component is selected from a Channel component, a backup component, or an expansion component according to a preset consumption mechanism by a Sink component, and data is read from the target component and stored in a preset destination, including:

[0013] When the remaining capacity is greater than or equal to the length of the target event and the Flume system is in a faulty state, the backup component is selected as the target component through the Sink component;

[0014] The data is read from the backup component through the Sink component, and the read data is stored in a preset destination, and the data in the backup component corresponding to the data successfully stored in the preset destination is deleted.

[0015] In one embodiment, a target component is selected from a Channel component, a backup component, or an expansion component according to a preset consumption mechanism by a Sink component, and data is read from the target component and stored in a preset destination, including:

[0016] When the remaining capacity is less than the length of the target event, the expansion component is selected as the target component through the Sink component;

[0017] The data is read from the expansion component through the Sink component, and the read data is stored in the preset destination, and the data in the expansion component corresponding to the data successfully stored in the preset destination is deleted.

[0018] In one embodiment, determining the remaining capacity of a Channel component includes:

[0019] The current length of the backup component is obtained through the Interceptor component, and the remaining capacity is obtained based on the preset capacity upper limit and the current length of the backup component.

[0020] In one embodiment, the Sink component is custom configured by following the steps below:

[0021] Inherit the native AbstractSink class and Configurable interface of the Flume system;

[0022] In the configure method, write the connection information of the target storage system and the preset destination;

[0023] In the start method, write the connection instruction to connect the target storage system and the preset destination;

[0024] Write the preset consumption mechanism in the process method.

[0025] In one of the embodiments, the target storage system is a redis cluster.

[0026] In one embodiment, the preset destination is a clickhouse system.

[0027] In a second aspect, the present application provides a data processing device based on a flume system, comprising:

[0028] The interception module is used to intercept the target event pushed by the Source component to the Channel component through the Interceptor component, and obtain the length of the target event and determine the remaining capacity of the Channel component;

[0029] The type of the Channel component is MemoryChannel;

[0030] A first processing module, configured to push the target event to the Channel component and synchronize the target event to the backup component of the target storage system when the remaining capacity is greater than or equal to the length of the target event;

[0031] A second processing module, configured to store the target event in the expansion component of the target storage system when the remaining capacity is less than the length of the target event;

[0032] The consumption module is used to select the target component from the Channel component, backup component or expansion component through the Sink component according to the preset consumption mechanism, and read data from the target component and store it to the preset destination.

[0033] In a third aspect, the present application provides a computer device, including one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the data processing method based on the flume system in any of the above embodiments are executed.

[0034] In a fourth aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the data processing method based on the flume system in any of the above embodiments.

[0035] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0036] Based on the data processing method in this embodiment, the target event pushed by the Source component to the Channel component is intercepted by the Interceptor component, the length of the event is obtained, and the remaining capacity of the Channel component is determined. If the remaining capacity of the Channel component is sufficient to accommodate the event, the event is directly pushed to the memory Channel component, and the event is synchronized to the backup component of the target storage system to achieve data backup. If the remaining capacity of the Channel component is insufficient, the event is stored in the expansion component of the target storage system, which is equivalent to realizing a larger data buffer. Finally, the Sink component will select the appropriate target component from the Channel component, backup component or expansion component in an orderly manner according to the preset consumption mechanism, read the event data and store it in the preset destination. Under the premise of retaining the high throughput characteristics of MemoryChannel, the data processing method solves the problems of data loss and limited space under this mechanism through the backup component and expansion component in the target storage system, and comprehensively improves the throughput, fault tolerance and reliability of the Flume system in the process of massive data collection, transmission and persistence. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0038] Figure 1 A flow chart of a data processing method based on a flume system provided in one embodiment of the present application;

[0039] Figure 2 A schematic diagram of data flow of a data processing method based on a flume system in one embodiment of the present application;

[0040] Figure 3 A schematic diagram of a module of a data processing device based on a flume system provided in one embodiment of the present application;

[0041] Figure 4 An internal structure diagram of a computer device provided for one embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0043] The flume system includes four major components, namely, the Source component, the Interceptor component, the Channel component and the Sink component. Among them, the Source component is used for data collection and transmits the data to the Channel component in the form of events. The specific type of data collected by the Source component can be set as needed, but the flume system is generally used to process massive logs, so the data collected by the Source component is generally log data. The Channel component is a data buffer for temporarily storing events pushed by the Source component. The Interceptor component is set between the Source component and the Channel component. Before the event is written to the Channel component, the Interceptor component can convert or delete these events according to the configured logic. The Sink component is used to extract the event and finally store it in a specified location. In the traditional solution, the Channel component is set to work under the FileChannel mechanism, which backs up the event to the disk when it enters the Channel component, but this method will frequently cause disk I / O, thereby affecting the throughput of the flume system. In order to solve this problem, the present application proposes a data processing method based on the flume system, which includes steps S102 to S102 to S108.

[0044] S102, intercepting the target event pushed by the Source component to the Channel component through the Interceptor component, and obtaining the length of the target event and determining the remaining capacity of the Channel component. The type of the Channel component is MemoryChannel.

[0045] It can be understood that the target event refers to the event that is about to enter the Channel component from the Source component. The Interceptor component can process the event before it enters the Channel component, and the processing that the Interceptor component needs to perform in this embodiment includes determining the length (size) of the target event and determining the remaining capacity of the Channel component. The length of the target event reflects the amount of storage space occupied by the target event, and the remaining capacity of the Channel component refers to the total amount of data that the Channel component can still accommodate. In traditional solutions, Channel usually uses FileChannel to write events directly to disk files. However, frequent disk IO will reduce system throughput, and the Channel component in this embodiment will use the MemoryChannel mechanism, which will store events in memory and can significantly improve performance. However, due to limited memory space, different processing methods need to be selected according to the amount of data that needs to be written. Specifically, when the remaining capacity is greater than or equal to the length of the target event, step S104 will be entered. Otherwise, step S106 will be entered.

[0046] The way to obtain the length of the target event is to add relevant acquisition logic in the process() method of the Interceptor component. For example, for each event sent from the Source component, it will contain the event header information and data body as an Event object. The event body can be obtained through the Event.getBody() method, which returns a ByteBuffer object. Then, the remaining() method of ByteBuffer can be called to obtain the byte size of the data body, that is, the event length. For List structure events, you can also directly use the .size command to obtain the event length.

[0047] S104: When the remaining capacity is greater than or equal to the length of the target event, the target event is pushed to the Channel component, and the target event is synchronized to the backup component of the target storage system.

[0048] It can be understood that when the Channel component has enough remaining capacity to accommodate the target event, the target event can be pushed directly to the Channel component, thereby avoiding disk IO and improving efficiency. However, since the Channel component under this mechanism does not have the characteristic of preventing data loss, it is necessary to back up the target event. In this embodiment, the data in the Channel component is backed up by synchronously saving the Channel component in another system outside the flume system. When the flume system fails, the other system is independent of the flume system and is not affected, thereby ensuring that the data in the Channel component will not be lost. The other system is the target storage system, and the backup of the Channel component in the target storage system is the backup component. When the flume system fails, the Sink component can continue to pull data from the backup component for consumption. The selection of the target storage system can be determined according to actual needs. Specifically, in order to further improve throughput, the target storage system can also use a memory-based storage system, such as a redis cluster.

[0049] S106: When the remaining capacity is smaller than the length of the target event, the target event is stored in the expansion component of the target storage system.

[0050] It is understandable that when the remaining capacity of the Channel component is insufficient to accommodate new target events, the event needs to be temporarily stored elsewhere to avoid data loss. The concept of expansion components is introduced here, that is, to recreate a storage space in the target storage system to store data that the Channel component cannot accommodate. The existence of expansion components solves the problem of limited storage space caused by the MemoryChannel mode. The Sink component can directly consume data that the Channel component cannot accommodate from the expansion component.

[0051] S108, select a target component from the Channel component, the backup component or the expansion component according to the preset consumption mechanism through the Sink component, read data from the target component and store it to the preset destination.

[0052] It can be understood that the Sink component, as the outlet of the Flume system, needs to pull event data from various temporary storage components and store it in a pre-specified final destination. Since the data may be stored in a dispersed manner in the Channel component, the backup component, and the expansion component. Therefore, this embodiment presupposes a consumption mechanism, which determines the way in which the Sink component selects one of the Channel component, the backup component, and the expansion component as the target component in various cases, so that the Sink component can pull data from the target component and store it in the preset destination. Due to the existence of the Channel component, the backup component, and the expansion component, the preset consumption mechanism can ensure that data will not be lost in various unexpected situations, and selecting the Channel component as the MemoryChannel mechanism can also improve the throughput of the system, and better realize the efficient collection, transmission and persistence of massive data.

[0053] Based on the data processing method in this embodiment, the target event pushed by the Source component to the Channel component is intercepted by the Interceptor component, the length of the event is obtained, and the remaining capacity of the Channel component is determined. If the remaining capacity of the Channel component is sufficient to accommodate the event, the event is directly pushed to the memory Channel component, and the event is synchronized to the backup component of the target storage system to achieve data backup. If the remaining capacity of the Channel component is insufficient, the event is stored in the expansion component of the target storage system, which is equivalent to realizing a larger data buffer. Finally, the Sink component will select the appropriate target component from the Channel component, backup component or expansion component in an orderly manner according to the preset consumption mechanism, read the event data and store it in the preset destination. Under the premise of retaining the high throughput characteristics of MemoryChannel, the data processing method solves the problems of data loss and limited space under this mechanism through the backup component and expansion component in the target storage system, and comprehensively improves the throughput, fault tolerance and reliability of the Flume system in the process of massive data collection, transmission and persistence.

[0054] The preset consumption mechanism specifies under what circumstances which component needs to be selected as the target component, and also specifies the data synchronization method between the components. The following embodiments will respectively illustrate the specific situation of selecting the Channel component, the backup component and the expansion component as the target component.

[0055] In one embodiment, a target component is selected from a Channel component, a backup component, or an expansion component according to a preset consumption mechanism by a Sink component, and data is read from the target component and stored in a preset destination, including:

[0056] (1) When the remaining capacity is greater than or equal to the length of the target event and the Flume system is in a normal state, the Channel component is selected as the target component through the Sink component.

[0057] It can be understood that the Channel component, as a data buffer, can provide efficient data reading and writing capabilities. When the Channel component has enough remaining capacity, the Source component can push events directly to the Channel component to reduce disk IO overhead. If the Flume system is in a normal state, the Sink component can pull data from the Channel component normally, which is also the most efficient data path. Therefore, the condition for the Sink component to select the Channel component as the target component is that the remaining capacity of the Channel component is greater than or equal to the length of the target event and the Flume system is in a normal state.

[0058] (2) Read data from the Channel component through the Sink component, store the read data in a preset destination, and delete the data in the backup component corresponding to the data successfully stored in the preset destination.

[0059] It can be understood that when the Sink component reads the event data from the Channel component, it needs to persist the data to the preset destination. This process usually includes operations such as data format conversion, compression, and batch writing to improve transmission and storage efficiency. After the data is persisted, in order to avoid wasting storage space, this part of the data needs to be deleted. The native Channel component includes a mechanism for deleting successfully persisted event data, but the backup component does not. Therefore, it is necessary to synchronously delete the event data that has been successfully stored in the backup component. The process of deleting backup data is generally: the Sink component records the event header (Header) of the successfully stored event and then locates and deletes the copy data with the same event header through the interface provided by the target storage system.

[0060] Furthermore, when the Channel component is synchronized with the backup component, the length of the files stored in the backup component and the Channel component are the same. You can directly obtain the length of the backup component, which is equivalent to obtaining the length of the Channel component. Subtracting the length from the preset capacity limit can get the remaining capacity of the backup component.

[0061] In one embodiment, a target component is selected from a Channel component, a backup component, or an expansion component according to a preset consumption mechanism by a Sink component, and data is read from the target component and stored in a preset destination, including:

[0062] (1) When the remaining capacity is greater than or equal to the length of the target event and the Flume system is in a faulty state, the backup component is selected as the target component through the Sink component.

[0063] It is understandable that the Sink component will first pull data from the Channel component because this is the most efficient path. However, when the Flume system is in a faulty state, the Channel component may be inaccessible. At this time, it is necessary to read data from the backup component to ensure data reliability and integrity. That is, the Sink component does not rely on the Flume system, but directly accesses the backup component in the target storage system to pull the required data from the backup component. To this end, the Sink component will monitor the working status of the Flume system, and once the Flume system enters a faulty state, the Sink component will be immediately informed.

[0064] (2) Reading data from the backup component through the Sink component, storing the read data in a preset destination, and deleting the data in the backup component corresponding to the data successfully stored in the preset destination.

[0065] It can be understood that when the Sink component reads the event data from the backup component, it needs to persist the data to the preset destination. This process usually includes operations such as data format conversion, compression, and batch writing to improve transmission and storage efficiency. After the data is persisted, in order to avoid wasting storage space, this part of the data needs to be deleted. The native Channel component includes a mechanism for deleting successfully persisted event data, but the backup component does not. Therefore, it is necessary to synchronously delete the event data that has been successfully stored in the backup component. The process of deleting backup data is generally: the Sink component records the event header of the successfully stored event and then locates and deletes the copy data with the same event header through the interface provided by the target storage system.

[0066] In one embodiment, a target component is selected from a Channel component, a backup component, or an expansion component according to a preset consumption mechanism by a Sink component, and data is read from the target component and stored in a preset destination, including:

[0067] (1) When the remaining capacity is less than the length of the target event, the expansion component is selected as the target component through the Sink component.

[0068] It can be understood that when the remaining capacity of the Channel component is insufficient, the data will be stored in the expansion component first. The expansion component acts like a larger data buffer. It utilizes the expansion capability of the target storage system itself and can dynamically allocate additional storage resources. When the capacity of the Channel component is saturated, the system will automatically write the newly arrived data to the expansion component to avoid data loss. When selecting a read path, the Sink component will determine whether the data to be pulled belongs to the target event pushed during the period when the Channel component has insufficient capacity. This can be achieved by recording the event headers of these target events, so that the Sink component can accurately select the expansion component as the target component when pulling target events when the remaining capacity is less than the length of the target event.

[0069] (2) Reading data from the expansion component through the Sink component, storing the read data to a preset destination, and deleting the data in the expansion component corresponding to the data successfully stored to the preset destination.

[0070] It can be understood that when the Sink component reads the event data from the expansion component, it needs to store the data persistently in the preset destination. This process usually includes operations such as data format conversion, compression, and batch writing to improve transmission and storage efficiency. After the data is persisted, in order to avoid wasting storage space, this part of the data needs to be deleted. The process of deleting backup data is generally: the Sink component records the event header of the successfully stored event and then locates and deletes the event data with the same event header through the interface provided by the target storage system.

[0071] In one embodiment, the Sink component is custom configured by following the steps below:

[0072] (1) Inherit the native AbstractSink class and Configurable interface of the Flume system.

[0073] It can be understood that the AbstractSink class is the abstract base class of the Sink component in the Flume system, which provides the basic functional implementation of the Sink component. The Configurable interface is an interface in Flume, which is used to provide configuration-related methods, such as configuration initialization. In Flume, the basic framework and common functions of the Sink component have been implemented in the AbstractSink class, such as transaction management, retry mechanism, etc. At the same time, the Configurable interface provides a standard method for configuration initialization. By inheriting these two, you can make custom extensions on the existing basis to reduce repeated coding.

[0074] (2) Write the connection information of the target storage system and the preset destination in the configure method.

[0075] It can be understood that the configure method is used to read specific configuration information from the configuration file. The configuration information here mainly includes the connection information used to connect the Sink component with the target storage system and the preset destination, which may include user name, password, path, etc., and can be changed according to the needs of connecting the target storage system and the preset destination.

[0076] (3) Write the connection instruction for connecting the target storage system and the preset destination in the start method.

[0077] It can be understood that the start method is the method that the Sink component will run immediately after startup, which is used to perform necessary initialization work. The configure method only reads the connection information required to connect to the target storage system and the preset destination. However, the actual connection operation needs to be performed using the connection instruction when the Sink component is started. After the connection instruction is executed in the start() method, the Sink component can add, delete, query, and modify data in the target storage system and the preset destination as needed.

[0078] (4) Write the preset consumption mechanism into the process method.

[0079] It can be understood that the process method is a method that will be called and executed cyclically in the Sink component. The code corresponding to the preset consumption mechanism, that is, the code corresponding to the above-mentioned logic of selecting the target component and synchronizing the Channel component, backup component and expansion component, is written into the process method, so that the Sink component can pull events from the Channel component, backup component or expansion component according to the preset consumption mechanism and store them to the preset destination.

[0080] In one of the embodiments, the target storage system is a redis cluster. The preset destination is the clickhouse system. It can be understood that high performance: the redis cluster is a memory-based storage system with extremely fast read and write speeds. It can also provide high availability and fault tolerance to ensure data reliability. In addition, the redis cluster not only supports strings, but also supports data structures such as lists, sets, and ordered sets. The storage is more flexible and the threshold for use is relatively low. Clickhouse uses a columnar storage engine, which is suitable for batch insert scenarios and has excellent insertion performance. It is also optimized for OLAP analysis and has excellent query and analysis performance. In addition, clickhouse supports a variety of column partitioning and encoding methods, and consumes low storage space. The redis cluster is selected as the target storage system, and the clickhouse system is the preset destination. The overall system is as follows: Figure 2 As shown. The Source component can collect many log files. The Source component will encapsulate the log files into events, and a batch of events will be pushed back as a transaction. The Source component will first call a doPut method to form the transaction into putList, and then push the putList back through doCommit. If an exception occurs during the push, doRollback will be used to roll back. When the Source component pushes putList back, it will be intercepted by the Interceptor component and decide whether the final destination of putList is the Channel component, the backup component, or the expansion component. In the case where the Channel component is selected as the target component according to the preset consumption mechanism, its internal events will be pulled out from the Channel component by the Sink component using the doTake instruction to form a takelist, and then doCommit will be used to push the takeList to the preset destination to persist the data in clickhouse. If an exception occurs during the push, doRollback will be used to roll back. After successful storage, the Sink component will also delete the corresponding copy of takeList in the backup component. If the backup component is selected as the target component according to the preset consumption mechanism, the Sink component will directly access the backup component in the redis cluster and pull the events stored therein directly to clickhouse for storage. After successful storage, the Sink component will also delete the corresponding copy in the backup component. If the expansion component is selected as the target component according to the preset consumption mechanism, the Sink component will directly access the expansion component in the redis cluster and pull the events stored therein directly to clickhouse for storage.

[0081] In the second aspect, the present application provides a data processing device based on the Flume system, see Figure 3 , including an interception module 310, a first processing module 320, a second processing module 330 and a consumption module 340.

[0082] The interception module 310 is used to intercept the target event pushed by the Source component to the Channel component through the Interceptor component, and obtain the length of the target event and determine the remaining capacity of the Channel component. The type of the Channel component is MemoryChannel.

[0083] The first processing module 320 is used to push the target event to the Channel component and synchronize the target event to the backup component of the target storage system when the remaining capacity is greater than or equal to the length of the target event.

[0084] The second processing module 330 is used for storing the target event in the expansion component of the target storage system when the remaining capacity is smaller than the length of the target event.

[0085] The consumption module 340 is used to select a target component from a Channel component, a backup component or an expansion component according to a preset consumption mechanism through a Sink component, and read data from the target component and store it in a preset destination.

[0086] In one of the embodiments, the consumption module 340 is used to select the Channel component as the target component through the Sink component when the remaining capacity is greater than or equal to the length of the target event and the flume system is in a normal state; read data from the Channel component through the Sink component, and store the read data to a preset destination, and delete the data in the backup component corresponding to the data successfully stored to the preset destination.

[0087] In one of the embodiments, the consumption module 340 is used to select a backup component as a target component through a Sink component when the remaining capacity is greater than or equal to the length of the target event and the flume system is in a faulty state; read data from the backup component through the Sink component, store the read data in a preset destination, and delete the data in the backup component corresponding to the data successfully stored in the preset destination.

[0088] In one of the embodiments, the consumption module 340 is used to select the expansion component as the target component through the Sink component when the remaining capacity is less than the length of the target event; read data from the expansion component through the Sink component, store the read data to the preset destination, and delete the data in the expansion component corresponding to the data successfully stored to the preset destination.

[0089] In one embodiment, the interception module 310 is used to obtain the current length of the backup component through the Interceptor component, and obtain the remaining capacity according to the preset capacity upper limit and the current length of the backup component.

[0090] In one embodiment, the data processing based on the flume system further includes a rewrite module. The rewrite module is used to inherit the native AbstractSink class and Configurable interface of the flume system; write the connection information of the target storage system and the preset destination in the configure method; write the connection instruction of connecting the target storage system and the preset destination in the start method; and write the preset consumption mechanism in the process method.

[0091] For the specific definition of the data processing device based on the flume system, please refer to the definition of the data processing method based on the flume system above, which will not be repeated here. Each module in the above-mentioned data processing device based on the flume system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic, which is only a logical function division, and there may be other division methods in actual implementation.

[0092] The present application provides a computer device, including one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the following steps are performed: intercepting a target event pushed by a Source component to a Channel component through an Interceptor component, and obtaining the length of the target event and determining the remaining capacity of the Channel component; the type of the Channel component is MemoryChannel; when the remaining capacity is greater than or equal to the length of the target event, pushing the target event to the Channel component, and synchronizing the target event to a backup component of a target storage system; otherwise, storing the target event in an expansion component of the target storage system; selecting a target component from a Channel component, a backup component, or an expansion component according to a preset consumption mechanism through a Sink component, and reading data from the target component and storing it in a preset destination.

[0093] In one embodiment, when the computer-readable instructions are executed by one or more processors, the data processing method based on the flume system in any of the above embodiments is executed.

[0094] Indicatively, if Figure 4 As shown, Figure 4 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. Figure 4 , the computer device 400 includes a processing component 402, which further includes one or more processors, and a memory resource represented by a memory 401, for storing instructions executable by the processing component 402, such as an application. The application stored in the memory 401 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 402 is configured to execute instructions to perform the steps of the data processing method based on the flume system of any of the above embodiments.

[0095] The computer device 400 may further include a power supply component 403 configured to perform power management of the computer device 400 , a wired or wireless model interface 404 configured to connect the computer device 400 to the model, and an input / output (I / O) interface 405 .

[0096] An embodiment of the present application provides a storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute: intercepting a target event pushed by a Source component to a Channel component through an Interceptor component, and obtaining the length of the target event and determining the remaining capacity of the Channel component; the type of the Channel component is MemoryChannel; when the remaining capacity is greater than or equal to the length of the target event, pushing the target event to the Channel component, and synchronizing the target event to a backup component of a target storage system; otherwise, storing the target event in an expansion component of the target storage system; selecting a target component from a Channel component, a backup component, or an expansion component according to a preset consumption mechanism through a Sink component, and reading data from the target component and storing it in a preset destination.

[0097] In one embodiment, when the computer-readable instructions are executed by one or more processors, the one or more processors execute the data processing method based on the flume system in any of the above embodiments.

[0098] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0099] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0100] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data processing method based on a flume system, characterized in that: include: The target event pushed by the Source component to the Channel component is intercepted by the Interceptor component, and the length of the target event and the remaining capacity of the Channel component are obtained; the type of the Channel component is MemoryChannel; In the case where the remaining capacity is greater than or equal to the length of the target event, the target event is pushed to the Channel component, and the target event is synchronized to the backup component of the target storage system; Otherwise, storing the target event in the expansion component of the target storage system; The Sink component selects a target component from the Channel component, the backup component or the expansion component according to a preset consumption mechanism, and reads data from the target component and stores it in a preset destination.

2. The data processing method according to claim 1, characterized in that: The step of selecting a target component from the Channel component, the backup component or the expansion component according to a preset consumption mechanism through the Sink component, and reading data from the target component and storing it in a preset destination includes: When the remaining capacity is greater than or equal to the length of the target event and the flume system is in a normal state, the Channel component is selected as the target component through the Sink component; The data is read from the Channel component through the Sink component, and the read data is stored in the preset destination, and the data in the backup component corresponding to the data successfully stored in the preset destination is deleted.

3. The data processing method according to claim 1, characterized in that: The step of selecting a target component from the Channel component, the backup component or the expansion component according to a preset consumption mechanism through the Sink component, and reading data from the target component and storing it in a preset destination includes: When the remaining capacity is greater than or equal to the length of the target event and the flume system is in a faulty state, selecting the backup component as the target component through the Sink component; The data is read from the backup component through the Sink component, and the read data is stored in the preset destination, and the data in the backup component corresponding to the data successfully stored in the preset destination is deleted.

4. The data processing method according to claim 1, characterized in that: The step of selecting a target component from the Channel component, the backup component or the expansion component according to a preset consumption mechanism through the Sink component, and reading data from the target component and storing it in a preset destination includes: When the remaining capacity is less than the length of the target event, selecting the expansion component as the target component through the Sink component; The data is read from the expansion component through the Sink component, and the read data is stored in the preset destination, and the data in the expansion component corresponding to the data successfully stored in the preset destination is deleted.

5. The data processing method according to claim 2, characterized in that: The determining the remaining capacity of the Channel component includes: The current length of the backup component is obtained through the Interceptor component, and the remaining capacity is obtained according to the preset capacity upper limit and the current length of the backup component.

6. The data processing method according to claim 1, characterized in that: The Sink component is custom configured through the following steps: Inherit the native AbstractSink class and Configurable interface of the Flume system; Writing the connection information between the target storage system and the preset destination in the configure method; Writing a connection instruction to connect the target storage system and the preset destination in the start method; The preset consumption mechanism is written into the process method.

7. The data processing method according to claims 1 to 6, characterized in that: The target storage system is a redis cluster.

8. The data processing method according to claims 1-6, characterized in that: The preset destination is the clickhouse system.

9. A data processing device based on a flume system, characterized in that: include: An interception module, used to intercept the target event pushed by the Source component to the Channel component through the Interceptor component, and obtain the length of the target event and determine the remaining capacity of the Channel component; the type of the Channel component is MemoryChannel; A first processing module, configured to push the target event to the Channel component and synchronize the target event to the backup component of the target storage system when the remaining capacity is greater than or equal to the length of the target event; A second processing module, configured to store the target event in a capacity expansion component of the target storage system when the remaining capacity is less than the length of the target event; The consumption module is used to select a target component from the Channel component, the backup component or the expansion component according to a preset consumption mechanism through a Sink component, and read data from the target component and store it in a preset destination.

10. A computer device, characterized in that: The system comprises one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the data processing method based on the flume system as described in any one of claims 1 to 8 are executed.

11. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the data processing method based on the flume system as described in any one of claims 1 to 8.