CN115729552B - Methods and apparatus for setting operator-level parallelism - Google Patents

Methods and apparatus for setting operator-level parallelism

Info

Publication number
CN115729552B
CN115729552B CN202111000399.XA CN202111000399A CN115729552B CN 115729552 B CN115729552 B CN 115729552B CN 202111000399 A CN202111000399 A CN 202111000399A CN 115729552 B CN115729552 B CN 115729552B
Authority
CN
China
Prior art keywords
parallelism
execution plan
script
task
flink
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111000399.XA
Other languages
Chinese (zh)
Other versions
CN115729552A (en
Inventor
孟梁
夏宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Petal Cloud Technology Co Ltd
Original Assignee
Petal Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Petal Cloud Technology Co Ltd filed Critical Petal Cloud Technology Co Ltd
Priority to CN202111000399.XA priority Critical patent/CN115729552B/en
Publication of CN115729552A publication Critical patent/CN115729552A/en
Application granted granted Critical
Publication of CN115729552B publication Critical patent/CN115729552B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a setting method and a device for parallelism of operator levels, relates to the field of data processing, and is used for supporting manual setting of parallelism of operator levels. The method comprises the steps of sending a first Flink SQL task to a client, receiving a target execution plan which is sent by the client and comprises an execution plan and a parallelism reference value, wherein the target execution plan is in json format, the parallelism reference value is a parallelism reference value of a node in the execution plan, the execution plan is generated by analyzing the first Flink SQL task, the parallelism reference value of the node in the execution plan is determined according to script information obtained by analyzing the first Flink SQL task, a first data flow graph is provided by analyzing the target execution plan, a second Flink SQL task is sent to the client, the second FlinkSQL task comprises first parallelism, the SQL script and written configuration parameters, and the first parallelism is obtained by modifying the editable parallelism of the first data flow graph.

Description

Operator level parallelism setting method and device
Technical Field
The application relates to the technical field of data processing, in particular to a method and a device for setting parallelism of operator levels.
Background
In the field of data processing, whether real-time data processing or offline data processing, the simplified development of SQL is a future overall development trend. The Flink SQL realized based on the Flink is a set of development language which is designed for simplifying a calculation model and reducing a calculation threshold used by a user and accords with a standard SQL language, and the Flink SQL has been widely applied to batch stream data processing. Parallelism is typically required when processing data using Flink SQL. Parallelism is a very important concept in flank SQL. The reasonable parallelism is set, so that the data processing efficiency can be improved, and the unreasonable parallelism can cause efficiency reduction and even task errors. A Flink SQL program includes a plurality of tasks. One task is performed by multiple parallel instances, which are the parallelism of the flank SQL. But the parallelism of the current part level (e.g. operator level) does not support manual setting by the user.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method and apparatus for setting parallelism of operator levels, which can support manual setting of parallelism of operator levels.
According to the method, a first Flink SQL task is sent to a client, the first Flink SQL task comprises a written SQL script, a target execution plan which is sent by the client and comprises an execution plan and a parallelism reference value is received, the target execution plan is in json format, the parallelism reference value is a parallelism reference value of a node in the execution plan, the execution plan is generated by analyzing the first Flink SQL task, the parallelism reference value of the node in the execution plan is determined according to script information obtained by analyzing the first Flink SQL task, the script information comprises at least two items of script types, partition size of a source end, operator data flow and file size of the source end, the script types comprise at least one item of a stream processing script and a batch processing script, first data are provided for operation through the target execution plan in json format, the first data are included in the parallelism reference value, the first data can be sent to the first Flink SQL task by analyzing the parallelism reference value of the node, the first Flink SQL task is edited according to script information obtained by analyzing the first Flink SQL task, the parallelism reference value of the first Flink SQL task can be edited, and the parallelism flow graph of the first Flink SQL task can be edited, and the parallelism flow graph can be obtained by the first parallel flow graph is edited, and the parallelism flow graph of the first Flink flow graph can be edited by the first parallel flow graph.
According to the application, according to the flank SQL task submitted on the electronic equipment, the execution plan generated by the client according to flank SQL task analysis and the determined parallelism reference value after analysis are received, the target execution plan comprising the execution plan and the parallelism reference value is interacted with the electronic equipment through the JSON file, the SQL execution flow is displayed in a visual data flow diagram mode, a user can conveniently and manually modify the parallelism of an operator in the data flow diagram, and the task is re-submitted according to the operation of the user, so that the parallelism can be automatically optimized through the parallelism reference value, the operator level parallelism of the flank SQL task can be flexibly and manually set through the visual data flow diagram, and the processing efficiency of the task can be submitted.
According to some embodiments of the application, the method further comprises providing a second dataflow graph for operation, wherein the second dataflow graph includes an editable parallelism, the second dataflow graph is obtained after the editable parallelism of the first dataflow graph is operated, generating prompt information according to the running state of the second Flink SQL task, wherein the running state of the second Flink SQL task is obtained from a server running the second Flink SQL task, sending a third Flink SQL task to a client, wherein the third Flink SQL task includes the second parallelism, the compiled SQL script, and the compiled configuration parameters, and the second parallelism is obtained through modification of the editable parallelism of the second dataflow graph. The operator level parallelism of the Flink SQL task is set more flexibly and manually through the prompt information generated according to the running state of the task processed by the server, and the task processing efficiency is further improved.
According to some embodiments of the application, the first Flink SQL task is a Explain statement and the execution plan is generated by executing the Explain statement. The aim execution plan is generated later by executing the analysis operation once in advance before the prior sql-subset execution through Explain sentences, and the visual data flow diagram is realized.
According to some embodiments of the present application, if the script type of the first flank SQL task includes a stream processing script, the parallelism reference value of the node in the execution plan is determined according to at least one of the partition size of the source end and the operator data traffic. And determining the parallelism reference value of the stream processing script through at least one of the partition size of the source end and the operator data flow.
According to some embodiments of the application, if the script type of the first flank SQL task includes a batch script, the parallelism reference value of the node in the execution plan is determined according to at least one of the file size of the source and the operator data traffic. And determining the parallelism reference value of the batch script through at least one of the file size of the source end and the operator data flow.
According to some embodiments of the application, the first parallelism is spliced into the written SQL script by an-op parameter to obtain the second Flink SQL task. The first parallelism and the written SQL script can be spliced through the-op parameter, so that the parallelism can be designated for an operator.
In a second aspect, an embodiment of the application further provides a setting method of parallelism of an operator level, which is applied to a client, and the method comprises the steps of receiving a first Flink SQL task sent by electronic equipment, wherein the first Flink SQL task comprises a written SQL script, setting a parallelism reference value of a node in an execution plan according to script information obtained by analyzing the first Flink SQL task to generate a target execution plan, wherein the target execution plan comprises the execution plan and the parallelism reference value, the target execution plan is in json format, the parallelism reference value is a parallelism reference value of the node in the execution plan, the execution plan is generated by analyzing the first Flink SQL task, script information comprises at least two items of script types, partition sizes of source ends, operator data flow rates and file sizes of source ends, the script types comprise at least one item of stream processing scripts and batch processing scripts, sending the target execution plan to the electronic equipment, receiving a second Flink task sent by the electronic equipment, wherein the target execution plan comprises the execution plan and the parallelism reference value, the parallelism reference value is the parallelism reference value of the node is in json format, the parallelism reference value is generated by analyzing the first Flink SQL task, the script information comprises script types, the partition sizes of the source ends, operator data flow rates and file sizes of the source ends, and the script types are at least two items, the script types are included, the script types are sent by the script, the target execution plans, the target execution plan is sent to the electronic equipment, the target is sent by the target SQL, the target parallelism reference value is sent by the electronic equipment, the target is and the target Flink reference value, and the parallelism reference value is sent by the electronic plan, and the target is and the parallelism reference value is, and the target.
According to some embodiments of the application, the method further comprises the steps of receiving a third Flink SQL task sent by the electronic device, wherein the third Flink SQL task comprises a second parallelism, a written SQL script and configuration parameters, the second parallelism is obtained through modification of the editable parallelism of a second data flow graph according to prompt information of the electronic device, the prompt information is generated according to the running state of the second Flink SQL task, the running state of the second Flink SQL task is obtained from a server running tasks generated by the second Flink SQL task, the second data flow graph is obtained after the editable parallelism of the first data flow graph is operated, and the tasks are regenerated according to the third Flink SQL task to be submitted to the server.
According to some embodiments of the application, the first Flink SQL task is a Explain statement and the execution plan is generated by executing the Explain statement.
According to some embodiments of the application, if the script type of the first flank SQL task includes a stream processing script, a parallelism reference value of a node in the execution plan is set according to at least one of a partition size of the source end and the operator data flow.
According to some embodiments of the application, if the script type of the first flank SQL task includes a batch script, a parallelism reference value of a node in the execution plan is set according to at least one of a file size of the source and the operator data flow.
According to some embodiments of the application, the first parallelism is spliced into the written SQL script by an-op parameter to obtain the second Flink SQL task.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes a transceiver unit configured to send a first flank SQL task to a client, where the first flank SQL task includes a written SQL script, the transceiver unit is further configured to receive a target execution plan including an execution plan and a parallelism reference value sent by the client, where the target execution plan is in json format, the parallelism reference value is a parallelism reference value of a node in the execution plan, the execution plan is generated by parsing the first flank SQL task, the parallelism reference value of the node in the execution plan is determined according to script information obtained by parsing the first flank SQL task, the script information includes at least two items of a script type, a partition size of a source end, an operator data flow, and a file size of the source end, the script type includes at least one item of a stream processing script and a parallelism reference value, the processing unit is configured to provide first data for an operation by the target execution plan of json, where the parallelism reference value is a node in the execution plan, the parallelism reference value of the execution plan is generated by parsing the first flank SQL task, the parallelism reference value of the node in the execution plan includes a first data flow graph, and the parallel flow graph is further configured to obtain the parallel flow graph, and the parallel flow graph of the parallel flow graph and the parallel flow graph is edited by the first parallel flow graph.
In a fourth aspect, an embodiment of the application further provides a client, which comprises a receiving and transmitting unit, a processing unit, a target execution plan, a receiving and transmitting unit and a parallel degree reference value, wherein the receiving and transmitting unit is used for receiving a first Flink SQL task sent by electronic equipment, the first Flink SQL task comprises a written SQL script, the processing unit is used for setting a parallelism reference value of a node in an execution plan according to script information obtained by analyzing the first Flink SQL task, the target execution plan comprises the execution plan and the parallelism reference value, the target execution plan is in json format, the parallelism reference value is a parallelism reference value of the node in the execution plan, the execution plan is generated by analyzing the first Flink SQL task, the script information comprises at least two items of script types, partition sizes of a source end, operator data flow rates and file sizes of the source end, the script types comprise at least one item of a stream processing script and a batch processing script, the receiving and transmitting unit is further used for generating a target execution plan to the electronic equipment, the target execution plan comprises the execution plan and the parallelism reference value, the target execution plan is further used for receiving the execution plan and the parallelism reference value of the electronic equipment, the parallelism reference value is in json format, the parallelism reference value of the node is the node in the execution plan, the parallelism reference value is generated by analyzing the first Flink SQL task, the execution plan comprises the script information comprises at least two items of the script types, the partition sizes of the script types, the operator data flow and the file sizes of the source end, the script types are at least one item of the script.
In a fifth aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes at least one processor, a memory, and a communication interface, where the at least one processor is coupled to the memory and the communication interface, where the memory is configured to store instructions, where the processor is configured to execute the instructions, and where the communication interface is configured to communicate with a client under control of the at least one processor, where the instructions, when executed by the at least one processor, cause the at least one processor to perform a method for setting parallelism of operator levels according to any one of the possible embodiments of the first aspect above.
In a sixth aspect, an embodiment of the present application further provides a client, where the client includes at least one processor, a memory and a communication interface, where the at least one processor is coupled to the memory and the communication interface, where the memory is configured to store instructions, where the processor is configured to execute the instructions, and where the communication interface is configured to communicate with an electronic device and a server under control of the at least one processor, where the instructions, when executed by the at least one processor, cause the at least one processor to perform a method for setting parallelism of an operator level according to any one of possible embodiments of the second aspect above.
In a sixth aspect, an embodiment of the present application further provides a system for setting parallelism of an operator level, where the system for setting parallelism of an operator level includes an electronic device, a client, and a server, where the electronic device is configured to execute a method for setting parallelism of an operator level according to any one of possible embodiments of the first aspect, and the client is configured to execute a method for setting parallelism of an operator level according to any one of possible embodiments of the second aspect.
In a seventh aspect, an embodiment of the present application further provides a computer readable storage medium, where a program is stored, the program causing a computer device to execute the operator-level parallelism setting method according to any one of the possible implementation manners of the first aspect or the second aspect.
In an eighth aspect, an embodiment of the present application further provides a computer program product, where the computer program product includes computer executable instructions stored in a computer readable storage medium, where at least one processor of the apparatus may read the computer executable instructions from the computer readable storage medium, where the at least one processor executes the computer executable instructions to cause the apparatus to perform the operator level parallelism setting method according to any one of the possible implementation manners of the first aspect or the second aspect.
The detailed descriptions of the second aspect to the eighth aspect and the various implementations thereof in the present application may refer to the detailed descriptions of the first aspect and the various implementations thereof, and the beneficial effects of the second aspect to the eighth aspect and the various implementations thereof may refer to the beneficial effect analysis of the first aspect and the various implementations thereof, which are not repeated herein.
Drawings
Fig. 1 is a schematic view of an application environment according to an embodiment of the application.
Fig. 2 is a flowchart of a method for setting parallelism of operator levels according to an embodiment of the application.
FIG. 3 is a diagram illustrating setting parallelism of operator levels according to an embodiment of the application.
FIG. 4 is a schematic diagram of data platform, client and server communication and internal communication according to an embodiment of the present application.
FIG. 5 is a schematic diagram of two dataflow graphs generated by the data platform of the present application.
Fig. 6 is a schematic structural diagram of an electronic device according to the present application.
Fig. 7 is a schematic structural diagram of a client according to the present application.
Fig. 8 is a schematic hardware structure of an electronic device according to the present application.
Fig. 9 is a schematic hardware structure of a client according to the present application.
Detailed Description
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more of the described features. In describing embodiments of the present application, words such as "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described herein as "for example" in embodiments of the application should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "for example" is intended to present related concepts in a concrete fashion.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that in the present application, unless otherwise indicated, "a plurality" means two or more than two.
In the prior art, the flank supports setting parallelism at different levels. The parallelism level includes an operator level, an execution environment level, a client level, and a system hierarchy level. The priorities of the different levels of parallelism are different. The priority of the parallelism of the level is operator level > execution environment level > client level > system hierarchy level. Wherein, the high level of parallelism overrides the low level setting, and the high level of parallelism is set to take effect preferentially. Without setting other levels of parallelism, the flank would use the parallelism in the default configuration file. When the parallelism of the system level is set, the parallelism in the configuration file can be set to specify the default parallelism of the task at the system level, so that the setting of the parallelism of the system level is realized. When the task is submitted to the Flink client, the parallelism can be specified through the-p parameter, and the setting of the parallelism at the client level can be realized. The parallelism of the operator level and the parallelism of the execution environment level can only be set in codes, and flexible setting cannot be performed. In the actual use process, the parallelism of the system level and the parallelism of the client level cannot meet the service requirement, and the high-efficiency processing of the data cannot be guaranteed. However, in general, for example, source, sink, operators may need different parallelism to ensure fast read and write loads of data, and the current Flink SQL does not support user settings of parallelism at the operator level, which would make efficient processing of data impossible.
Referring to fig. 1, an application environment of an embodiment of the present application is shown. As shown in fig. 1, the operator-level parallelism setting system 1 includes a data platform 10, a client 20, and a server 30. The data platform 10 is communicatively connected to a client 20 and a server 30. The client 20 is communicatively connected to a server 30. In this embodiment, the client 20 is a link client. The server 30 is a cluster of servers. A server cluster is a cluster in which a plurality of servers (for example, thousands of servers) are collected together to perform the same service. Each server in a cluster of servers may be considered a node in the cluster, with communication connections between the nodes. The server cluster is a YARN cluster. YARN cluster is a universal resource management system and can provide unified resource management and scheduling capability for the Flink SQL task. The data platform 10 is configured to send a first flank SQL task to the client 20, receive a target execution plan including an execution plan and a parallelism reference value sent by the client 20, provide a first dataflow graph for operation by parsing the target execution plan in json format, and send a second flank SQL task to the client 20. The client 20 is configured to receive a first Flink SQL task sent by an electronic device, set a parallelism reference value of a node in an execution plan according to script information obtained by analyzing the first Flink SQL task to generate a target execution plan, send the target execution plan to the electronic device, receive a second Flink SQL task sent by the electronic device, and regenerate a task according to the second Flink SQL task for submitting to the server 30. The server 30 is used for processing the tasks.
Referring to fig. 2, a flowchart of a method for setting parallelism of operator levels according to a first embodiment of the present application is shown. The operator level parallelism setting method is to set the parallelism of the nodes according to the parallelism reference value of the nodes. The operator level parallelism setting method comprises the following steps:
And S201, the data platform provides a page of man-machine interaction for operation.
The data platform can generate a page of man-machine interaction, control and display the page, and provide the page of man-machine interaction for the operation of a user. The data platform comprises a foreground and a background. The foreground may be the front end of the data platform. The background may be a server side of the data platform. The foreground and the background can exchange data. The foreground is used for generating a page, such as a webpage, of man-machine interaction. The foreground may also control the display of the visualized page. The control display is displayed by a device (such as a computer). The user may operate in the page.
And S202, the data platform acquires the SQL script and the configuration parameters written on the page, and generates a first Flink SQL task according to the written SQL script.
The configuration parameters may be, for example, a-yt parameter and a-yD parameter, etc. The yt parameter is used to transfer files under a specified directory. The yD parameter is used to use the value for a given attribute. To submit tasks to the server, the user may perform the operations of writing SQL scripts and configuration parameters on pages provided by the data platform, as shown in FIG. 3. In FIG. 3, the user performs step 1, writing SQL scripts and configuration parameters in the foreground page. According to the writing operation of the user, the foreground of the data platform can acquire the SQL script and the configuration parameters written on the page, and the written SQL script and configuration parameters are sent to the background of the data platform. It is understood that the foreground of the data platform may send the written SQL script and configuration parameters to the background of the data platform by transmitting a request including the written SQL script and configuration parameters to the background of the data platform, and the foreground of the data platform may also directly transmit the written SQL script and configuration parameters to the background of the data platform. For example, in FIG. 3, the foreground of the data platform performs step 2. Submit a request including written SQL script and configuration parameters to the background of the data platform.
In this embodiment, the background of the data platform stores the written SQL script and configuration parameters. The background of the data platform also generates a first Flink SQL task according to the written SQL script. For example, in FIG. 3, the data platform's background performs step 3. Generate the first Flink SQL task. In this embodiment, the first Flink SQL task is explain statements, such as explain flinksql _test.
And S203, the data platform sends a first Flink SQL task to the client.
In this embodiment, the background of the data platform also sends the explain statements to the client, so that the first Flink SQL task may be transferred to the client. For example, step 3 in FIG. 3 also includes sending a first Flink SQL task, and in FIG. 4, the data platform sends Explain statements to the Flink client.
And S204, the client generates an execution plan in json format by analyzing the first Flink SQL task.
In this embodiment, the client is a Flink client. The client parses the first Flink SQL task using the execute Explain statement, as shown in fig. 4. In FIG. 4, the Flink client executes the first parse SQL using Explain and generates an execution plan after parsing the SQL. The execution plan refers to a description of the execution flow of the first Flink SQL task. The execution plan is composed of a plurality of nodes. Each node comprises information such as the number of operator nodes, a specific function script of the node operators, the parallelism of the nodes and the like. The node further includes node link information. The node link information is used to identify its previous node. It will be appreciated that the node linking information may also be used to identify its next node, or to identify its previous and next nodes at the same time, as the application is not limited in this regard.
The execution plan of the first Flink SQL task is described below with two examples. In a first example, the first Flink SQL task is a filtering script, and the generated execution plan includes three nodes of a source end, an operator, and a receiver end. The information of the three nodes is respectively operator node number (id) 1, node operator specific function script: source: hiveTableSource (xxx), parallelism 1, operator node number (id) 2, node operator specific function script: calc (select= [ yyy ]), parallelism 1, operator node number (id) 3, node operator specific function script: sink: select table Sink (zzz), parallelism 1. Only the code of the related information of the operator node number 1 of the execution plan of the first example is shown in fig. 4, and the code of the related information of the operator node number 1 may be, for example:
In a second example, the first Flink SQL task is an insert script, and the generated execution plan includes two nodes of a Source end and a receiver end and information thereof, specifically, an operator node number 1, a node operator specific function script, namely Source: hiveTableSource (mmm), parallelism 3, an operator node number 2, a node operator specific function script, namely Sink: select table Sink (nnn), and parallelism 3.
S205, the client side sets a parallelism reference value of a node in an execution plan according to script information obtained by analyzing the first Flink SQL task to generate a target execution plan, wherein the script information comprises at least two items of script type, partition size of a source end, operator data flow and file size of the source end, the script type comprises at least one item of stream processing script and batch processing script, and the target execution plan is in json format.
The script information is obtained after the first Flink SQL task is analyzed. The client sets the parallelism reference value of the node in the execution plan according to the script information obtained by analyzing the first Flink SQL task, wherein if the script type of the first Flink SQL task comprises a stream processing script, the client sets the parallelism reference value of the node in the execution plan according to at least one of the partition size of the source end and the operator data flow. Continuing with the first example, the first flank SQL task is a stream processing script, the number of partitions at the source end is 15, the client end sets the parallelism reference value of the source end node in the execution plan to be 15, the function of the operator is to filter the upper layer data, the filtered data flow is about 1/3 of the upper layer data, and the client end sets the parallelism reference value of the operator node in the execution plan to be 5.
The client sets the parallelism reference value of the node in the execution plan according to the script information obtained by analyzing the first Flink SQL task, and further comprises setting the parallelism reference value of the node in the execution plan according to at least one of the file size of the source end and the operator data flow if the script type of the first Flink SQL task comprises a batch script. For example, the file size of the first flank SQL task is 1024MB, the size of each block specified by the data platform is 128MB, the file of the first flank SQL task is to be split into 8 subtasks, and then the client sets the parallelism reference value of the source end node in the execution plan to 8.
The setting of the parallelism reference value of the node in the execution plan may be adding the parallelism reference value of the node to the execution plan. The application does not limit the parallelism reference value of the node in the set execution plan.
S206, the client sends the target execution plan to the data platform.
And the client sends the target execution plan to the background of the data platform pair. For example, in FIG. 3, the client performs step 4. Transfer the target execution plan in json format to the data platform. For another example, in fig. 4, the client returns an execution plan in json format including parallelism reference values to the data platform, where the execution plan is the target execution plan.
S207, the data platform provides a first data flow graph for operation by analyzing a json format target execution plan, wherein the first data flow graph comprises editable parallelism and node parallelism reference values.
A first dataflow graph graphically depicts the process by which data flows and is processed in a system. The data platform may determine an operator execution order based on the node linking information and provide a first dataflow graph accordingly.
In this embodiment, after receiving the json-format target execution plan, the background of the data platform transmits the json-format target execution plan to the foreground of the data platform. And generating a first data flow graph by analyzing the target execution plan in the json format by the foreground of the data platform, and controlling and displaying the first data flow graph. Specifically, the foreground of the data platform may generate a first dataflow graph according to the node link information by parsing the json-format target execution plan. In FIG. 3, the background of the data platform performs step 5. Transfer the json-formatted target execution plan to the foreground of the data platform to display the first dataflow graph. A user may modify the first dataflow graph.
And S208, the data platform acquires first parallelism, splices the first parallelism, the written SQL script and the written configuration parameters to generate a second Flink SQL task, and the first parallelism is acquired through modification of the editable parallelism of the first data flow graph.
In order to modify the parallelism of the operators, the user may perform a modification operation on the parallelism of the nodes in the first dataflow graph according to the parallelism reference value of the nodes, as shown in fig. 3. In fig. 3, the user performs step 6, modifying parallelism, on the first dataflow graph. The first parallelism may be a parallelism reference value, and the first parallelism may be greater than or less than the parallelism reference value. According to the modification operation of the user, the foreground of the data platform can acquire the first parallelism and transmit the first parallelism to the background of the data platform. It is understood that the foreground of the data platform may send the first parallelism to the background of the data platform by transmitting a request including the first parallelism to the background of the data platform, and the foreground of the data platform may also directly transmit the first parallelism to the background of the data platform. For example, in FIG. 3, the foreground of the data platform performs step 7. Submit a request including a first parallelism to the background of the data platform.
The background of the data platform can splice the written SQL script and the written configuration parameters. The background of the data platform can splice the first parallelism and the written SQL script by adopting-op. The first parallelism is designated into the written SQL script through the-op parameter, so that the first parallelism, the written SQL script and the written configuration parameter can be spliced to generate a second Flink SQL task. The second Flink SQL task is a submit statement. Continuing to take the above description of setting the parallelism reference value by using the stream processing script as an example, according to the parallelism reference value, the parallelism of the number 1 of the user-modified operator nodes is 15, the parallelism of the number 2 of the user-modified operator nodes is 5, and the parallelism of the number 3 of the user-modified operator nodes is 5, and then the second flank SQL task is :sql-submit.sh-op1:15,2:5,3:5'-d"-f'xxx.sql"-ynm"flinksql_tes"-yt"/xxx/keystore"-yt"/xxx/config/"-yD''yarn.tags=xxx'.., where 1:15 represents the parallelism of the number 1 of the operator nodes is 15,2:5 represents the parallelism of the number 2 of the operator nodes is 5, and 3:5 represents the parallelism of the number 3 of the operator nodes is 5.
And S209, the data platform sends a second Flink SQL task to the client.
For example, in FIG. 3, the data platform in the background performs step 8. Send a second Flink SQL task to the client that includes the parallelism of the nodes specified by the-op parameters, the data platform may then transmit the second Flink SQL task to the client. For example, in FIG. 4, the data platform sends a submit statement to the Flink client.
And S210, the client analyzes the second Flink SQL task to obtain the first parallelism and the execution plan, and configures the first parallelism into a node of the execution plan to regenerate the task.
In this embodiment, the client executes the submit statement to parse the second Flink SQL task to obtain the first parallelism and execution plan, as shown in fig. 4. In FIG. 4, the Flink client performs a second parse SQL by executing a submit statement and generates an execution plan after parsing. The execution plan at this time is an execution plan configured with a first degree of parallelism.
S211, the client submits a task to the server.
For example, in FIG. 3, the client performs step 9. Submit the task to the server. For another example, in FIG. 4, the Flink client also publishes an execution plan configured with a first parallelism to the server. The server is a Yarn server.
S212, the server processes tasks.
In this embodiment, when the server processes the task, the running state of the task may be obtained, and the running state of the task may be transmitted to the data platform. The data platform can correspondingly prompt the running state of the user task.
The method for setting the parallelism of the operator level shown in fig. 2 is applicable not only to a scenario in which the parallelism of the node is set according to the parallelism reference value of the node, but also to a scenario in which the parallelism of the node is set according to the parallelism reference value of the node and the running state of the task processed by the server. In the case of setting the parallelism of the node according to the parallelism reference value of the node and the running state of the task processed by the server, the difference from the above-described scene of setting the parallelism of the node according to the parallelism reference value of the node of fig. 2 is that:
The target execution plan comprises a first execution plan and a second execution plan, wherein the first execution plan is an execution plan generated by analyzing the first Flink SQL task, and the second execution plan is an execution plan generated by modifying the parallelism value of the nodes in the execution plan into the parallelism reference value of the nodes. The client communicates the target execution plan to the data platform. The data platform provides two data flow diagrams for operation by analyzing a first execution plan in json format and a second execution plan in json format, wherein the first data flow diagram is a data flow diagram of original parallelism, the second data flow diagram is a data flow diagram of a parallelism reference value, and the data flow diagram comprises editable parallelism. In this embodiment, the first dataflow graph includes editable parallelism. It will be appreciated that the application is not limited to a first dataflow graph including editable parallelism, but may be used to set a second dataflow graph including editable parallelism, as the application is not limited in this respect. The parallelism of the first data flow graph and the parallelism of the second data flow graph are different. The differences include completely and partially different.
Continuing with the first example described above, both data flow graphs include three nodes, a source node, an operator node, and a receiver node, respectively, with the source node preceding the operator node and the operator node preceding the receiver node, as shown in fig. 5. In fig. 5, the upper data flow graph is the data flow graph of the parallelism reference value, and the lower data flow graph is the data flow graph of the parallelism. The number of Operator nodes of the Source end node of the Data flow graph is Data Source (id=1), the number of Operator specific function scripts of the node Operator is Source HiveTableSource (xxx), the parallelism is PARALLSLISM:15, the number of Operator nodes of the operation Operator node is Operator (id=2), the parallelism is PARALLSLISM:5, the number of Operator nodes of the receiver end node is Data Sink (id=3), the parallelism is Sink Select table Sink (zzz) and the parallelism is PARALLSLISM:5. The number of Operator nodes of the Source end node of the Data flow graph below is Data Source (id=1), the number of Operator specific function scripts of the node Operator is Source HiveTableSource (xxx), the parallelism is PARALLSLISM:1, the number of Operator nodes of the operation Operator node is Operator (id=2), the parallelism is PARALLSLISM:1, the number of Operator nodes of the receiver end node is Data Sink (id=3), the parallelism is PARALLSLISM:1. It will be appreciated that the present application is not limited to the location of the two dataflow graphs and the content and style of each dataflow graph.
The data platform further stores the first parallelism and the execution plan after transmitting the task comprising the first parallelism and the execution plan to the client, and provides a second data flow graph according to the first parallelism and the execution plan, wherein the second data flow graph is a modified first data flow graph, and the second data flow graph comprises editable parallelism. And the data platform stores the first parallelism and the execution plan of the current time after transmitting the second Flink SQL task to the client, so that the data platform displays a data flow diagram after the current modification when the next parallelism modification is carried out each time.
The data platform also obtains the running state of the task processed by the server and generates prompt information according to the running state of the task. The running state of the task processed by the server includes the processing efficiency, throughput, and the like of the operator of the task processed by the server. The hint information may be information that provides the operator and the operational state of the operator, such as providing a web page to the user that includes the operator and the processing efficiency and throughput of the operator. The user may modify the parallelism of the nodes in the second dataflow graph according to the hint information. Continuing with the above description, the parallelism of the source node, the operator node, and the receiver node of the second data flow graph is 15, 5, and 5, respectively, and after the task is submitted to the server, the data platform prompts the user that the processing efficiency of the operator node number 3 is low, so that the user can increase the parallelism of the operator node number 3 in the second data flow graph. The data platform further acquires second parallelism, splices the second parallelism, the written SQL script and the written configuration parameters to generate a third Flink SQL task, and transmits the third Flink SQL task to the client, wherein the second parallelism is acquired through modification of the editable parallelism of the second data flow graph. And the client receives the third Flink SQL task, analyzes the third Flink SQL task to obtain the modified parallelism and the execution plan, configures the modified parallelism into a node of the execution plan, regenerates the task and submits the regenerated task to the server. The process of the data platform further obtaining the second parallelism, splicing the second parallelism and the execution plan to generate a third flank SQL task, and transmitting the third flank SQL task to the client is similar to the process of the data platform obtaining the first parallelism, splicing the first parallelism and the execution plan to generate the second flank SQL task, and transmitting the second flank SQL task to the client, and will not be repeated here. The process that the client receives the third Flink SQL task, analyzes the third Flink SQL task to obtain the second parallelism and the execution plan, configures the second parallelism into the node of the execution plan to regenerate the task and submit the task to the server is similar to the process that the client receives the second Flink SQL task, analyzes the second Flink SQL task to obtain the first parallelism and the execution plan, configures the first parallelism into the node of the execution plan to regenerate the task and submit the task to the server, and is not repeated here.
It can be understood that the data platform can also store the second parallelism and the execution plan, provide a third data flow graph according to the second parallelism and the execution plan, wherein the third data flow graph comprises editable parallelism, and further can continuously acquire the running state of the task processed by the server and prompt the user according to the running state of the task until the preset condition, such as normal running state of the task, is met. The end of the flow may also be triggered by other factors, as the application is not limited in this regard.
Fig. 6 is a schematic structural diagram of an electronic device according to the present application. The electronic device 600 may perform the operations performed by the data platform in the methods described above. The electronic equipment can be a mobile phone, a desktop computer, a notebook computer, a palm computer, a cloud server and the like. The electronic device 600 may comprise a transceiver unit 601 and a processing unit 602.
The transceiver 601 is configured to send a first Flink SQL task to a client, where the first Flink SQL task includes a written SQL script.
The transceiver 601 is further configured to receive a target execution plan sent by the client and including an execution plan and a parallelism reference value, where the target execution plan is in json format, the parallelism reference value is a parallelism reference value of a node in the execution plan, the execution plan is generated by parsing the first flank SQL task, the parallelism reference value of the node in the execution plan is determined according to script information obtained by parsing the first flank SQL task, the script information includes at least two of a script type, a partition size of a source end, an operator data flow, and a file size of the source end, and the script type includes at least one of a stream processing script and a batch processing script.
The processing unit 602 is configured to provide a first dataflow graph for operation by parsing a json-format target execution plan, where the first dataflow graph includes editable parallelism and parallelism reference values of nodes.
The transceiver 601 is further configured to send a second flank SQL task to the client, where the second flank SQL task includes a first parallelism, a written SQL script, and a written configuration parameter, and the first parallelism is obtained by modifying an editable parallelism of the first dataflow graph.
Optionally, the processing unit 602 is further configured to provide a second dataflow graph for operation, where the second dataflow graph includes an editable parallelism, and the second dataflow graph is obtained after operating the editable parallelism of the first dataflow graph.
The processing unit 602 is further configured to generate a hint information according to an operation state of the second Flink SQL task, where the operation state of the second Flink SQL task is obtained from a server that operates the second Flink SQL task.
The transceiver 601 is further configured to send a third flank SQL task to the client, where the third flank SQL task includes a second parallelism, the written SQL script, and the written configuration parameter, and the second parallelism is obtained by modifying an editable parallelism of the second dataflow graph.
Optionally, the first Flink SQL task is Explain statements, and the execution plan is generated by executing the Explain statements.
Optionally, if the script type of the first link SQL task includes a stream processing script, the parallelism reference value of the node in the execution plan is determined according to at least one of the partition size of the source end and the operator data traffic.
Optionally, if the script type of the first link SQL task includes a batch script, the parallelism reference value of the node in the execution plan is determined according to at least one of the file size of the source end and the operator data flow.
Optionally, the first parallelism is spliced into the written SQL script through an-op parameter to obtain the second Flink SQL task.
Fig. 7 is a schematic structural diagram of a client according to the present application. The client 700 may perform the operations performed by the client in the methods described above. The client can be a mobile phone, a desktop computer, a notebook computer, a palm computer and other devices. The client 700 may include a transceiver unit 701 and a processing unit 702.
The transceiver unit 701 is configured to receive a first link SQL task sent by an electronic device, where the first link SQL task includes a written SQL script.
The processing unit 702 is configured to set a parallelism reference value of a node in an execution plan according to script information obtained by analyzing the first flank SQL task to generate a target execution plan, where the target execution plan includes an execution plan and the parallelism reference value, the target execution plan is in json format, the parallelism reference value is a parallelism reference value of the node in the execution plan, the execution plan is generated by analyzing the first flank SQL task, the script information includes at least two of a script type, a size of a source end, an operator data flow, and a file size of the source end, and the script type includes at least one of a stream processing script and a batch processing script.
The transceiver unit 701 is further configured to send a target execution plan to the electronic device.
The transceiver unit 701 is further configured to receive a second flank SQL task sent by the electronic device, where the second flank SQL task includes a first parallelism, a written SQL script, and a written configuration parameter, the first parallelism is obtained by modifying an editable parallelism of a first dataflow graph, the first dataflow graph is obtained by analyzing a json format target execution plan, and the first dataflow graph includes an editable parallelism and a parallelism reference value of a node.
The processing unit 702 is further configured to regenerate a task for submitting to a server according to the second Flink SQL task.
The transceiver unit 701 is further configured to receive a third link SQL task sent by the electronic device, where the third link SQL task includes a second parallelism, a written SQL script, and a configuration parameter, the second parallelism is obtained by modifying an editable parallelism of a second dataflow graph according to a hint information of the electronic device, the hint information is generated according to an operation state of the second link SQL task, the operation state of the second link SQL task is obtained from a server that operates the task generated by the second link SQL task, and the second dataflow graph is obtained after the editable parallelism of the first dataflow graph is operated.
The processing unit 702 is further configured to regenerate a task for submitting to the server according to the third Flink SQL task.
Optionally, the first Flink SQL task is Explain statements, and the execution plan is generated by executing the Explain statements.
Optionally, if the script type of the first link SQL task includes a stream processing script, setting a parallelism reference value of a node in the execution plan according to at least one of a partition size of the source end and the operator data flow.
Optionally, if the script type of the first link SQL task includes a batch script, setting a parallelism reference value of a node in the execution plan according to at least one of a file size of the source end and the operator data flow.
Optionally, the first parallelism is spliced into the written SQL script through an-op parameter to obtain the second Flink SQL task.
Fig. 8 is a schematic diagram of a hardware structure of an electronic device according to the present application. The electronic device shown in fig. 8 includes a memory 801, a processor 802, a communication interface 803, and a bus 804. Wherein the memory 801, the processor 802, and the communication interface 803 are communicatively connected to each other through a bus 804.
The Memory 801 may be a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access Memory (Random Access Memory, RAM). The memory 801 may store programs that, when executed by the processor 802, the processor 802 and the communication interface 803 are operable to perform operations performed by the data platform in the method of embodiments of the application.
The processor 802 may employ a general-purpose central processing unit (Central Processing Unit, CPU), microprocessor, application SPECIFIC INTEGRATED Circuit (ASIC), graphics processor (graphics processing unit, GPU) or one or more integrated circuits for executing associated programs to perform functions required by the elements in the electronic device of the embodiments of the present application or to perform operations performed by the data platform in the methods of the embodiments of the present application.
The processor 802 may also be an integrated circuit chip with signal processing capabilities. In implementation, various operations performed by the data platform of the method of the present application may be performed by integrated logic circuitry in hardware or by instructions in software in processor 802. The processor 802 described above may also be a general-purpose processor, a digital signal processor (DIGITAL SIGNAL Processing, DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (Field Programmable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The operations of the method disclosed in connection with the embodiments of the present application may be embodied directly in hardware for execution by a decoding processor, or in a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 801, and the processor 802 reads information in the memory 801, and in combination with hardware thereof, performs functions required to be performed by units included in the electronic device according to an embodiment of the present application, or performs operations performed by a data platform in the method according to an embodiment of the present application.
The communication interface 803 enables communication between the electronic device 800 and other devices or communication networks using transceiving means such as, but not limited to, a transceiver. For example, data may be obtained from a client via the communication interface 803.
Bus 804 may include a path for transferring information between components of electronic device 800 (e.g., memory 801, processor 802, communication interface 803).
It is to be understood that the structure shown in fig. 8 is not limiting of the electronic device 800, and that the electronic device 800 may include more or less components than illustrated, or may combine certain components, or may split certain components, or may have a different arrangement of components.
Fig. 9 is a schematic diagram of a hardware structure of a client according to the present application. The client 900 shown in fig. 9 includes a memory 901, a processor 902, a communication interface 903, and a bus 904. The memory 901, the processor 902, and the communication interface 903 are communicatively connected to each other via a bus 904.
The Memory 901 may be a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access Memory (Random Access Memory, RAM). The memory 901 may store a program, and when the program stored in the memory 901 is executed by the processor 902, the processor 902 and the communication interface 903 are used to perform operations performed by a client in the method of the embodiment of the present application.
The processor 902 may employ a general-purpose central processing unit (Central Processing Unit, CPU), microprocessor, application SPECIFIC INTEGRATED Circuit (ASIC), graphics processor (graphics processing unit, GPU) or one or more integrated circuits for executing associated programs to perform functions required by the elements in the client of an embodiment of the application or to perform operations performed by the client in the method of an embodiment of the application.
The processor 902 may also be an integrated circuit chip with signal processing capabilities. In implementation, the various operations performed by the clients of the methods of the present application may be performed by integrated logic circuitry in hardware or by instructions in software in processor 902. The processor 902 described above may also be a general purpose processor, a digital signal processor (DIGITAL SIGNAL Processing, DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (Field Programmable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The operations of the method disclosed in connection with the embodiments of the present application may be embodied directly in hardware for execution by a decoding processor, or in a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 901, and a processor 902 reads information in the memory 901, and in combination with hardware thereof, performs functions required to be performed by units included in the client of the embodiment of the method of the present application or performs operations performed by the client of the method of the embodiment of the present application.
The communication interface 903 enables communication between the client 900 and other devices or communication networks using a transceiver device such as, but not limited to, a transceiver. For example, data may be obtained from a client via the communication interface 903.
Bus 904 may include a path to transfer information between various components of client 900 (e.g., memory 901, processor 902, communication interface 903).
It is to be understood that the structure shown in fig. 9 is not limiting of the client 900, and the client 900 may include more or less components than illustrated, or may combine certain components, or may split certain components, or may have a different arrangement of components.
In addition to the above methods and apparatuses, embodiments of the present application also provide a computer-readable storage medium storing a program that causes a computer apparatus to execute the operator-level parallelism setting method shown in fig. 2.
The computer program product comprises computer-executable instructions stored in a computer-readable storage medium, from which at least one processor of a device can read, the at least one processor executing the computer-executable instructions causing the device to implement the operator-level parallelism setting method shown in fig. 2.
According to the method, before the SQL is analyzed for the second time, the SQL is analyzed for the first time by utilizing Explain sentences in advance, the execution plan in json format is generated, the parallelism reference value of each node in the execution plan is set to generate the target execution plan, the target execution plan is displayed in a visual mode, so that a user can refer to the parallelism reference value of the node and set the parallelism of the node. The method and the device have the advantages that the flow of the task is displayed in a visual mode, a user can clearly and intuitively grasp processing logic and the data flow, the user can combine the default parallelism and the parallelism reference value through the default parallelism and the parallelism reference value, the setting threshold of operator parallelism can be reduced, the parallelism of operator level can be set through the setting of parallelism, and the processing efficiency and the resource utilization rate of data are improved. The application also sets the parallelism of the nodes through the running state of the tasks processed by the server, and can set the parallelism of the operator level more flexibly.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present application without departing from the spirit and scope of the technical solution of the present application.

Claims (19)

1. A setting method of parallelism of operator level is applied to electronic equipment, and the method comprises the following steps:
Sending a first Flink SQL task to a client, wherein the first Flink SQL task comprises a written SQL script;
The method comprises the steps of receiving a target execution plan which is sent by a client and comprises an execution plan and a parallelism reference value, wherein the target execution plan is in json format, the parallelism reference value is the parallelism reference value of a node in the execution plan, the execution plan is generated by analyzing a first Flink SQL task, the parallelism reference value of the node in the execution plan is determined according to script information obtained by analyzing the first Flink SQL task, the script information comprises at least two of a script type, a partition size of a source end, operator data flow and a file size of the source end, and the script type comprises at least one of a stream processing script and a batch processing script;
Providing a first data flow graph for operation by parsing the target execution plan in json format, wherein the first data flow graph comprises editable parallelism and parallelism reference values of nodes;
And sending a second Flink SQL task to the client, wherein the second Flink SQL task comprises a first parallelism, a written SQL script and a written configuration parameter, and the first parallelism is obtained through modifying the editable parallelism of the first data flow graph.
2. The method for setting parallelism of an operator level according to claim 1, wherein the method further comprises:
providing a second dataflow graph for operation, wherein the second dataflow graph includes editable parallelism, and the second dataflow graph is obtained after the editable parallelism of the first dataflow graph is operated;
Generating prompt information according to the running state of the second Flink SQL task, wherein the running state of the second Flink SQL task is obtained from a server running the second Flink SQL task;
and sending a third Flink SQL task to the client, wherein the third Flink SQL task comprises a second parallelism, the written SQL script and the written configuration parameter, and the second parallelism is obtained through modifying the editable parallelism of the second data flow graph.
3. The method for setting parallelism of an operator level of claim 1, wherein said first Flink SQL task is Explain statements and said execution plan is generated by executing said Explain statements.
4. The method for setting parallelism of an operator level according to claim 1, wherein:
If the script type of the first Flink SQL task comprises a stream processing script, determining a parallelism reference value of a node in the execution plan according to at least one of the partition size of the source end and the operator data flow.
5. The method for setting parallelism of an operator level according to claim 1, wherein:
if the script type of the first Flink SQL task comprises a batch script, determining a parallelism reference value of a node in the execution plan according to at least one of the file size of the source end and the operator data flow.
6. The method for setting parallelism of an operator level according to claim 1, wherein:
and splicing the first parallelism into the written SQL script through the-op parameter to obtain the second Flink SQL task.
7. A method for setting parallelism of an operator level, applied to a client, the method comprising:
Receiving a first Flink SQL task sent by electronic equipment, wherein the first Flink SQL task comprises a written SQL script;
setting a parallelism reference value of a node in an execution plan according to script information obtained by analyzing the first Flink SQL task to generate a target execution plan, wherein the target execution plan comprises the execution plan and the parallelism reference value, the target execution plan is in json format, the parallelism reference value is the parallelism reference value of the node in the execution plan, the execution plan is generated by analyzing the first Flink SQL task, the script information comprises at least two of a script type, a partition size of a source end, operator data flow and a file size of the source end, and the script type comprises at least one of a stream processing script and a batch processing script;
Transmitting the target execution plan to the electronic device;
The method comprises the steps of receiving a second Flink SQL task sent by electronic equipment, wherein the second Flink SQL task comprises first parallelism, a written SQL script and a written configuration parameter, the first parallelism is obtained through modification of editable parallelism of a first data flow graph, the first data flow graph is obtained through analysis of a target execution plan of json format, and the first data flow graph comprises editable parallelism and a parallelism reference value of a node;
And regenerating a task according to the second Flink SQL task for submitting to a server.
8. The method for setting parallelism of an operator level according to claim 7, wherein the method further comprises:
The method comprises the steps of receiving a third Flink SQL task sent by electronic equipment, wherein the third Flink SQL task comprises a second parallelism, a written SQL script and configuration parameters, the second parallelism is obtained through modification of the editable parallelism of a second data flow graph according to prompt information of the electronic equipment, the prompt information is generated according to the running state of the second Flink SQL task, the running state of the second Flink SQL task is obtained from a server running the task generated by the second Flink SQL task, and the second data flow graph is obtained after the editable parallelism of the first data flow graph is operated;
And regenerating a task according to the third Flink SQL task for submitting to the server.
9. The method for setting parallelism of an operator level of claim 7, wherein said first Flink SQL task is Explain statements and said execution plan is generated by executing said Explain statements.
10. The method for setting parallelism of operator level according to claim 7, wherein:
if the script type of the first Flink SQL task comprises a stream processing script, setting a parallelism reference value of a node in the execution plan according to at least one of the partition size of the source end and the operator data flow.
11. The method for setting parallelism of operator level according to claim 7, wherein:
If the script type of the first Flink SQL task comprises a batch script, setting a parallelism reference value of a node in the execution plan according to at least one of the file size of the source end and the operator data flow.
12. The method for setting parallelism of operator level according to claim 7, wherein:
and splicing the first parallelism into the written SQL script through the-op parameter to obtain the second Flink SQL task.
13. An electronic device, the electronic device comprising:
The receiving and transmitting unit is used for transmitting a first Flink SQL task to the client, wherein the first Flink SQL task comprises a written SQL script;
The receiving and transmitting unit is further configured to receive a target execution plan sent by the client and including an execution plan and a parallelism reference value, where the target execution plan is in json format, the parallelism reference value is a parallelism reference value of a node in the execution plan, the execution plan is generated by analyzing the first flank SQL task, the parallelism reference value of the node in the execution plan is determined according to script information obtained by analyzing the first flank SQL task, the script information includes at least two of a script type, a partition size of a source end, an operator data flow, and a file size of the source end, and the script type includes at least one of a stream processing script and a batch processing script;
the processing unit is used for providing a first data flow graph for operation by analyzing the target execution plan in the json format, wherein the first data flow graph comprises editable parallelism and parallelism reference values of nodes;
The receiving and transmitting unit is further configured to send a second flank SQL task to the client, where the second flank SQL task includes a first parallelism, a written SQL script, and a written configuration parameter, and the first parallelism is obtained by modifying an editable parallelism of the first dataflow graph.
14. A client, characterized in that, the client comprises:
The receiving and transmitting unit is used for receiving a first Flink SQL task sent by the electronic equipment, wherein the first Flink SQL task comprises a written SQL script;
The processing unit is used for setting a parallelism reference value of a node in an execution plan according to script information obtained by analyzing the first Flink SQL task to generate a target execution plan, wherein the target execution plan comprises the execution plan and the parallelism reference value, the target execution plan is in json format, the parallelism reference value is the parallelism reference value of the node in the execution plan, the execution plan is generated by analyzing the first Flink SQL task, the script information comprises at least two of a script type, a partition size of a source end, operator data flow and a file size of the source end, and the script type comprises at least one of a stream processing script and a batch processing script;
the receiving and transmitting unit is further configured to send the target execution plan to the electronic device;
the receiving and transmitting unit is further used for receiving a second Flink SQL task sent by the electronic device, wherein the second Flink SQL task comprises first parallelism, a written SQL script and a written configuration parameter, the first parallelism is obtained through modification of the editable parallelism of a first data flow graph, the first data flow graph is obtained through analysis of the target execution plan of json format, and the first data flow graph comprises editable parallelism and a parallelism reference value of a node;
And the processing unit is also used for regenerating a task according to the second Flink SQL task so as to be submitted to a server.
15. An electronic device comprising at least one processor, memory, and a communication interface;
the at least one processor is coupled with the memory and the communication interface;
The memory is used for storing instructions, the processor is used for executing the instructions, and the communication interface is used for communicating with the client under the control of the at least one processor;
The instructions, when executed by the at least one processor, cause the at least one processor to perform the operator-level parallelism setting method of any one of claims 1 to 6.
16. A client comprising at least one processor, memory, and a communication interface;
the at least one processor is coupled with the memory and the communication interface;
The memory is used for storing instructions, the processor is used for executing the instructions, and the communication interface is used for communicating with the electronic equipment and the server under the control of the at least one processor;
the instructions, when executed by the at least one processor, cause the at least one processor to perform the operator-level parallelism setting method of any one of claims 7 to 12.
17. The operator-level parallelism setting system is characterized by comprising electronic equipment, a client and a server;
The electronic device is configured to perform the operator-level parallelism setting method according to any one of claims 1 to 6, and the client is configured to perform the operator-level parallelism setting method according to any one of claims 7 to 12.
18. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a program that causes a computer device to execute the operator-level parallelism setting method according to any one of claims 1 to 12.
19. A computer program product, characterized in that it comprises computer-executable instructions stored in a computer-readable storage medium, from which at least one processor of a device can read, said at least one processor executing said computer-executable instructions causing the device to perform the method of setting parallelism of operator levels according to any one of claims 1 to 12.
CN202111000399.XA 2021-08-27 2021-08-27 Methods and apparatus for setting operator-level parallelism Active CN115729552B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111000399.XA CN115729552B (en) 2021-08-27 2021-08-27 Methods and apparatus for setting operator-level parallelism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111000399.XA CN115729552B (en) 2021-08-27 2021-08-27 Methods and apparatus for setting operator-level parallelism

Publications (2)

Publication Number Publication Date
CN115729552A CN115729552A (en) 2023-03-03
CN115729552B true CN115729552B (en) 2026-06-12

Family

ID=85290585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111000399.XA Active CN115729552B (en) 2021-08-27 2021-08-27 Methods and apparatus for setting operator-level parallelism

Country Status (1)

Country Link
CN (1) CN115729552B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118394532B (en) * 2024-06-27 2024-08-27 深圳市前海泽金产融科技有限公司 Digital financial service platform based on block chain
CN118708360B (en) * 2024-08-26 2025-03-14 北京壁仞科技开发有限公司 Operator execution method, device, storage medium and program product
CN120255863B (en) * 2025-06-05 2025-09-16 北京科杰科技有限公司 An efficient multi-source data output method based on FlinkSql

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026779A (en) * 2019-12-19 2020-04-17 厦门安胜网络科技有限公司 Data processing method, device and storage medium based on Flink SQL
CN111209302A (en) * 2020-01-02 2020-05-29 中科驭数(北京)科技有限公司 Parallel execution method and device for database access

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035523B (en) * 2020-08-25 2024-07-09 上海达梦数据库有限公司 Determination method, device, equipment and storage medium for parallelism
CN112417014A (en) * 2020-11-16 2021-02-26 杭州安恒信息技术股份有限公司 Dynamic modification execution plan method, system, and computer-readable storage medium
CN112529528B (en) * 2020-12-16 2023-01-31 中国南方电网有限责任公司 Workflow monitoring and alarm method, device and system based on big data flow computing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026779A (en) * 2019-12-19 2020-04-17 厦门安胜网络科技有限公司 Data processing method, device and storage medium based on Flink SQL
CN111209302A (en) * 2020-01-02 2020-05-29 中科驭数(北京)科技有限公司 Parallel execution method and device for database access

Also Published As

Publication number Publication date
CN115729552A (en) 2023-03-03

Similar Documents

Publication Publication Date Title
CN113010827B (en) Page rendering method and device, electronic equipment and storage medium
US11188380B2 (en) Method and apparatus for processing task in smart device
US10824537B2 (en) Method, device, and computer readable medium for tracing computing system
CN113760242B (en) Data processing method, device, server and medium
CN104216766B (en) The method and device that stream data is handled
CN113495723B (en) Method, device and storage medium for calling functional component
CN111880948A (en) Data refreshing method and device, electronic equipment and computer readable storage medium
CN113660231A (en) Message parsing method, device, equipment and storage medium
CN115167822A (en) Branch code merging method, device, equipment and storage medium
CN107391528A (en) Front end assemblies Dependency Specification searching method and equipment
WO2021022714A1 (en) Message processing method for cross-block chain node, device, apparatus and medium
WO2019075845A1 (en) Construction method and device for link call relationship, computer device and storage medium
CN115729552A (en) Method and device for setting parallelism at operator level
CN110727429A (en) Front-end page generation method, device and equipment
CN118153689A (en) Reasoning data processing method, device and equipment
CN108023905B (en) Internet of things application system and method
CN115576791A (en) Dynamic adjustment method, device, electronic device and storage medium for pressure measurement thread
CN115114890B (en) Data analysis method and device, electronic equipment and readable medium
CN104796465A (en) Cloud platform service processing method and system
CN111026666A (en) Test data processing method, device, computer system and medium
CN111400060A (en) Equipment linkage method, device, server and medium
CN118426933A (en) Method, device, electronic equipment and storage medium for processing business data
CN110858240A (en) Front-end module loading method and device
CN116126799A (en) File splitting method, device, electronic equipment and storage medium
CN115167847A (en) Application log acquisition method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant