Flink job parallelism degree dynamic tuning method and device, equipment and medium

By performing feature conversion and prediction model input on multiple indicator data of Flink jobs, the degree of parallelism is dynamically adjusted, which solves the problem of untimely adjustment of parallelism in the existing technology and improves the execution efficiency and resource utilization of Flink jobs.

CN118779075APending Publication Date: 2024-10-15CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410843166.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In the existing technology, the parallelism of Flink jobs is difficult to adjust in real time under dynamic load changes, leading to problems such as uneven resource allocation, increased processing delays, or resource waste.

Method used

By obtaining multiple index data of the Flink job for feature conversion, input it into the trained parallelism prediction model, and dynamically adjust the parallelism. When the difference between the predicted parallelism and the preset parallelism exceeds the threshold, an adjustment instruction is generated for adjustment, and Optimize the model through feedback.

Benefits of technology

It realizes real-time adjustment of Flink job parallelism, improves execution efficiency and resource utilization, and avoids excessive consumption or idleness of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779075A_ABST
    Figure CN118779075A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of big data processing, and discloses an Flink job parallelism degree dynamic tuning method and device, equipment and a medium, and the method comprises the steps: obtaining a plurality of index data of a current Flink job, and carrying out the feature conversion of each index data, and obtaining a plurality of index features; inputting the plurality of index features of the current Flink job into a trained parallelism degree prediction model to obtain a predicted parallelism degree of the current Flink job, and judging whether a difference value between the predicted parallelism degree and a preset parallelism degree exceeds a threshold value or not to obtain a judgment result; and when the judgment result is yes, dynamically adjusting the degree of parallelism of the current Flink operation according to a difference value between the predicted degree of parallelism and a preset degree of parallelism. By applying the technical scheme of the invention, the parallelism degree of the Flink job can be adjusted in real time, and the execution efficiency and the resource utilization rate of the Flink job are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data processing technology, and in particular to a method, device, equipment and medium for dynamically tuning the parallelism of a Flink job. Background Art

[0002] As a popular stream processing and batch processing framework, Apache Flink supports highly flexible parallel data processing. However, in practical applications, the parallelism of jobs often remains unchanged after being set at the initial deployment, which limits its efficiency and responsiveness in an environment with dynamic load changes. Most existing parallelism adjustment strategies are based on static rules or periodic evaluations, lacking precise monitoring and rapid response mechanisms for real-time job status, leading to problems such as uneven resource allocation, increased processing delays, or resource waste.

[0003] Therefore, it is urgent to provide a technical solution to solve the above problems. Summary of the invention

[0004] In view of the above problems, the present application provides a method, device, equipment and medium for dynamically tuning the parallelism of Flink jobs, which are used to solve the problem in the prior art that the parallelism of Flink jobs cannot be dynamically adjusted.

[0005] According to one aspect of an embodiment of the present application, a method for dynamically tuning the parallelism of a Flink job is provided, the method comprising:

[0006] Get multiple indicator data of the current Flink job, and perform feature conversion on each indicator data to obtain multiple indicator features;

[0007] Input multiple indicator features of the current Flink job into a trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and determine whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold to obtain a determination result;

[0008] When the determination result is yes, the parallelism of the current Flink job is dynamically adjusted according to the difference between the predicted parallelism and the preset parallelism.

[0009] In an optional manner, the step of dynamically adjusting the parallelism of the current Flink job according to the difference between the predicted parallelism and the preset parallelism includes:

[0010] According to the difference between the predicted parallelism and the preset parallelism, a current parallelism adjustment instruction is generated, and the current parallelism adjustment instruction is sent to the Flink job manager through the network application interface, so as to dynamically adjust the parallelism of the current Flink job through the Flink job manager.

[0011] In an optional manner, the method further includes:

[0012] According to the difference between the actual parallelism of the adjusted Flink job and the predicted parallelism, the trained parallelism prediction model is optimized to obtain an optimized parallelism prediction model, and the optimized parallelism prediction model is used as the trained parallelism prediction model.

[0013] In an optional manner, the multiple indicator data include: Flink task processing rate, data buffer size, CPU and memory usage.

