Business data processing method and device, equipment and storage medium
By obtaining the data of stream calculation and batch calculation jobs, performing corresponding operations and writing to the data lake table, deduplication and storage according to the time of business occurrence, solving the problem of redundancy of stream and batch data storage resources, and realizing the flow and batch data Unified storage and resource optimization.
Patent Information
- Application Number
- CN202411102500.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-01
AI Technical Summary
In the prior art, data storage and calculation of stream computing and batch computing are relatively independent, resulting in redundancy of data storage resources.
By obtaining the business data of the pending stream computing jobs and batch computing jobs, performing stream computing and batch computing operations, writing data to the data lake table, and deduplication storage is performed according to the time of business occurrence, realizing unified storage of stream and batch data .
It effectively reduces the redundancy of data storage resources, ensures the retention of the latest business data, and realizes unified streaming and batch storage.
Smart Images

Figure CN118885494A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a business data processing method, device, equipment and storage medium. Background Art
[0002] With the rapid development of banking business, business-related data has shown characteristics such as large scale, multi-source heterogeneity, and complex structure, and traditional data processing methods are often difficult to cope with.
[0003] There are generally two options for data processing in existing big data cloud platform applications, namely batch computing and stream computing. Batch computing uses batch processing tools to complete batch data processing, and the timeliness of batch computing is generally more than 1 day, that is, it takes at least 1 day from data generation to data calculation results. Among them, stream computing uses stream processing tools to complete real-time data processing, and the timeliness performance of stream computing jobs reaches the second level, that is, it only takes a few seconds from data generation to data calculation results.
[0004] In the existing independent stream and batch solutions, stream computing and batch computing correspond to their own systems, and the storage and computing of stream and batch data are relatively independent, resulting in redundant data storage resources. Summary of the invention
[0005] The embodiments of the present application provide a business data processing method, apparatus, device and storage medium to solve the problem in the prior art that the storage and calculation of stream and batch data are relatively independent, resulting in redundant data storage resources.
[0006] In a first aspect, the present application provides a business data processing method, comprising:
[0007] Obtain the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job;
[0008] Perform a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data, and perform a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data;
[0009] Writing the first business data and the second business data into the data lake table corresponding to the business;
[0010] The business data in the data lake table is deduplicated in the order of business occurrence time, and the deduplicated data lake table is stored.
[0011] In a possible design, the obtaining of the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job includes:
[0012] Based on the preset first field mapping relationship and the initial business data corresponding to the stream computing job, the target business data is obtained, where the target business data is the business data corresponding to the stream computing job to be processed, and the preset first field mapping relationship is the field mapping relationship between the initial business data corresponding to the stream computing job and the target business data;
[0013] Based on the preset second field mapping relationship and the initial business data corresponding to the batch computing job, the target business data is obtained, where the target business data is the business data corresponding to the batch computing job to be processed, and the preset second field mapping relationship is the field mapping relationship between the initial business data corresponding to the batch computing job and the target business data.
[0014] In a possible design, deduplication of business data in the data lake table according to the order of business occurrence time includes:
[0015] Traversing the business data in the data lake table to determine whether there is business data with the same primary key;
[0016] If there is business data with the same primary key, the business occurrence time is compared for the business data corresponding to the same primary key to retain the business data in the data lake table that is closest to the current time.
[0017] In a possible design, performing a stream computing operation on the service data corresponding to the stream computing job to obtain corresponding first service data includes:
[0018] Run the stream computing script to perform a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data;
[0019] The performing a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data includes:
[0020] The batch computing script is run to perform a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data.
[0021] In one possible design, the method further includes:
[0022] Compare and verify the fields between the first business data and the second business data to determine whether the stream computing result and the batch computing result corresponding to the same field are consistent;
[0023] If so, execute the step of writing the first business data and the second business data into the data lake table corresponding to the business.
[0024] In one possible design, the method further includes:
[0025] If the business data corresponding to the stream computing job to be processed is obtained, a stream computing operation is performed on the business data corresponding to the stream computing job to obtain corresponding first business data;
[0026] Read the data lake table corresponding to the business and containing the second business data, and write the first business data into the data lake table corresponding to the business to complete the stream-to-batch operation.
[0027] In one possible design, the method further includes:
[0028] If the business data corresponding to the batch computing job to be processed is obtained, a batch computing operation is performed on the business data corresponding to the batch computing job to obtain corresponding second business data;
[0029] Read the data lake table corresponding to the business and containing the first business data, and write the second business data into the data lake table corresponding to the business to complete the batch fill flow operation.
[0030] In one possible design, the method further includes:
[0031] Obtain a specified business occurrence time, and obtain business data of a stream computing job corresponding to the specified business occurrence time;
[0032] A stream computing operation is performed on the business data corresponding to the stream computing job to obtain corresponding first business data.
[0033] In a second aspect, the present application provides a business data processing device, including:
[0034] An acquisition unit, used to acquire business data corresponding to the stream computing job to be processed and business data corresponding to the batch computing job;
[0035] A processing unit, configured to perform a stream computing operation on the business data corresponding to the stream computing job to obtain the corresponding first business data, and to perform a batch computing operation on the business data corresponding to the batch computing job to obtain the corresponding second business data;
[0036] The processing unit is further used to write the first business data and the second business data into the data lake table corresponding to the business;
[0037] The processing unit is also used to deduplicate the business data in the data lake table in the order of business occurrence time;
[0038] The storage unit is used to store the deduplicated data lake table.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the business data processing method described in the first aspect and various possible designs of the first aspect.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the business data processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0041] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the business data processing method described in the first aspect and various possible designs of the first aspect.
[0042] The business data processing method, device, equipment and storage medium provided by the present application obtain the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job, perform the stream computing operation on the business data corresponding to the stream computing job to obtain the first business data, and perform the batch computing operation on the business data corresponding to the batch computing job to obtain the second business data, write the first business data and the second business data into the data lake table corresponding to the business, and deduplicate the business data in the data lake table according to the time sequence of the business occurrence to ensure that the latest business data is retained, and can perform unified storage of streams and batches. Therefore, it can solve the problem that the current storage and calculation of stream and batch data are relatively independent, resulting in redundant data storage resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0044] Figure 1 This is an application scenario diagram of the business data processing method applicable to the embodiment of the present application;
[0045] Figure 2 The process of the business data processing method provided in the embodiment of the present application Figure 1 ;
[0046] Figure 3 The process of the business data processing method provided in the embodiment of the present application Figure 2 ;
[0047] Figure 4 A schematic diagram of the structure of a business data processing device provided in an embodiment of the present application;
[0048] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0049] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0050] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0051] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0052] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0053] Terminology explanation:
[0054] Batch computing: Also commonly referred to as offline computing. It processes "fixed" and "bounded" data in batches. Generally, after the data is generated, batch computing processes and calculates fixed data within a clear range. Batch computing tasks can be executed once or periodically according to set rules. Relatively speaking, batch computing has lower timeliness (usually in days or hours), but higher data accuracy.
[0055] Stream computing: Also commonly referred to as real-time computing. It processes "boundaryless" data one by one. In scenarios where data is continuously generated, stream computing analyzes and processes the data immediately after it is generated. Stream computing tasks are started and stopped by the user and will not end automatically during operation.
[0056] Figure 1 FIG. 1 is an application scenario diagram of the business data processing method applicable to the embodiment of the present application. Figure 1As shown, the application scenario includes: a data source 101, a cloud platform 102, and an Apache Hudi data lake platform 103, wherein the data source refers to the original source or starting point for obtaining data, and the data source includes multiple data sources, which correspond to different business systems. It can be any entity or system that can provide data. The cloud platform 102 is connected to the data source 101 and the Apache Hudi data lake platform 103 in communication, respectively. The cloud platform 102 obtains the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job from the data source 101. The cloud platform 102 performs a stream computing operation on the business data corresponding to the stream computing job to obtain the corresponding first business data, and performs a batch computing operation on the business data corresponding to the batch computing job to obtain the corresponding second business data; the cloud platform 102 writes the first business data and the second business data into the data lake table corresponding to the business; the cloud platform 102 deduplicates the business data in the data lake table according to the time sequence of the business occurrence, and the cloud platform 102 stores the deduplicated data lake table in the Apache Hudi data lake platform 103.
[0057] based on Figure 1 In the application scenario shown, an embodiment of the present application also provides a business data processing method. Figure 2 The process of the business data processing method provided in the embodiment of the present application Figure 1 .like Figure 2 As shown, the business data processing method includes:
[0058] S201, obtaining business data corresponding to a stream computing job to be processed and business data corresponding to a batch computing job.
[0059] The execution subject of the method of this embodiment may be a cloud platform, which adopts the Apache Hadoop distributed processing architecture, integrates various big data technology stacks, and provides a one-stop big data tool set.
[0060] In this embodiment, the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job are obtained, wherein the business data corresponding to the stream computing job is used for stream computing, and the business data corresponding to the stream computing job has a high timeliness and needs to be processed in real time within a certain period of time, such as the user account balance in the bank system, and the real-time judgment of whether there is an abnormal transaction when each transaction of the user occurs, etc., all belong to stream computing. Among them, the business data corresponding to the batch computing job is used for batch computing, and the business data corresponding to the batch computing job does not need to be processed in real time. Compared with the business data corresponding to the stream computing job, it is more accurate and is a periodic operation. It is necessary to process historical data, such as user transaction records, mid-day settlement, and month-end clearing in the bank system, all belong to batch computing.
[0061] S202, performing a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data, and performing a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data.
[0062] In this embodiment, based on the corresponding computing rules, a stream computing operation is performed on the business data corresponding to the stream computing job to obtain the corresponding first business data, including the corresponding stream computing results. Similarly, a batch computing operation is performed on the business data corresponding to the batch processing job to obtain the corresponding second business data, which includes the corresponding batch computing results.
[0063] S203: Write the first business data and the second business data into a data lake table corresponding to the business.
[0064] In this embodiment, data is written simultaneously, and the first business data obtained by the stream computing job and the second business data obtained by the batch computing job are written into the data lake table at the same time. The data lake table is created in advance. Specifically, the data lake table can be an Apache Hudi table. Apache Hudi is a storage format for data lakes. It provides the ability to update and delete data and the ability to consume changed data on the Hadoop file system. In this embodiment, Apache Hudi is regarded as an independent data source type. Pre-configure the Apache Hudi data source connection information, create the Apache Hudi table, and configure related parameters.
[0065] S204, deduplication of business data in the data lake table is performed in the order of business occurrence time, and the deduplication data lake table is stored.
[0066] In this embodiment, the business data in the Apache Hudi table is deduplicated in the order of the business occurrence time. For example, for the same user, the account balance of the user at 10 o'clock recorded in the first business data is a yuan, and the account balance of the user at 12 o'clock in the second business data is b yuan. The latest business data is retained, that is, the business data of the user's account balance of a yuan at 10 o'clock is deleted, and the deduplicated data lake table is stored to ensure that the latest business data is stored.
[0067] The business data processing method provided in the embodiment of the present application obtains the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job, performs a stream computing operation on the business data corresponding to the stream computing job to obtain the first business data, and performs a batch computing operation on the business data corresponding to the batch computing job to obtain the second business data, writes the first business data and the second business data into the data lake table corresponding to the business, deduplicates the business data in the data lake table in the order of the business occurrence time to ensure that the latest business data is retained, is deployed on the same platform, reduces resource waste, can perform unified storage of streams and batches, and effectively reduces the redundancy of data storage resources.
[0068] Figure 3 Schematic diagram of the process of business data processing method provided for this application Figure 2 ,like Figure 3 As shown, in this embodiment Figure 2 Based on the embodiment, a business data processing method is described in detail, and the method includes the following steps:
[0069] S301, obtaining business data corresponding to the stream computing job to be processed and business data corresponding to the batch computing job.
[0070] The execution subject of the method of this embodiment may be a cloud platform, which adopts the Apache Hadoop distributed processing architecture, integrates various big data technology stacks, and provides a one-stop big data tool set.
[0071] In this embodiment, the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job are obtained, wherein the business data corresponding to the stream computing job is used for stream computing, and the business data corresponding to the stream computing job has a high timeliness and needs to be processed in real time within a certain period of time, such as the user account balance in the bank system, and the real-time judgment of whether there is an abnormal transaction when each transaction of the user occurs, etc., all belong to stream computing. Among them, the business data corresponding to the batch computing job is used for batch computing, and the business data corresponding to the batch computing job does not need to be processed in real time. Compared with the business data corresponding to the stream computing job, it is more accurate and is a periodic operation. It is necessary to process historical data, such as user transaction records, mid-day settlement, and month-end clearing in the bank system, all belong to batch computing.
[0072] In a possible implementation, obtaining business data corresponding to a stream computing job to be processed and business data corresponding to a batch computing job includes:
[0073] Based on the preset first field mapping relationship and the initial business data corresponding to the stream computing job, the target business data is obtained, and the target business data is the business data corresponding to the stream computing job to be processed. The preset first field mapping relationship is the field mapping relationship between the initial business data corresponding to the stream computing job and the target business data; based on the preset second field mapping relationship and the initial business data corresponding to the batch computing job, the target business data is obtained, and the target business data is the business data corresponding to the batch computing job to be processed. The preset second field mapping relationship is the field mapping relationship between the initial business data corresponding to the batch computing job and the target business data.
[0074] In this embodiment, the first field mapping relationship is pre-configured according to business needs. The first field mapping relationship is a field mapping relationship between the initial business data corresponding to the stream computing job and the target business data. For example, a certain field in the initial business data is a user ID, and the field corresponding to the field in the target business data is a customer ID. The field mapping relationship ensures that data can be correctly transmitted and converted between different systems. The user ID and the customer ID both represent user identifiers. The field names are different, but they both represent the same meaning. The initial business data is connected to the corresponding data source according to the pre-configured data source connection information, and the business data is obtained from the data source. The target business data is generated based on the preset first field mapping relationship and the initial business data corresponding to the stream computing job. The target business data is used for the stream computing operation. The target business data is the business data corresponding to the above-mentioned stream computing job to be processed.
[0075] The second field mapping relationship is pre-configured according to business needs. The second field mapping relationship is the field mapping relationship between the initial business data corresponding to the batch computing job and the target business data. The field mapping relationship ensures that data can be correctly transmitted and converted between different systems. The initial business data is the business data obtained from the data source by connecting to the corresponding data source according to the pre-configured data source connection information. The target business data is generated based on the preset second field mapping relationship and the initial business data corresponding to the batch computing job. The target business data is used for the batch computing operation. The target business data is the business data corresponding to the batch computing job to be processed.
[0076] Optionally, the cloud platform configures a data management module, a stream computing business component, a batch computing business component, a service component, and a data development module. The data management module is used to manage the data source read-write relationship between the stream computing business component and the batch computing business component; the data management module is also used to store data source connection information and create data lake tables. The data management module generates corresponding data lake tables in the underlying storage according to the metadata information of the created tables; the data management module is used to obtain Apache Hudi table related information according to data information during the generation of stream computing and batch computing jobs. The service component manages the information and parameters of the Apache Hudi table, and automatically runs the background Apache Hudi table service according to the relevant parameters, such as compression service. The table service mainly affects the read and write performance of the Apache Hudi table. The service component also includes a data writing module. When the batch computing job and the stream computing job are written to the same Apache Hudi table at the same time, the data writing module performs deduplication according to the primary key, does not record data repeatedly, and can also ensure that the saved business data is the latest.
[0077] Optionally, the data development module is used to provide a data development work kit for developers to use; the data development module is also used to convert jobs or codes configured according to business logic into job execution scripts, including: stream computing scripts and batch computing scripts, and send them to the stream computing component and the batch computing component respectively. The stream computing component runs the stream computing script to perform stream computing operations, and the batch computing component runs the batch computing script to perform batch computing operations.
[0078] Optionally, the stream computing component parses the user configuration information passed by the data development module to generate a stream computing job, and uses the engine to run the stream computing job. The engine can be a Flink engine, which processes the business data in real time after obtaining it. Usually, the job remains in the running state after running, and the user needs to stop and start it manually. The stream computing component consists of three parts: data source (Source), data processing (Data Processing), and data writing (Sink). The data source supports data reading from the data source library table. Data processing exists between data processing and data writing, and supports operators that users configure data processing logic; data writing supports data writing to the data source library table specified by the user.
[0079] Optionally, the batch computing component parses the user configuration information of the data development module to generate a batch computing job. The data is processed in batches, and the job runs in batches. After the operation is completed, the resources are released and the next batch is waited for to run again. The batch computing component also includes a batch computing job plug-in. The batch computing job plug-in loads, unloads, and copies data increments or full data between heterogeneous / homogeneous data sources. Data increment means adding business data according to time, and full data means that the business data of the data source and the target data are consistent. The target data has as much business data as the data source. The batch computing team leader supports data cleaning, deduplication and other operations during data synchronization. Cleaning refers to removing dirty data from business data; the batch computing job plug-in supports reading and processing data from multiple data sources and writing them into a single data target. The data target refers to the above-mentioned Apache Hudi table. The batch computing job plug-in supports users to automatically develop data processing programs. Users first download the offline development software development kit (SDK) provided by the platform on the cloud platform, import the SDK into the offline project, and then develop the code logic. The batch computing job plug-in has data integration, data consolidation, data verification and other capabilities.
[0080] S302, performing a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data, and performing a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data.
[0081] In this embodiment, based on the corresponding computing rules, a stream computing operation is performed on the business data corresponding to the stream computing job to obtain the corresponding first business data, including the corresponding stream computing results. Similarly, a batch computing operation is performed on the business data corresponding to the batch processing job to obtain the corresponding second business data, which includes the corresponding batch computing results.
[0082] In a possible implementation, performing a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data includes:
[0083] Run the stream computing script to perform a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data.
[0084] In this embodiment, a preconfigured stream computing script is run. The developer converts the job parameters or codes configured according to the business logic into a job execution script, i.e., a stream computing script, in advance. The stream computing script is run to perform stream computing operations on the business data corresponding to the stream computing job according to the corresponding computing strategy to obtain the corresponding first business data.
[0085] In a possible implementation, performing a batch computing operation on business data corresponding to a batch computing job to obtain corresponding second business data includes:
[0086] The batch computing script is run to perform a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data.
[0087] In this embodiment, a preconfigured batch computing script is run. The developer converts the job parameters or codes configured according to the business logic into a job execution script, i.e., a batch computing script, in advance. The batch computing script is run to perform batch computing operations on the business data corresponding to the batch computing job according to the corresponding computing strategy to obtain the corresponding second business data.
[0088] S303: Write the first business data and the second business data into the data lake table corresponding to the business.
[0089] In this embodiment, data is written simultaneously, and the first business data obtained by the stream computing job and the second business data obtained by the batch computing job are written into the data lake table at the same time. The data lake table is created in advance. Specifically, the data lake table can be an Apache Hudi table. Apache Hudi is a storage format for data lakes. It provides the ability to update and delete data and the ability to consume changed data on the Hadoop file system. In this embodiment, Apache Hudi is regarded as an independent data source type. Pre-configure the Apache Hudi data source connection information, create the Apache Hudi table, and configure related parameters.
[0090] In an optional embodiment, the method further includes:
[0091] Compare and verify the fields between the first business data and the second business data to determine whether the stream computing results and batch computing results corresponding to the same fields are consistent; if so, execute the step of writing the first business data and the second business data into the data lake table corresponding to the business.
[0092] In this embodiment, a comparison tool is provided. By using the comparison tool, the fields between the first business data and the second business data are compared and verified to determine whether the stream calculation results and batch calculation results corresponding to the same fields are consistent. The stream calculation results and batch calculation results corresponding to the same fields refer to whether the stream calculation results and batch calculation results corresponding to the same business are consistent. The business occurrence time of the same business is the same. If they are consistent, the verification is passed, and the step of writing the first business data and the second business data into the data lake table corresponding to the business is further executed; if they are inconsistent, a prompt message is generated and sent to the terminal corresponding to the business so that the existing problems can be handled in time. There may be data loss in the stream data, so the cloud platform provides a tool for comparing the stream and batch write data, mainly to verify the accuracy of the stream calculation data, evaluate and confirm the accuracy of the calculation results of the stream calculation job.
[0093] S304, traverse the business data in the data lake table to determine whether there is business data with the same primary key.
[0094] In this embodiment, a field is the smallest data unit in a database table, and each field represents a data attribute or data item, such as name, age, etc. In a database table, a field is a synonym for a column. Each column has a field name that identifies the data content of the column. The primary key is a special field or combination of fields that is used to uniquely identify each record in a database table. The primary key is composed of one or more fields. A table can have one or more fields, but can only have one primary key. Traverse the business data in the data lake table to determine whether there is business data with the same primary key.
[0095] Step 305: If there is business data with the same primary key, the business occurrence time is compared for the business data corresponding to the same primary key to retain the business data in the data lake table that is closest to the current time.
[0096] In this embodiment, if there is business data with the same primary key, the business occurrence time is compared for the business data corresponding to the same primary key, and the business data with an earlier business occurrence time is deleted, and the business data with the closest time to the current time in the data lake table is retained.
[0097] In an optional embodiment, the method further includes:
[0098] If the business data corresponding to the stream computing job to be processed is obtained, the stream computing operation is performed on the business data corresponding to the stream computing job to obtain the corresponding first business data; the data lake table corresponding to the business and containing the second business data is read, and the first business data is written into the data lake table corresponding to the business to complete the stream batch operation.
[0099] In this embodiment, stream-batch data complementation is supported. If the acquired business data is the business data corresponding to the stream computing job to be processed, a stream computing operation is performed on the business data corresponding to the stream computing job to obtain the first business data, read the data lake table containing the second business data corresponding to the same business, and write the first business data into the data lake table corresponding to the business, thereby completing the stream-batch complementation operation. Specifically, when developing batch computing, configure a data synchronization operator in the canvas, such as a Spark operator, specify the data target as Apache Hudi, and perform data replication from the source to the target Apache Hudi data table. When applied to stream computing development, configure an operator in the canvas, such as an Apache Hudi Source operator, and perform data replication from the Apache Hudi data table to the target. By writing batch computing and reading the same data lake table through stream computing, the need for batch data to complement stream data is met.
[0100] In an optional embodiment, the method further includes:
[0101] If the business data corresponding to the batch computing job to be processed is obtained, a batch computing operation is performed on the business data corresponding to the batch computing job to obtain the corresponding second business data; the data lake table corresponding to the business containing the first business data is read, and the second business data is written into the data lake table corresponding to the business to complete the batch fill flow operation.
[0102] In this embodiment, if the acquired business data is the business data corresponding to the batch computing job to be processed, a batch computing operation is performed on the business data corresponding to the batch computing job to obtain the second business data, and the data lake table corresponding to the same business containing the first business data is read, and the second business data is written into the data lake table corresponding to the business, thereby completing the batch-to-stream operation. Specifically, when developing stream computing, an operator is configured in the canvas, such as the Apache Hudi Sink operator, to perform data replication from the source to the target Apache Hudi data table. When applied in batch computing development, a data synchronization operator is configured in the canvas, such as the Spark operator, to specify the data source as Apache Hudi, to perform data replication from the Apache Hudi data table to the target. The need to supplement batch data with stream data is realized by writing stream computing and reading batch computing on the same data lake table.
[0103] In an optional embodiment, the method further includes:
[0104] The specified business occurrence time is obtained, and the business data of the stream computing job corresponding to the specified business occurrence time is obtained; the stream computing operation is performed on the business data corresponding to the stream computing job to obtain the corresponding first business data.
[0105] In this embodiment, the specified business occurrence time is obtained, which is the fault time, and the business data of the stream computing job corresponding to the specified business occurrence time is obtained. The stream computing script is run to perform the stream computing operation on the business data corresponding to the stream computing job to obtain the corresponding first business data. The cloud platform supports data compensation and correction of the running stream computing job through stream-batch integration.
[0106] Specifically, the cloud platform supports integrated operation and maintenance, including: operation and maintenance of stream and batch computing jobs, operation and maintenance of data lake table services, and compensation and correction of data for stream computing jobs. Among them, complete operation and maintenance functions are provided for stream computing jobs and batch computing jobs, including: job start, stop, job operation intervention, job log query, job fault diagnosis, operation indicator monitoring and other functions, which are convenient for application operation and maintenance. The operation and maintenance of data lake table services supports the viewing, intervention and monitoring of Apache Hudi table service processes, which is convenient for application operation and maintenance. During the operation of stream computing jobs, for failures that occur in a certain period of time, the function of data compensation can be provided, so that the application can complete data correction without affecting the normal operation of the original stream computing job, without the need to develop new jobs, and can perceive the fault time range, specify the business time as the fault time, and replace the original job operator with a data source with normal data. For example, it supports data compensation from two data sources, Kafka and Apache Hudi. When the required original data in the original Kafka data source expires, the data of the specified business time can be obtained from the data lake Apache Hudi. Run the data compensation job to correct the data without affecting the operation of the original stream computing job.
[0107] The business data processing method provided in the embodiment of the present application deduplicates the business data in the data lake table in the order of the business occurrence time to ensure that the latest business data is retained, and can perform unified storage of streams and batches, effectively reducing the redundancy of data storage resources. A tool for comparing stream and batch write data is provided, mainly to verify the accuracy of stream computing data, evaluate and confirm the accuracy of the calculation results of stream computing jobs. In addition, the data can be corrected when a fault occurs to ensure the accuracy of the data.
[0108] Figure 4 This is a schematic diagram of the structure of the business data processing device provided in the embodiment of the present application. Figure 4 As shown, the business data processing device 40 includes: an acquisition module 401, a processing unit 402 and a storage unit 403.
[0109] Among them, the acquisition unit 401 is used to obtain the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job. The processing unit 402 is used to perform a stream computing operation on the business data corresponding to the stream computing job to obtain the corresponding first business data, and perform a batch computing operation on the business data corresponding to the batch computing job to obtain the corresponding second business data. The processing unit 402 is also used to write the first business data and the second business data into the data lake table corresponding to the business. The processing unit 402 is also used to deduplicate the business data in the data lake table according to the chronological order of the business occurrence. The storage unit 403 is used to store the deduplicated data lake table.
[0110] In some embodiments, the acquisition unit 401 is further used to obtain target business data based on a preset first field mapping relationship and initial business data corresponding to the stream computing job, where the target business data is the business data corresponding to the stream computing job to be processed, and the preset first field mapping relationship is the field mapping relationship between the initial business data corresponding to the stream computing job and the target business data; and to obtain target business data based on a preset second field mapping relationship and initial business data corresponding to the batch computing job, where the target business data is the business data corresponding to the batch computing job to be processed, and the preset second field mapping relationship is the field mapping relationship between the initial business data corresponding to the batch computing job and the target business data.
[0111] In some embodiments, the processing unit 402 is also used to traverse the business data in the data lake table to determine whether there is business data with the same primary key; if there is business data with the same primary key, the business occurrence time is compared for the business data corresponding to the same primary key to retain the business data in the data lake table that is closest to the current time.
[0112] In some embodiments, the processing unit 402 is also used to run a stream computing script to perform a stream computing operation on the business data corresponding to the stream computing job to obtain the corresponding first business data; perform a batch computing operation on the business data corresponding to the batch computing job to obtain the corresponding second business data, including: running a batch computing script to perform a batch computing operation on the business data corresponding to the batch computing job to obtain the corresponding second business data.
[0113] In some embodiments, the processing unit 402 is also used to compare and verify the fields between the first business data and the second business data to determine whether the stream computing results and batch computing results corresponding to the same fields are consistent; if so, the step of writing the first business data and the second business data into the data lake table corresponding to the business is executed.
[0114] In some embodiments, the processing unit 402 is also used to, if business data corresponding to the stream computing job to be processed is obtained, perform a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data; read the data lake table corresponding to the business containing the second business data, and write the first business data into the data lake table corresponding to the business to complete the stream batch operation.
[0115] In some embodiments, the processing unit 402 is also used to, if business data corresponding to the batch computing job to be processed is obtained, perform a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data; read the data lake table corresponding to the business containing the first business data, and write the second business data into the data lake table corresponding to the business to complete the batch fill flow operation.
[0116] In some embodiments, the processing unit 402 is further used to obtain a specified business occurrence time, obtain business data of a stream computing job corresponding to the specified business occurrence time; perform a stream computing operation on the business data corresponding to the stream computing job, and obtain corresponding first business data.
[0117] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 50 may include: a transceiver 501 , a processor 502 , and a memory 503 .
[0118] The processor 502 executes the computer-executable instructions stored in the memory, so that the processor 502 executes the solution in the above embodiment. The processor 502 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0119] The memory 503 is connected to the processor 502 via a system bus and implements communication therebetween. The memory 503 is used to store computer program instructions.
[0120] The transceiver 501 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.
[0121] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0122] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.
[0123] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the business data processing method in the above embodiment.
[0124] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the business data processing method of the above embodiment.
[0125] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the business data processing method in the above embodiment.
[0126] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0127] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0128] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0129] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0130] It should be understood that the above processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0131] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0132] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0133] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0134] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.
[0135] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A business data processing method, It is characterized in that include: Obtain the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job; Perform a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data, and perform a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data; Writing the first business data and the second business data into the data lake table corresponding to the business; The business data in the data lake table is deduplicated in the order of business occurrence time, and the deduplicated data lake table is stored.
2. The method according to claim 1, It is characterized in that The obtaining of the business data corresponding to the stream computing job to be processed and the business data corresponding to the batch computing job includes: Based on the preset first field mapping relationship and the initial business data corresponding to the stream computing job, the target business data is obtained, where the target business data is the business data corresponding to the stream computing job to be processed, and the preset first field mapping relationship is the field mapping relationship between the initial business data corresponding to the stream computing job and the target business data; Based on the preset second field mapping relationship and the initial business data corresponding to the batch computing job, the target business data is obtained, where the target business data is the business data corresponding to the batch computing job to be processed, and the preset second field mapping relationship is the field mapping relationship between the initial business data corresponding to the batch computing job and the target business data.
3. The method according to claim 1, It is characterized in that Deduplication of the business data in the data lake table in the order of business occurrence time includes: Traversing the business data in the data lake table to determine whether there is business data with the same primary key; If there is business data with the same primary key, the business occurrence time is compared for the business data corresponding to the same primary key to retain the business data in the data lake table that is closest to the current time.
4. The method according to claim 1, It is characterized in that The performing a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data includes: Run the stream computing script to perform a stream computing operation on the business data corresponding to the stream computing job to obtain corresponding first business data; The performing a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data includes: The batch computing script is run to perform a batch computing operation on the business data corresponding to the batch computing job to obtain corresponding second business data.
5. The method according to any one of claims 1 to 4, It is characterized in that Also includes: Compare and verify the fields between the first business data and the second business data to determine whether the stream computing result and the batch computing result corresponding to the same field are consistent; If so, execute the step of writing the first business data and the second business data into the data lake table corresponding to the business.
6. The method according to claim 1, It is characterized in that Also includes: If the business data corresponding to the stream computing job to be processed is obtained, a stream computing operation is performed on the business data corresponding to the stream computing job to obtain corresponding first business data; Read the data lake table corresponding to the business and containing the second business data, and write the first business data into the data lake table corresponding to the business to complete the stream-to-batch operation.
7. The method according to claim 1, It is characterized in that Also includes: If the business data corresponding to the batch computing job to be processed is obtained, a batch computing operation is performed on the business data corresponding to the batch computing job to obtain corresponding second business data; Read the data lake table corresponding to the business and containing the first business data, and write the second business data into the data lake table corresponding to the business to complete the batch fill flow operation.
8. The method according to claim 1, It is characterized in that Also includes: Obtain a specified business occurrence time, and obtain business data of a stream computing job corresponding to the specified business occurrence time; A stream computing operation is performed on the business data corresponding to the stream computing job to obtain corresponding first business data.
9. A business data processing device, It is characterized in that include: An acquisition unit, used to acquire business data corresponding to the stream computing job to be processed and business data corresponding to the batch computing job; A processing unit, configured to perform a stream computing operation on the business data corresponding to the stream computing job to obtain the corresponding first business data, and to perform a batch computing operation on the business data corresponding to the batch computing job to obtain the corresponding second business data; The processing unit is further used to write the first business data and the second business data into the data lake table corresponding to the business; The processing unit is also used to deduplicate the business data in the data lake table in the order of business occurrence time; The storage unit is used to store the deduplicated data lake table.
10. An electronic device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.
12. A computer program product, It is characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.
