Data processing method, device and equipment based on Spark engine
Through the data processing method based on the Spark engine, data is stored directly from the business database to the Spark engine server, which solves the problems of low data processing efficiency and high cost and achieves efficient data processing.
Patent Information
- Application Number
- CN202410902911.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-07-08
AI Technical Summary
Due to the incompleteness, inconsistency and abnormality of business data in data processing, the existing technology results in low data processing efficiency and reliance on cache libraries, which increases costs.
Using the data processing method based on the Spark engine, by obtaining the relationship between the data source node and the combined query node, a data processing workflow is generated, and the data is directly stored from the business database of the data source to the Spark engine server, avoiding writing to the cache library, and directly from Obtain business data from storage space.
It improves data processing efficiency, reduces data processing costs, and avoids dependence on cache libraries.
Smart Images

Figure CN118445309B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a data processing method, apparatus and device based on a Spark engine. Background Art
[0002] Since massive amounts of business data often contain incomplete, inconsistent, and abnormal data, data processing of business data is particularly important. Data processing usually includes data sampling, data splitting, combined query, multiple data merging, conditional filtering of data, and data cleaning.
[0003] Take combined query as an example, combined query means selecting fields from the input data set and performing aggregate calculations on the data corresponding to the fields. In related technologies, when a user performs a combined query operation in the system interface, due to the huge amount of data being queried or the poor performance of the business library, the system will first write the business data in the data set into the cache library, then read the fields of the business data and the business data corresponding to the fields from the cache library, and perform aggregate calculations on the business data corresponding to the fields.
[0004] However, writing business data into the cache library takes a certain amount of time, which reduces data processing efficiency. In addition, maintaining the cache library requires additional costs. Summary of the invention
[0005] The embodiment of the present application provides a data processing method, apparatus and device based on the Spark engine, which can improve data processing efficiency and reduce data processing costs. The technical solution is as follows:
[0006] In a first aspect, an embodiment of the present application provides a data processing method based on a Spark engine, comprising the steps of:
[0007] Acquire the data source node, the combined query node and the node flow relationship formed by the data source node and the combined query node through the workflow line selected from the data processing interface; generate the data processing workflow according to the data source node, the combined query node and the node flow relationship;
[0008] In response to the trigger operation on the data source node, the Spark engine obtains the business data from the business database corresponding to the data source node, and stores the business data in the storage space of the server where the Spark engine is located;
[0009] In response to the triggering operation on the combined query node, various fields in the business data are obtained from the storage space according to the data processing workflow, and a combined query interface is displayed; wherein the combined query interface displays various fields in the business data;
[0010] In response to a trigger operation of selecting and determining a target field from various fields, data corresponding to the target field is obtained from a storage space through a Spark engine; and the data corresponding to the target field is displayed on a combined query interface.
[0011] In a second aspect, an embodiment of the present application provides a data processing device based on a Spark engine, comprising:
[0012] The data processing workflow generation module is used to obtain the data source node, the combined query node selected from the data processing interface, and the node flow relationship formed by the data source node and the combined query node through the workflow line; generate the data processing workflow according to the data source node, the combined query node and the node flow relationship;
[0013] A business data storage module is used to respond to a trigger operation on a data source node, obtain business data from a business database corresponding to the data source node through a Spark engine, and store the business data in a storage space of a server where the Spark engine is located;
[0014] A combined query interface display module is used to respond to a trigger operation on a combined query node, obtain various fields in the business data from the storage space according to the data processing workflow, and display the combined query interface; wherein the combined query interface displays various fields in the business data;
[0015] The data display module is used to respond to the trigger operation of selecting and determining the target field from various fields, obtain the data corresponding to the target field from the storage space through the Spark engine; and display the data corresponding to the target field on the combined query interface.
[0016] In a third aspect, an embodiment of the present application provides a computer device, a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of the first aspect when executing the computer program.
[0017] The embodiment of the present application obtains the data source node, the combined query node selected from the data processing interface, and the node flow relationship formed by the data source node and the combined query node through the workflow line; generates a data processing workflow according to the data source node, the combined query node and the node flow relationship; in response to the trigger operation of the data source node, obtains business data from the business database corresponding to the data source node through the Spark engine, and stores the business data in the storage space of the server where the Spark engine is located; in response to the trigger operation of the combined query node, according to the data processing workflow, obtains each field in the business data from the storage space, and displays the combined query interface; wherein the combined query interface displays each field in the business data; in response to the trigger operation of selecting and determining the target field from each field, obtains the data corresponding to the target field from the storage space through the Spark engine; and displays the data corresponding to the target field on the combined query interface. The present application stores the business data of the data source in the storage space of the server where the Spark engine is located through the Spark engine, and directly obtains the business data from the storage space, without writing the business data into the cache library, thereby improving the data processing efficiency, and no longer relying on the cache library, reducing the data processing cost.
[0018] For better understanding and implementation, the technical solution of the present application is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a data processing method based on the Spark engine provided in an embodiment of the present application;
[0020] Figure 2 A schematic diagram of the structure of a data processing device based on the Spark engine provided in an embodiment of the present application;
[0021] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] 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.
[0023] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0024] It should be understood that, although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" / "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determination".
[0025] The data processing method based on the Spark engine in the embodiment of the present application can be applied to the data processing scenario of the business intelligence (BI) system. The data processing method based on the Spark engine provided in the embodiment of the present application can be executed by a data processing device based on the Spark engine, which can be implemented by software and / or hardware. The data processing device based on the Spark engine can be composed of two or more physical entities, or it can be composed of one physical entity. The data processing device based on the Spark engine can be any electronic device installed with data processing software, and the electronic device can be a smart device such as a computer, a mobile phone or a tablet.
[0026] See also Figure 1 , Figure 1 The present invention provides a flowchart of a data processing method based on the Spark engine according to the first embodiment of the present invention. The method comprises the following steps:
[0027] S10: Obtain the data source node, combined query node and node flow relationship formed by the data source node and the combined query node through the workflow line selected from the data processing interface; generate a data processing workflow according to the data source node, combined query node and node flow relationship.
[0028] Among them, the data processing interface is used to design customized data processing workflows. The data processing interface includes a node resource area, a canvas area, and a toolbar. The node resource area displays multiple data source nodes and data processing nodes. The data source nodes include but are not limited to example data source nodes, relationship data source nodes, data sets, and Excel files. Each data source node corresponds to a business database, and the business database stores business data. For example, if the data source node is an Excel file, a large number of business data tables in Excel format are stored in the business database corresponding to the data source node. Data processing nodes include but are not limited to combined queries, data sampling, data splitting, combined queries, multiple data merges, data filtering, and data cleaning. The canvas area is used to display the data processing workflow, and the toolbar is used to operate the data processing workflow.
[0029] Among them, combined query refers to selecting fields from the input data set, displaying the business data corresponding to the fields, and supporting aggregate calculations on the fields.
[0030] The node flow relationship is used to indicate the execution order of each node in the data processing workflow.
[0031] In the embodiment of the present application, the data processing interface is an ETL process customization interface, the data processing workflow is an ETL workflow, the user selects a data source node and a combined query node from the node resource area of the ETL process customization interface, wherein the data source node may be an example data source node, drags the data source node and the combined query node to the canvas area, and connects the data source node and the combined query node with a workflow line to generate an ETL workflow. Among them, the node flow relationship in the ETL workflow is from the data source node to the combined query node.
[0032] S20: In response to a trigger operation on a data source node, the Spark engine obtains business data from a business database corresponding to the data source node, and stores the business data in a storage space of a server where the Spark engine is located.
[0033] Among them, the Spark engine is a fast and general computing engine designed specifically for large-scale data processing.
[0034] In the embodiment of the present application, there is a binding relationship between the ETL workflow and the Spark engine, and the ETL workflow is executed through the Spark engine. The user clicks the data source node in the canvas area, and the BI system detects the user's operation of clicking the data source node. The BI system calls the Spark engine, obtains business data from the business database corresponding to the data source node, and stores the business data in the storage space of the server where the Spark engine is located.
[0035] S30: In response to the triggering operation on the combined query node, various fields in the business data are obtained from the storage space according to the data processing workflow, and a combined query interface is displayed; wherein the combined query interface displays various fields in the business data.
[0036] In the embodiment of the present application, the user clicks the combined query node in the canvas area, and the BI system detects the user's operation of clicking the combined query node. The BI system generates a Spark data table according to the data processing workflow, obtains each field in the business data from the storage space of the server where the Spark engine is located according to the Spark data table through the Spark engine, and displays the combined query interface according to each field. Among them, the combined query interface can be displayed in the form of a pop-up window on the ETL process customization interface, or it can be a new interface after the ETL process customization interface jumps.
[0037] S40: In response to a trigger operation of selecting and determining a target field from various fields, data corresponding to the target field is obtained from a storage space through a Spark engine; and the data corresponding to the target field is displayed on a combined query interface.
[0038] The target field is at least one field among the fields.
[0039] In an embodiment of the present application, the combined query interface includes a data selection area, a data display area, and a toolbar. The data selection area displays the various fields of business data, the name of the data source, and the table name of the Spark table. The data display area is used to display business data, and the toolbar is used to operate the combined query interface, including function buttons such as save, refresh, and view SQL. The save button is used to save the current combined query, the refresh button is used to refresh the current combined query data, and the view SQL button is used to view the SQL statement executed by the current combined query.
[0040] The user selects the target field from the multiple fields in the data selection area. The BI system detects the user's selection operation on the target field, obtains the data corresponding to the target field from the storage space of the server where the Spark engine is located through the Spark engine, and displays the target field and the data corresponding to the target field in the data presentation area. Specifically, the data presentation area is displayed in a table format, the target field is the header of each column in the table, and the data corresponding to the target field is the specific data of each column in the table.
[0041] The embodiment of the present application is applied, by obtaining the data source node, the combined query node selected from the data processing interface, and the node flow relationship formed by the data source node and the combined query node through the workflow line; according to the data source node, the combined query node and the node flow relationship, a data processing workflow is generated; in response to the trigger operation of the data source node, the business data is obtained from the business database corresponding to the data source node through the Spark engine, and the business data is stored in the storage space of the server where the Spark engine is located; in response to the trigger operation of the combined query node, according to the data processing workflow, each field in the business data is obtained from the storage space, and the combined query interface is displayed; wherein the combined query interface displays each field in the business data; in response to the trigger operation of selecting and determining the target field from each field, the data corresponding to the target field is obtained from the storage space through the Spark engine; the data corresponding to the target field is displayed on the combined query interface. The present application stores the business data of the data source in the storage space of the server where the Spark engine is located through the Spark engine, and directly obtains the business data from the storage space through the Spark engine, without writing the business data into the cache library, thereby improving the data processing efficiency, and no longer relying on the cache library, reducing the data processing cost.
[0042] In an optional embodiment, step S20, including S201 to S203, is specifically as follows:
[0043] S201: In response to a trigger operation on a data source node, an identifier of the data source node and an identifier of a data processing workflow where the data source node is located are obtained.
[0044] The identifier of the data source node is used to uniquely identify the data source node. Specifically, the identifier of the data source node can be a number, a letter, or the like.
[0045] The identifier of the data processing workflow where the data source node is located is used to uniquely identify the data processing workflow. Specifically, the identifier of the data processing workflow where the data source node is located can be a number such as a number or a letter.
[0046] In an embodiment of the present application, the canvas area may have multiple ETL workflows, and each ETL workflow may have a corresponding data source node. The user clicks a data source node in an ETL workflow in the canvas area to obtain the identifier of the data source node and the identifier of the ETL workflow where the data source node is located.
[0047] S202: Generate a storage address of the server where the Spark engine is located according to the identifier of the data source node and the identifier of the data processing workflow.
[0048] In an embodiment of the present application, a preset storage address generation algorithm is used to generate a storage address of the server where the Spark engine is located according to the identifier of the data source node and the identifier of the data processing workflow.
[0049] S203: Obtain business data from the business database corresponding to the data source node through the Spark engine, and store the business data in the storage space corresponding to the storage address.
[0050] In an embodiment of the present application, the business data obtained from the business database corresponding to the data source node is stored in the storage space corresponding to the storage address through the Spark engine. Specifically, the business data can be stored in the storage space corresponding to the storage address in a preset file format, and the business data can also be compressed to store the compressed file in the storage space corresponding to the storage address.
[0051] Based on the identifier of the data source node and the identifier of the data processing workflow, the storage address of the business data in the storage space is generated. Since both the BI system and the Spark engine can obtain the identifier of the data source node and the identifier of the data processing workflow, when the combined query interface is subsequently displayed, there is no need for the Spark engine to inform the BI system of the storage address of the business data, which saves the data processing process and further improves the data processing efficiency. Moreover, since the identifier of the data source node and the identifier of the data processing workflow are unique, the storage address generated according to the identifier of the data source node and the identifier of the data processing workflow is also unique, which can avoid confusion in the storage address of the business data.
[0052] In an optional embodiment, step S30, including S301 to S304, is specifically as follows:
[0053] S301: In response to a trigger operation on a combined query node, an identifier of a data source node is obtained according to a node flow relationship of a data processing workflow.
[0054] In an embodiment of the present application, taking into account the situation where there are multiple data source nodes and multiple data processing nodes in the data processing workflow, after the user clicks on the combined query node, the BI system obtains the identifier of the data source node of the data processing workflow where the combined query node is located based on the node flow relationship of the data processing workflow where the combined query node is located.
[0055] S302: Obtain an identifier of a data processing workflow; generate a first address according to the identifier of the data processing workflow and an identifier of a data source node.
[0056] In an embodiment of the present application, the BI system obtains the identifier of the data processing workflow where the combined query node is located, and uses a preset address generation algorithm to generate a first address according to the identifier of the data processing workflow and the identifier of the data source node.
[0057] S303: Generate data table metadata according to a preset data table name, a preset data format, and a first address.
[0058] The preset data table name can be automatically generated according to the preset rules, and the preset data format can be manually set according to actual needs. The preset data format includes but is not limited to PARQUET and ORC formats.
[0059] In the embodiment of the present application, the BI system generates a data table metadata tableSchema according to a preset data table name, a preset data format, and a first address. An example of the data table metadata tableSchema is as follows:
[0060] {
[0061] "tableName": "table1",
[0062] "storageFormat": "PARQUET",
[0063] "location": "file: / / / D:\\SmartbiMining\\data\\event\\I8a8a9f280189f2c0f2c00b180189f86193fe006a\\c82f011a84b40e0a4c1a0c29866420d9 / dataset"
[0064] }
[0065] Among them, table1 is the preset data table name, PARQUET is the preset data format, and file: / / / D:\\SmartbiMining\\data\\event\\I8a8a9f280189f2c0f2c00b180189f86193fe006a\\c82f011a84b40e0a4c1a0c29866420d9 / dataset is the first address.
[0066] S304: According to the data table metadata, various fields of the business data are obtained from the storage space through the Spark engine, and a combined query interface is displayed.
[0067] In an embodiment of the present application, the BI system accesses the Spark engine through a JDBC driver and sends the data table metadata to the Spark engine. The Spark engine obtains each field of the business data from the storage space according to the preset data format and the first address in the data table metadata, and displays a combined query interface according to the preset data table name and each field.
[0068] Based on the data table metadata generated by the BI system, the Spark engine can automatically and quickly obtain business data from the storage space, thereby improving data processing efficiency.
[0069] In an optional embodiment, the step of storing the business data in the storage space of the server where the Spark engine is located includes:
[0070] S21: Storing the business data in a data file in a first data format in a storage space of a server where the Spark engine is located.
[0071] In the embodiment of the present application, the first data format is PARQUET, and the business data is stored in the PARQUET file format in the storage space corresponding to the storage address of the server where the Spark engine is located through the Spark engine.
[0072] The steps of obtaining various fields of business data from the storage space through the Spark engine according to the data table metadata and displaying the combined query interface include:
[0073] S31: According to the first address, obtain the data file corresponding to the business data from the storage space through the Spark engine.
[0074] In the embodiment of the present application, since the first address and the storage address are both generated according to the identifier of the data source node and the identifier of the data processing workflow, the first address and the storage address are consistent.
[0075] According to the first address, the data file corresponding to the business data can be obtained from the storage space corresponding to the storage address through the Spark engine.
[0076] S32: Match the preset data format with the first data format through the Spark engine. If the match is consistent, parse the data file to obtain business data.
[0077] In the embodiment of the present application, after obtaining the data file corresponding to the business data through the Spark engine, it is necessary to match the preset data format with the first data format. If the match is consistent, the data file is parsed to obtain the business data. If the match is inconsistent, a prompt "data format inconsistent, parsing failed" is displayed.
[0078] S33: Identify fields from the business data, and obtain the name and type of each field.
[0079] In the embodiment of the present application, the business data includes several dimension fields and metric fields, each field has a corresponding name and type. Specifically, the field type includes but is not limited to integer, floating point and string.
[0080] S34: Generate a data table according to the name and type of each field in the business data and the preset data table name.
[0081] In an embodiment of the present application, the Spark engine generates a Spark data table according to the name, type and preset data table name of each field in the business data.
[0082] S35: Display a combination query interface according to the data table.
[0083] In the embodiment of the present application, the data table name displayed in the combined query interface is the name of the Spark data table, and the various fields displayed in the combined query interface are the various fields in the Spark data table.
[0084] By matching the preset data format with the first format, the data file corresponding to the business data can be successfully parsed, each field of the business data can be obtained, and the combined query interface can be displayed.
[0085] In an optional embodiment, after step S304, steps S3041 to S3042 are included, which are specifically as follows:
[0086] S3041: Storing the data table metadata in the first storage space.
[0087] In the embodiment of the present application, after generating the data table metadata, the BI system stores the data table metadata in a preset location of the first storage space, and the first storage space is the storage space of the server where the BI system is located.
[0088] S3042: If the process of the data processing workflow is restarted, restore the data table metadata from the first storage space.
[0089] In the embodiment of the present application, an exception may occur in the process of executing the ETL workflow, resulting in the need to restart the process. When the process of the ETL workflow is restarted, the data table metadata can be directly retrieved from the first storage space using a recovery tool.
[0090] By storing the data table metadata in the first storage space, the data table metadata can be restored in time after the process is restarted, and there is no need to regenerate the data table metadata, thereby improving data processing efficiency.
[0091] In an optional embodiment, step S40 includes steps S401 to S402, which are specifically as follows:
[0092] S401: In response to a trigger operation of selecting a target field from various fields, a data query statement is generated.
[0093] In the embodiment of the present application, the user selects the target field in the combined query interface, and the BI system automatically generates a data query statement according to the target field selected by the user, wherein the data query statement is an SQL statement.
[0094] S402: Send the data query statement to the Spark engine, so that the Spark engine obtains data corresponding to the target field from the storage space according to the data query statement.
[0095] In the embodiment of the present application, the BI system accesses the Spark engine through the JDBC driver, sends the data query statement to the Spark engine, and the Spark engine obtains the data corresponding to the target field in the business data from the storage space corresponding to the storage address on the server where the Spark engine is located according to the data query statement. Among them, the JDBC driver is a self-developed driver for the BI system to access the Spark engine.
[0096] With the help of the Spark engine, the BI system can obtain business data from the storage space and no longer needs to rely on the cache library, which improves data processing efficiency and reduces data processing costs.
[0097] In an optional embodiment, the data processing method based on the Spark engine further includes:
[0098] S50: In response to a trigger operation on a target field, displaying several aggregation processing modes of the target field.
[0099] In an embodiment of the present application, a plurality of aggregation processing modes can be set for the target field, and the aggregation processing modes include but are not limited to total value, maximum value, minimum value, average value, count, and unique count. The corresponding aggregation processing mode can be set according to the field type of the target field. Specifically, if the field type is character type, the aggregation processing mode includes count and unique count. If the field type is integer or floating point type, the aggregation processing mode is total value, maximum value, minimum value, average value, count, and unique count.
[0100] S60: In response to a selection instruction for a target aggregation processing method, the data corresponding to the target field is aggregated to obtain an aggregation processing result; the aggregation processing result is displayed on a combined query interface; wherein the target aggregation processing method is an aggregation processing method selected from several aggregation processing methods.
[0101] In an embodiment of the present application, a user can click on a target field in the data presentation area of a combined query interface to display an operation drop-down box for the target field. The operation drop-down box includes a variety of aggregation processing methods for the target field. After a user selects a target aggregation processing method, the data corresponding to the target field is aggregated accordingly according to the target aggregation processing method to obtain an aggregation processing result, which is then displayed on the combined query interface.
[0102] By setting multiple aggregation processing methods for the target field, users can aggregate the query data according to their needs.
[0103] In an optional embodiment, step S60 includes steps S601-S602, which are specifically as follows:
[0104] S601: In response to a selection instruction for a target aggregation processing method, determining an aggregation function corresponding to the target aggregation processing method.
[0105] In the embodiment of the present application, each aggregation processing method corresponds to an aggregation function. After the user selects the target aggregation processing method, the BI system obtains the aggregation function corresponding to the target aggregation method.
[0106] S602: According to the aggregation function, the data corresponding to the target field is aggregated to obtain an aggregation result.
[0107] In the embodiment of the present application, the BI system can quickly calculate the aggregation operation result of the data corresponding to the target field according to the aggregation function corresponding to the target aggregation method.
[0108] By setting corresponding aggregation functions for various aggregation processing methods, users can perform aggregation operations on query data according to their needs.
[0109] See also Figure 2 , Figure 2 The data processing device 5 based on the Spark engine provided in the present application is a structural diagram. The data processing device 5 based on the Spark engine provided in the present application embodiment includes:
[0110] The data processing workflow generation module 51 is used to obtain the data source node, the combined query node and the node flow relationship formed by the data source node and the combined query node through the workflow line selected from the data processing interface; generate the data processing workflow according to the data source node, the combined query node and the node flow relationship;
[0111] The business data storage module 52 is used to obtain business data from the business database corresponding to the data source node through the Spark engine in response to the trigger operation on the data source node, and store the business data in the storage space of the server where the Spark engine is located;
[0112] The combined query interface display module 53 is used to respond to the trigger operation of the combined query node, obtain various fields in the business data from the storage space according to the data processing workflow, and display the combined query interface; wherein the combined query interface displays various fields in the business data;
[0113] The data display module 54 is used to respond to the trigger operation of selecting and determining the target field from various fields, obtain the data corresponding to the target field from the storage space through the Spark engine, and display the data corresponding to the target field on the combined query interface.
[0114] The embodiment of the present application is applied, by obtaining the data source node, the combined query node selected from the data processing interface, and the node flow relationship formed by the data source node and the combined query node through the workflow line; according to the data source node, the combined query node and the node flow relationship, a data processing workflow is generated; in response to the trigger operation of the data source node, the business data is obtained from the business database corresponding to the data source node through the Spark engine, and the business data is stored in the storage space of the server where the Spark engine is located; in response to the trigger operation of the combined query node, according to the data processing workflow, each field in the business data is obtained from the storage space, and the combined query interface is displayed; wherein the combined query interface displays each field in the business data; in response to the trigger operation of selecting and determining the target field from each field, the data corresponding to the target field is obtained from the storage space through the Spark engine; the data corresponding to the target field is displayed on the combined query interface. The present application stores the business data of the data source in the storage space of the server where the Spark engine is located through the Spark engine, and directly obtains the business data from the storage space through the Spark engine, without writing the business data into the cache library, thereby improving the data processing efficiency, and no longer relying on the cache library, reducing the data processing cost.
[0115] See also Figure 3 , is a schematic diagram of the structure of the computer device provided in this application. Figure 3 As shown, the computer device 21 may include: a processor 210, a memory 211, and a computer program 212 stored in the memory 211 and executable on the processor 210, for example: a data processing program based on a Spark engine; when the processor 210 executes the computer program 212, the steps in the above-mentioned embodiment are implemented.
[0116] Among them, the processor 210 may include one or more processing cores. The processor 210 uses various interfaces and lines to connect various parts in the computer device 21, and executes various functions and processes data of the computer device 21 by running or executing instructions, programs, code sets or instruction sets stored in the memory 211, and calling the data in the memory 211. Optionally, the processor 210 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programble Logic Array, PLA). The processor 210 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the touch display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 210, but implemented separately through a chip.
[0117] The memory 211 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 211 includes a non-transitory computer-readable storage medium. The memory 211 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 211 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch instructions, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 211 may also be optionally at least one storage device located away from the aforementioned processor 210.
[0118] The embodiment of the present application also provides a computer storage medium, which can store multiple instructions. The instructions are suitable for being loaded by a processor and executing the method steps of the above embodiment. The specific execution process can be found in the specific description of the above embodiment, which will not be repeated here.
[0119] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0120] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0121] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0122] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0123] The units described as separate components may or may not be physically separated, and the components shown as units 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0125] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc.
[0126] The present invention is not limited to the above-mentioned embodiments. If various changes or modifications to the present invention do not depart from the spirit and scope of the present invention, and if these changes and modifications fall within the scope of the claims and equivalent technologies of the present invention, the present invention is also intended to include these changes and modifications.
Claims
1. A data processing method based on Spark engine, It is characterized in that The method comprises the following steps: Acquire a data source node, a combined query node, and a node flow relationship formed by the data source node and the combined query node through a workflow line selected from a data processing interface; generate a data processing workflow according to the data source node, the combined query node, and the node flow relationship; In response to a trigger operation on the data source node, obtaining business data from a business database corresponding to the data source node through the Spark engine, and storing the business data in a storage space of a server where the Spark engine is located; In response to the triggering operation on the combined query node, each field in the business data is obtained from the storage space according to the data processing workflow, and a combined query interface is displayed; wherein the combined query interface displays each field in the business data; In response to a trigger operation of selecting and determining a target field from each of the fields, data corresponding to the target field is obtained from the storage space through the Spark engine; and the data corresponding to the target field is displayed on the combined query interface.
2. The data processing method based on the Spark engine according to claim 1, Features: The step of obtaining business data from a business database corresponding to the data source node through the Spark engine in response to a trigger operation on the data source node, and storing the business data in a storage space of a server where the Spark engine is located, comprises: In response to a trigger operation on the data source node, acquiring an identifier of the data source node and an identifier of a data processing workflow where the data source node is located; Generate a storage address of a server where a Spark engine is located according to the identifier of the data source node and the identifier of the data processing workflow; The Spark engine obtains business data from the business database corresponding to the data source node, and stores the business data in the storage space corresponding to the storage address.
3. The data processing method based on the Spark engine according to claim 1, Features: In response to a trigger operation on the combined query node, the steps of acquiring each field in the business data from the storage space according to the data processing workflow and displaying a combined query interface include: In response to a trigger operation on the combined query node, an identifier of a data source node is obtained according to a node flow relationship of the data processing workflow; Obtaining an identifier of the data processing workflow; generating a first address according to the identifier of the data processing workflow and the identifier of the data source node; Generate data table metadata according to a preset data table name, a preset data format and the first address; According to the data table metadata, each field of the business data is obtained from the storage space through the Spark engine, and a combined query interface is displayed.
4. The data processing method based on the Spark engine according to claim 3, Features: The step of storing the business data in the storage space of the server where the Spark engine is located includes: Storing the business data in a data file in a first data format in a storage space of a server where the Spark engine is located; The step of acquiring various fields of the business data from the storage space through the Spark engine according to the data table metadata and displaying a combined query interface includes: According to the first address, obtaining a data file corresponding to the business data from the storage space through the Spark engine; Matching the preset data format with the first data format through the Spark engine, and if the matches are consistent, parsing the data file to obtain the business data; Identify fields from the business data and obtain the name and type of each field; Generate a data table according to the name and type of each field in the business data and the preset data table name; According to the data table, a combined query interface is displayed.
5. The data processing method based on the Spark engine according to claim 3, Features: After the step of generating data table metadata according to the preset data table name, the preset data format and the first address, the method further includes: Storing the data table metadata in a first storage space; If the process of the data processing workflow is restarted, the data table metadata is restored from the first storage space.
6. The data processing method based on the Spark engine according to any one of claims 1 to 5, Features: The step of obtaining data corresponding to the target field from the storage space through the Spark engine in response to the trigger operation of selecting and determining the target field from the fields includes: In response to a trigger operation of selecting a target field from each of the fields, generating a data query statement; The data query statement is sent to the Spark engine, so that the Spark engine obtains the data corresponding to the target field from the storage space according to the data query statement.
7. The data processing method based on the Spark engine according to any one of claims 1 to 5, It is characterized in that Also includes: In response to a trigger operation on the target field, displaying several aggregation processing modes of the target field; In response to a selection instruction for a target aggregation processing method, the data corresponding to the target field is aggregated to obtain an aggregation processing result; the aggregation processing result is displayed on the combined query interface; wherein the target aggregation processing method is an aggregation processing method selected from several aggregation processing methods.
8. The data processing method based on the Spark engine according to claim 7, Features: The step of performing aggregation processing on the data corresponding to the target field in response to the selection instruction for the target aggregation processing mode to obtain the aggregation processing result includes: In response to a selection instruction for a target aggregation processing mode, determining an aggregation function corresponding to the target aggregation processing mode; According to the aggregation function, the data corresponding to the target field is aggregated to obtain an aggregation result.
9. A data processing device based on Spark engine, It is characterized in that include: A data processing workflow generation module, used to obtain a data source node and a combined query node selected from a data processing interface and form a node flow relationship between the data source node and the combined query node through a workflow line; Generate a data processing workflow according to the data source node, the combined query node and the node flow relationship; A business data storage module, used to respond to a trigger operation on the data source node, obtain business data from the business database corresponding to the data source node through the Spark engine, and store the business data in the storage space of the server where the Spark engine is located; A combined query interface display module, for responding to a trigger operation on the combined query node, obtaining each field in the business data from the storage space according to the data processing workflow, and displaying a combined query interface; wherein the combined query interface displays each field in the business data; The data display module is used to respond to the trigger operation of selecting and determining the target field from each of the fields, obtain the data corresponding to the target field from the storage space through the Spark engine; and display the data corresponding to the target field on the combined query interface.
10. A computer device, include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when executing the computer program.
Citation Information
Patent Citations
Power supply customer value evaluation method based on customer portrait technology and big data platform
CN111640040A
Data query method and device, electronic equipment and storage medium
CN114090631A
Data analysis over the combination of relational and big data
US20190361999A1
Data platform fabric
US20190362004A1
Data query method and apparatus, storage medium, and electronic device
WO2023029854A1