[0014] In an optional manner, the parallelism prediction model is a random forest model, a gradient boosting tree model or a neural network model.

[0015] According to another aspect of an embodiment of the present application, a device for dynamically tuning the parallelism of a Flink job is provided, including:

[0016] The processing module is used to obtain multiple indicator data of the current Flink job and perform feature conversion on each indicator data to obtain multiple indicator features;

[0017] A judgment module is used to input multiple indicator features of the current Flink job into a trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and to judge whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold, and obtain a judgment result;

[0018] The adjustment module is used to dynamically adjust the parallelism of the current Flink job according to the difference between the predicted parallelism and the preset parallelism when the determination result is yes.

[0019] In an optional manner, the adjustment module is specifically used to:

[0020] According to the difference between the predicted parallelism and the preset parallelism, a current parallelism adjustment instruction is generated, and the current parallelism adjustment instruction is sent to the Flink job manager through the network application interface, so as to dynamically adjust the parallelism of the current Flink job through the Flink job manager.

[0021] In an optional manner, the method further includes: an optimization module; the optimization module is used to:

[0022] According to the difference between the actual parallelism of the adjusted Flink job and the predicted parallelism, the trained parallelism prediction model is optimized to obtain an optimized parallelism prediction model, and the optimized parallelism prediction model is used as the trained parallelism prediction model.

[0023] According to another aspect of an embodiment of the present application, a Flink job parallelism dynamic tuning device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus;

[0024] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations of the Flink job parallelism dynamic tuning method of the present invention.

[0025] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores at least one executable instruction, wherein the executable instruction enables a Flink job parallelism dynamic tuning apparatus / device to perform operations such as the Flink job parallelism dynamic tuning method of the present invention.

[0026] The embodiment of the present application obtains multiple indicator data of the current Flink job and performs feature conversion on each indicator data to obtain multiple indicator features; the multiple indicator features of the current Flink job are input into a trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and it is determined whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold to obtain a determination result; when the determination result is yes, the parallelism of the current Flink job is dynamically adjusted according to the difference between the predicted parallelism and the preset parallelism, so that the parallelism of the Flink job can be adjusted in real time, thereby improving the execution efficiency and resource utilization of the Flink job.

[0027] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present application. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:

[0029] Figure 1A schematic diagram showing a flow chart of a first embodiment of a method for dynamically tuning the parallelism of a Flink job provided by the present application is shown;

[0030] Figure 2 A flow chart of a second embodiment of the method for dynamically tuning the parallelism of Flink jobs provided by the present application is shown;

[0031] Figure 3 A structural schematic diagram of a first embodiment of a Flink job parallelism dynamic tuning device provided by the present application is shown;

[0032] Figure 4 A structural schematic diagram of an embodiment of a Flink job parallelism dynamic tuning device provided by the present application is shown. DETAILED DESCRIPTION

[0033] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0035] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0036] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0037] As a popular stream processing and batch processing framework, Apache Flink supports highly flexible parallel data processing. However, in practical applications, the parallelism of jobs often remains unchanged after the initial deployment setting, which limits its efficiency and responsiveness in dynamic load change environments. Most existing parallelism adjustment strategies are based on static rules or periodic evaluations, lacking precise monitoring and rapid response mechanisms for real-time job status, leading to problems such as uneven resource allocation, increased processing delays, or resource waste. Based on this:

[0038] Figure 1 The flowchart of the first embodiment of the method for dynamically tuning the parallelism of Flink jobs provided by the present application is shown. The method is executed by a device for dynamically tuning the parallelism of Flink jobs. Figure 1 As shown, the method comprises the following steps:

[0039] Step S110: Obtain multiple indicator data of the current Flink job, and perform feature conversion on each indicator data to obtain multiple indicator features.

[0040] The current Flink job is the Flink job at the current moment in the periodically collected Flink jobs. Multiple indicator data include but are not limited to: Flink task processing rate, data buffer size, CPU and memory usage. Indicator features are preprocessed indicator data and converted into model input features. Each indicator data corresponds to an indicator feature.

[0041] Specifically, the Flink job parallelism dynamic tuning device uses the Metrics system provided by Flink to obtain multiple indicator data of the current Flink job, and uses feature engineering to perform feature conversion on each indicator data to obtain multiple indicator features.

[0042] It should be noted that the sample data of multiple indicator data of the current Flink job is as follows:

[0043] {

[0044] "timestamp":"2024-05-23T12:00:00Z",

[0045] "taskMetrics":[

[0046] {

[0047] "taskId":"task_01",

[0048] "throughput": 5000, / / Number of records processed per second

[0049] "bufferSize":1000, / / buffer size

[0050] "cpuUsage":75, / / CPU usage percentage

[0051] "memoryUsage":60 / / memory usage percentage

[0052] },

[0053] {

[0054] "taskId":"task_02",

[0055] "throughput":4500,

[0056] "bufferSize":1200,

[0057] "cpuUsage":70,

[0058] "memoryUsage":65

[0059] } ]

[0061] }

[0062] use

[0063] MetricGroup registers custom metrics, such as:

[0064] MetricGroup group=getRuntimeContext().getMetricGroup().addGroup("Cus tomMetrics");

[0065] group.gauge("taskThroughput",new Gauge <long>(){

[0066] @Override

[0067] public Long getValue(){

[0068] / / Implement the logic of obtaining task processing rate

[0069] return currentThroughput;

[0070] }

[0071] });

[0072] Real-time data collection logic pseudo code:

[0073] while(applicationRunning){

[0074] / / Collect all relevant indicators

[0075] Map<String,Double> metrics = collectMetrics();

[0076] / / Send data to the central monitoring system or directly for subsequent analysis

[0077] sendToAnalysis(metrics);

[0078] Thread.sleep(interval);

[0079] }

[0080] The following are examples of multiple indicator features after preprocessing:

[0081] {

[0082] "features":[

[0083] {

[0084] "averageThroughput":4750,

[0085] "averageBufferSize":1100,

[0086] "averageCpuUsage":72.5,

[0087] "averageMemoryUsage":62.5

[0088] } ]

[0090] }

[0091] Step S120: Input multiple indicator features of the current Flink job into the trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and determine whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold to obtain a determination result.

[0092] The parallelism prediction model is a random forest model, a gradient boosting tree model or a neural network model, and there is no limit here. The threshold can be set according to actual needs and there is no limit here. The input of the parallelism prediction model is multiple indicator features, and the output is the predicted parallelism.

[0093] It should be noted that the code example for parallel prediction model training is:

[0094] Training pseudocode example (simplified version):

[0095] from sklearn.ensemble import RandomForestRegressor

[0096] #Assume X is the feature matrix and Y is the target parallelism

[0097] model=RandomForestRegressor(n_estimators=100)

[0098] model.fit(X_train,Y_train)

[0099] An example of predicting the degree of parallelism is:

[0100] {

[0101] "predictedParallelism":6

[0102] }

[0103] Step S130: When the determination result is yes, dynamically adjust the parallelism of the current Flink job according to the difference between the predicted parallelism and the preset parallelism.

[0104] Among them, the parallelism adjustment method adjusts the parallelism setting and modifies the data of various indicators.

[0105] Specifically, according to the difference between the predicted parallelism and the preset parallelism, a current parallelism adjustment instruction is generated, and the current parallelism adjustment instruction is sent to the Flink job manager through the network application interface, so as to dynamically adjust the parallelism of the current Flink job through the Flink job manager.

[0106] The network application interface defaults to REST API, and the job manager defaults to JobManager. The network application interface and the job manager can also be adjusted according to actual conditions, and there is no restriction here.

[0107] It should be noted that a set of logic is designed to decide whether and how to adjust the parallelism based on the model's predicted parallelism and real-time indicator data. Factors considered include model confidence, adjustment costs (such as the cost of reallocating resources), and whether the threshold trigger condition is reached. An example of dynamic adjustment of parallelism is as follows:

[0108] Decision logic pseudo code:

[0109] def shouldAdjustParallelism(currentMetrics,predictedParallelism,threshold):

[0110] if abs(predictedParallelism-currentParallelism)>threshold andmodelConfidence>0.9:

[0111] return True

[0112] else:

[0113] return False

[0114] Through Flink's REST API interface, you can dynamically adjust the parallelism of the currently running Flink task. To implement this, you need to send an HTTP request to the JobManager, specifying the Flink job ID to be adjusted and the new parallelism value. The specific sample code is:

[0115] Pseudo code for adjusting the degree of parallelism:

[0116] def adjustParallelism(jobId,newParallelism):

[0117] url=f"http: / / jobmanager:8081 / jobs / {jobId} / vertices / modify-parallelsism"data={"parallelism":newParallelism}

[0118] response=requests.post(url,json=data)

[0119] if response.status_code==200:

[0120] print("Parallelism adjustment successful.")

[0121] else:

[0122] print("Failed to adjust parallelism.")

[0123] The sample code for the adjusted current indicator data is:

[0124] {

[0125] "timestamp":"2024-05-23T12:05:00Z",

[0126] "taskMetrics":[

[0127] {

[0128] "taskId":"task_01",

[0129] "throughput":6000,

[0130] "bufferSize":900,

[0131] "cpuUsage":70,

[0132] "memoryUsage":58

[0133] },

[0134] {

[0135] "taskId":"task_02",

[0136] "throughput":5800,

[0137] "bufferSize":950,

[0138] "cpuUsage":68,

[0139] "memoryUsage":60

[0140] } ]

[0142] }

[0143] The technical solution of this embodiment can adjust the parallelism of Flink jobs in real time, thereby improving the execution efficiency and resource utilization of Flink jobs.

[0144] Figure 2 The flowchart of the second embodiment of the method for dynamically tuning the parallelism of Flink jobs provided by the present application is shown. The method is executed by the device for dynamically tuning the parallelism of Flink jobs. Figure 2 As shown, the method comprises the following steps:

[0145] Step S210: Obtain multiple indicator data of the current Flink job, and perform feature conversion on each indicator data to obtain multiple indicator features.

[0146] Step S220: Input multiple indicator features of the current Flink job into the trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and determine whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold to obtain a determination result.

[0147] Step S230: When the determination result is yes, dynamically adjust the parallelism of the current Flink job according to the difference between the predicted parallelism and the preset parallelism.

[0148] Step S240: According to the difference between the actual parallelism of the adjusted Flink job and the predicted parallelism, the trained parallelism prediction model is optimized to obtain an optimized parallelism prediction model, and the optimized parallelism prediction model is used as the trained parallelism prediction model.

[0149] After the parallelism is adjusted, the performance of the Flink job is continuously monitored, and the actual parallelism of the adjusted Flink job (adjusted indicator data) is compared with the predicted results before the adjustment. This feedback information is used to continuously optimize the model, form a closed-loop control, and improve the prediction accuracy.

[0150] It should be noted that the sample code for optimizing the parallelism prediction model is:

[0151] Recycle feedback data and update the training set:

[0152] def updateModelWithFeedback(actualPerformance,predictedPerformance):

[0153] #Integrate the difference between the actual results and the predicted results into the training data

[0154] global X_train,Y_train

[0155] newX=extractFeaturesFromFeedback(actualPerformance)

[0156] newY=actualPerformance.parallelism

[0157] X_train=np.concatenate((X_train,newX),axis=0)

[0158] Y_train=np.concatenate((Y_train,newY),axis=0)

[0159] #Retrain the model periodically or when data accumulates to a certain level

[0160] retrainModel()

[0161] The technical solution of this embodiment further optimizes and adjusts the strategy through a feedback mechanism to improve the overall performance of the system, ensures that resources are allocated on demand, and avoids excessive consumption or idleness of resources, so that the parallelism of Flink jobs can be adjusted in real time, thereby improving the execution efficiency and resource utilization of Flink jobs.

[0162] Figure 3 The schematic diagram of the structure of an embodiment of the Flink job parallelism dynamic tuning device provided by the present application is shown. Figure 3 As shown, the device 300 includes: a processing module 310 , a judgment module 320 and an adjustment module 330 .

[0163] The processing module 310 is used to obtain multiple indicator data of the current Flink job and perform feature conversion on each indicator data to obtain multiple indicator features;

[0164] A judgment module 320 is used to input multiple indicator features of the current Flink job into a trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and to judge whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold value to obtain a judgment result;

[0165] The adjustment module 330 is configured to dynamically adjust the parallelism of the current Flink job according to the difference between the predicted parallelism and the preset parallelism when the determination result is yes.

[0166] In an optional manner, the adjustment module 330 is specifically used to:

[0167] According to the difference between the predicted parallelism and the preset parallelism, a current parallelism adjustment instruction is generated, and the current parallelism adjustment instruction is sent to the Flink job manager through the network application interface, so as to dynamically adjust the parallelism of the current Flink job through the Flink job manager.

[0168] In an optional manner, the method further includes: an optimization module; the optimization module is used to:

[0169] According to the difference between the actual parallelism of the adjusted Flink job and the predicted parallelism, the trained parallelism prediction model is optimized to obtain an optimized parallelism prediction model, and the optimized parallelism prediction model is used as the trained parallelism prediction model.

[0170] In an optional manner, the multiple indicator data include: Flink task processing rate, data buffer size, CPU and memory usage.

[0171] In an optional manner, the parallelism prediction model is a random forest model, a gradient boosting tree model or a neural network model.

[0172] The technical solution of this embodiment can adjust the parallelism of Flink jobs in real time, thereby improving the execution efficiency and resource utilization of Flink jobs.

[0173] It should be noted that the Flink job parallelism dynamic tuning device provided in the above embodiment and the Flink job parallelism dynamic tuning method provided in the above embodiment belong to the same concept, and the specific way in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.

[0174] Figure 4 A structural schematic diagram of an embodiment of a Flink job parallelism dynamic tuning device provided by the present application is shown, which shows a structural schematic diagram of a computer system suitable for implementing the Flink job parallelism dynamic tuning device of the embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the Flink job parallelism dynamic tuning device.

[0175] See also Figure 4 As shown, the Flink job parallelism dynamic tuning device includes: a controller; a memory, which is used to store one or more programs. When the one or more programs are executed by the controller, the above-mentioned Flink job parallelism dynamic tuning method is executed.

[0176] Please continue reading Figure 4 As shown, the computer system 500 of the Flink job parallelism dynamic tuning device includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503, such as executing the method in the above embodiment. In RAM 503, various programs and data required for system operation are also stored. CPU 501, ROM 502 and RAM 503 are connected to each other through bus 504. Input / output (I / O) interface 505 is also connected to bus 504.

[0177] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.

[0178] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 509, and / or installed from a removable medium 511. When the computer program is executed by a central processing unit (CPU) 501, various functions defined in the system of the present application are executed.

[0179] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the Flink job parallelism dynamic tuning method described above is implemented. The computer-readable storage medium may be included in the Flink job parallelism dynamic tuning device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0180] Another aspect of the present application further provides a computer program product or a computer program, which includes at least one executable instruction. When the executable instruction runs on the Flink job parallelism dynamic tuning apparatus / device, the Flink job parallelism dynamic tuning apparatus / device executes the Flink job parallelism dynamic tuning method as described above.

[0181] The executable instructions can be used to enable the Flink job parallelism dynamic tuning device / apparatus to perform the following operations:

[0182] Get multiple indicator data of the current Flink job, and perform feature conversion on each indicator data to obtain multiple indicator features;

[0183] Input multiple indicator features of the current Flink job into a trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and determine whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold to obtain a determination result;

[0184] When the determination result is yes, the parallelism of the current Flink job is dynamically adjusted according to the difference between the predicted parallelism and the preset parallelism.

[0185] In an optional manner, the step of dynamically adjusting the parallelism of the current Flink job according to the difference between the predicted parallelism and the preset parallelism includes:

[0186] According to the difference between the predicted parallelism and the preset parallelism, a current parallelism adjustment instruction is generated, and the current parallelism adjustment instruction is sent to the Flink job manager through the network application interface, so as to dynamically adjust the parallelism of the current Flink job through the Flink job manager.

[0187] In an optional manner, the method further includes:

[0188] According to the difference between the actual parallelism of the adjusted Flink job and the predicted parallelism, the trained parallelism prediction model is optimized to obtain an optimized parallelism prediction model, and the optimized parallelism prediction model is used as the trained parallelism prediction model.

[0189] In an optional manner, the multiple indicator data include: Flink task processing rate, data buffer size, CPU and memory usage.

[0190] In an optional manner, the parallelism prediction model is a random forest model, a gradient boosting tree model or a neural network model.

[0191] The technical solution of this embodiment can adjust the parallelism of Flink jobs in real time, thereby improving the execution efficiency and resource utilization of Flink jobs.

[0192] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0193] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0194] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0195] According to one aspect of an embodiment of the present application, a computer system is also provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0196] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0197] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.< / long>

Claims

1. A method for dynamically tuning the parallelism of a Flink job, characterized in that: The method comprises: Get multiple indicator data of the current Flink job, and perform feature conversion on each indicator data to obtain multiple indicator features; Input multiple indicator features of the current Flink job into a trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and determine whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold to obtain a determination result; When the determination result is yes, the parallelism of the current Flink job is dynamically adjusted according to the difference between the predicted parallelism and the preset parallelism.

2. The method according to claim 1, characterized in that The step of dynamically adjusting the parallelism of the current Flink job according to the difference between the predicted parallelism and the preset parallelism includes: According to the difference between the predicted parallelism and the preset parallelism, a current parallelism adjustment instruction is generated, and the current parallelism adjustment instruction is sent to the Flink job manager through the network application interface, so as to dynamically adjust the parallelism of the current Flink job through the Flink job manager.

3. The method according to claim 1, characterized in that Also includes: According to the difference between the actual parallelism of the adjusted Flink job and the predicted parallelism, the trained parallelism prediction model is optimized to obtain an optimized parallelism prediction model, and the optimized parallelism prediction model is used as the trained parallelism prediction model.

4. The method according to any one of claims 1 to 3, characterized in that: The multiple indicator data include: Flink task processing rate, data buffer size, CPU and memory usage.

5. The method according to any one of claims 1 to 3, characterized in that: The parallelism prediction model is a random forest model, a gradient boosting tree model or a neural network model.

6. A Flink job parallelism dynamic tuning device, characterized in that: include: The processing module is used to obtain multiple indicator data of the current Flink job and perform feature conversion on each indicator data to obtain multiple indicator features; A judgment module is used to input multiple indicator features of the current Flink job into a trained parallelism prediction model to obtain the predicted parallelism of the current Flink job, and to judge whether the difference between the predicted parallelism and the preset parallelism exceeds a threshold, and obtain a judgment result; The adjustment module is used to dynamically adjust the parallelism of the current Flink job according to the difference between the predicted parallelism and the preset parallelism when the determination result is yes.

7. The Flink job parallelism dynamic tuning device according to claim 6, characterized in that: The adjustment module is specifically used for: According to the difference between the predicted parallelism and the preset parallelism, a current parallelism adjustment instruction is generated, and the current parallelism adjustment instruction is sent to the Flink job manager through the network application interface, so as to dynamically adjust the parallelism of the current Flink job through the Flink job manager.

8. The Flink job parallelism dynamic tuning device according to claim 6, characterized in that: Also includes: Optimization module; the optimization module is used to: According to the difference between the actual parallelism of the adjusted Flink job and the predicted parallelism, the trained parallelism prediction model is optimized to obtain an optimized parallelism prediction model, and the optimized parallelism prediction model is used as the trained parallelism prediction model.

9. A Flink job parallelism dynamic tuning device, characterized in that: include: Controller; A memory, used to store one or more programs. When the one or more programs are executed by the controller, the controller implements the Flink job parallelism dynamic tuning method according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one executable instruction. When the executable instruction is executed on the Flink job parallelism dynamic tuning device / equipment, the Flink job parallelism dynamic tuning device / equipment performs the operation of the Flink job parallelism dynamic tuning method according to any one of claims 1 to 5.