Stream computing task parallelism optimization method, device, electronic device and storage medium

By obtaining the performance parameter values ​​and task priority of each computing node of the stream computing system, and determining and dynamically adjusting the task parallelism based on the task parallelism model, the problem of low resource utilization in the stream computing system is solved, and efficient resource utilization and stable business operation are achieved.

CN114816691BActive Publication Date: 2025-03-14CHINA MOBILE COMM LTD RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110127729.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-29
Publication Date
2025-03-14
Estimated Expiration
2041-01-29

AI Technical Summary

Technical Problem

The existing stream computing system cannot configure the parallelism of tasks in a timely and appropriate manner according to the system resource situation, resulting in unstable operation of services with high importance and inability to achieve efficient utilization of resources.

Method used

By obtaining the performance parameter values ​​of each computing node in the flow calculation and the preset task priority of the tasks, the parallelism of each task is determined based on the task parallelism model when the total value of all current flow calculation tasks is the largest, and the parallelism of the tasks is dynamically adjusted.

Benefits of technology

In an environment with limited resources, based on task characteristics and resource conditions, the optimal parallelism of each task is calculated through flow calculation, maximizing resource utilization and maximizing value benefits, and ensuring the stable operation of important businesses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114816691B_ABST
    Figure CN114816691B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, electronic device and storage medium for optimizing the parallelism of stream computing tasks, and belongs to the field of big data. The method includes: obtaining the performance parameter value of each computing node in the stream computing and the preset task priority of each task, wherein the performance parameter value includes the parameter value of the CPU, memory, network bandwidth and / or task throughput of each computing node; based on the task parallelism model, determining the parallelism of each task when the total value of all currently running stream computing tasks is the largest, wherein the task parallelism model determines the value of the task by the difference between the task benefit and the task overhead, the task benefit is determined by the preset task priority and task throughput, the task overhead is determined by the resources consumed by the task, the resources include CPU, memory and / or network bandwidth, and the task throughput and the resources consumed by the task are functions of the task parallelism; adjusting the parallelism of each currently running task according to the determined parallelism of each task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of big data, and specifically relates to a method for optimizing the parallelism of stream computing tasks, a device for optimizing the parallelism of stream computing tasks, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of the Internet of Things, various sensors continue to generate a large amount of sensor data. These data have the characteristics of high density, strong real-time nature, and low value density, and require real-time and efficient calculations. Therefore, stream computing technology has been widely used in the field of the Internet of Things.

[0003] Stream computing is a technology for processing streaming data. As a new distributed data computing technology, it can process unbounded data streams in a pipeline-like manner. The data to be processed continuously enters the stream computing system, and the system analyzes and processes the data in real time to obtain valuable information efficiently and quickly. The advantage of stream computing is strong real-time performance, but the disadvantage is low throughput and high resource overhead.

[0004] A stream computing task is usually logically composed of a series of multiple computing operators, which is called the logical topology of the task. The user-defined computing logic is encapsulated in the operator. The operator is the smallest computing execution unit that carries the actual data processing work. The data flow is executed in sequence along the operator, and the calculation results are passed to the downstream operator to finally obtain the calculation results. All operators and their upstream and downstream data transmission routes form a directed acyclic graph DAG (Directed Acyclic Graph). When the task logical topology is scheduled to execute on the physical node, the computing efficiency can be improved with the help of parallel computing. The parallelism of the task indicates the degree of parallelism of the operators in the logical task. The throughput of the stream computing system is significantly improved through the parallel execution of operators. The higher the parallelism of a stream computing task, the higher the computing efficiency of parallel computing and the greater the system throughput. At the same time, since the operator is the execution unit (thread / process) in the system, it consumes more system resources.

[0005] Flink is a popular stream computing system. Its feature is that it uses the same stream processing method for both traditional batch data and stream data, and supports stateful computing. The Flink stream computing system needs to configure task parallelism before task execution, and the task submitter (user or system administrator) sets the task parallelism. However, the Flink system is essentially a multi-task sharing system resource, and the various tasks running in the system compete with each other for system resources. This is because when users submit tasks, they are not clear about the resource status in the Flink system, and usually tend to maximize their own task parallelism, resulting in multiple user tasks competing for limited system resources; and the system administrator lacks user task information on the one hand, and on the other hand, the system resources are constantly changing with the increase and decrease of tasks and the change of the amount of data processed by the tasks, making it difficult to assign appropriate parallelism to user tasks.

[0006] For example, in the Flink stream computing system, there are two computing tasks A and B running at the same time. Task A is responsible for processing the data stream from the security system sensor, and task B is responsible for processing the data stream from the environmental monitoring sensor. Since the data of the security system may cause serious losses if it is processed late, it is generally believed that the business value of the security business is higher. The Flink stream computing system has a fixed number of computing nodes. When tasks A and B are started for the first time, tasks A and B may have the same degree of parallelism. However, when the data stream of the security system sensor suddenly increases, the computing resources of the computing nodes where the related operators are located may be insufficient, and the operator data processing capacity is reduced, and the security alarm information cannot be fed back in time. At this time, given the data value of tasks A and B, we usually hope to enhance the data processing efficiency of task A, first of all, to ensure that the data of task A can be processed in time, so it is necessary to reduce the operator parallelism of task B, so that it can give up the computing resources of the related computing nodes, to ensure that task A can be executed first, and to ensure that task B can continue to run, so as to efficiently utilize system resources.

[0007] However, the existing method for setting the task parallelism of the stream computing system cannot timely and appropriately configure the task parallelism according to the system resource situation, and therefore cannot guarantee the operation of highly important businesses, thereby failing to achieve efficient utilization of the stream computing system resources. Summary of the invention

[0008] The purpose of the embodiments of the present invention is to provide a method for optimizing the parallelism of stream computing tasks, a device for optimizing the parallelism of stream computing tasks, a stream computing system, an electronic device and a computer-readable storage medium to solve the problem of efficient use of resources in a stream computing system.

[0009] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0010] In a first aspect, an embodiment of the present invention provides a method for optimizing the parallelism of a stream computing task, which is applied to an electronic device. The method includes:

[0011] Obtaining the performance parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing, wherein the performance parameter value of each computing node includes: the parameter value of the CPU, memory, network bandwidth and / or task throughput of each computing node;

[0012] Based on the task parallelism model, determine the parallelism of each task when the total value of all currently running stream computing tasks is the largest, wherein the task parallelism model determines the value of the task by the difference between the task benefit and the task overhead, the task benefit is determined by the preset task priority and task throughput, the task overhead is determined by the resources consumed by the task, the resources include CPU, memory and / or network bandwidth, and the task throughput and the resources consumed by the task are functions of the task parallelism;

[0013] The parallelism of all currently running stream computing tasks is adjusted according to the determined parallelism of each task.

[0014] In a second aspect, an embodiment of the present invention provides a device for optimizing parallelism of a stream computing task, including:

[0015] The performance monitoring module is used to obtain the performance parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing, wherein the performance parameter value of each computing node includes: the parameter value of the CPU, memory, network bandwidth and / or task throughput of each computing node;

[0016] A scheduling strategy module, for determining the parallelism of each task when the total value of all currently running stream computing tasks is the largest based on a task parallelism model, wherein the task parallelism model determines the value of a task by the difference between a task benefit and a task overhead, the task benefit is determined by a preset task priority and task throughput, the task overhead is determined by resources consumed by the task, the resources include CPU, memory and / or network bandwidth, and the task throughput and the resources consumed by the task are functions of task parallelism;

[0017] The scheduling control module is used to adjust the parallelism of all currently running stream computing tasks according to the determined parallelism of each task.

[0018] In a third aspect, an embodiment of the present invention provides a stream computing system, including: a stream computing task parallelism optimization device as described in the second aspect.

[0019] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0020] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0021] In an embodiment of the present invention, by obtaining the parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing, wherein the parameter value of each computing node includes: the parameter value of the CPU, memory, network bandwidth and / or task throughput of each computing node; based on the task parallelism model, determining the parallelism of each task when the total value of all currently running stream computing tasks is the largest, wherein the task parallelism model determines the value of the task by the difference between the task benefit and the task overhead, the task benefit is determined by the preset task priority and task throughput, the task overhead is determined by the resources consumed by the task, the resources include CPU, memory and / or network bandwidth, and the task throughput and the resources consumed by the task are functions of the task parallelism; adjusting the parallelism of all currently running stream computing tasks according to the determined parallelism of each task; in an environment where stream computing resources are limited, the optimal parallelism of each stream computing task can be calculated in combination with task characteristics and resource conditions. The parallelism of each task can be dynamically adjusted without human intervention, which can maximize the utilization rate of stream computing resources and maximize the value of benefits while ensuring the stable operation of stream computing tasks. Among them, by introducing task priorities that represent the importance of the business, the parallelism of tasks can be optimally configured according to the importance of the business, so that businesses with higher importance can obtain more operation guarantees, which solves the problem that the current stream computing does not properly configure the parallelism of tasks. The task parallelism model can be used to evaluate the value obtained by running a stream computing task, and by optimizing the parallelism of all stream computing tasks, the needs of maximizing the overall value of stream computing and maximizing resource utilization can be met. In addition, the method is simple to implement, and the optimal parallelism of all stream computing tasks can be determined at one time. The parallelism of all tasks can be adjusted, and the changes to the stream computing system are relatively small. It can be applied to processing scenarios of complex business data such as the Internet of Things. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a flow chart of a method for optimizing the parallelism of a stream computing task provided by an embodiment of the present invention;

[0023] Figure 2It is a schematic diagram illustrating the network bandwidth overhead of the Flink stream computing system;

[0024] Figure 3 is a flow chart of a method for determining task parallelism through a genetic algorithm provided by an embodiment of the present invention;

[0025] Figure 4 is a flow chart of a method for determining task parallelism through an improved genetic algorithm provided by an embodiment of the present invention;

[0026] Figure 5 is another flow chart of stream computing task parallelism optimization provided by an embodiment of the present invention;

[0027] Figure 6 It is a structural diagram of a Flink stream computing system that implements the stream computing task parallelism optimization method of an embodiment of the present invention;

[0028] Figure 7 It is a structural diagram of a device for optimizing parallelism of stream computing tasks provided by an embodiment of the present invention;

[0029] Figure 8 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0031] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0032] The following describes in detail the method for optimizing the parallelism of stream computing tasks provided by the embodiment of the present invention through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0033] See also Figure 1 , Figure 1 1 is a flow chart of a method for optimizing the parallelism of a stream computing task provided by an embodiment of the present invention. The method is applied to an electronic device, which may be a server. The server may be a physical server including an independent host, or a virtual server carried by a host cluster, or a cloud server, etc. The embodiment of the present invention does not limit this. Figure 1 As shown, the method comprises the following steps:

[0034] Step 101: Obtain the performance parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing.

[0035] Optionally, the performance parameter values ​​of each computing node include: parameter values ​​of the CPU, memory, network bandwidth and / or task throughput of each computing node.

[0036] In an embodiment of the present invention, the performance parameter values ​​of each computing node in the existing stream computing system can be obtained. For example, the performance parameter values ​​of each computing node can include the parameter values ​​of performance indicators such as the CPU, memory, network bandwidth, and task throughput of each computing node, and provide corresponding performance parameter values ​​for determining the parallelism of each task. For example, for the Flink stream computing system, the performance parameter values ​​of each computing node can be obtained from the Flink task control node. The task priority can be set for each currently running stream computing task according to the business importance of the stream computing task, wherein the importance of the business can be pre-evaluated based on experience. The higher the importance of the business, the greater the benefit obtained by allocating computing resources to it. In order to ensure the data processing capability of tasks with higher importance, it is necessary to assign a higher task priority to it, so that it can obtain a higher task parallelism, so that it occupies more computing resources, and then obtains a higher business data processing efficiency.

[0037] For example, 10 priorities can be pre-set, which are divided into 5 categories, each category includes 2 sub-levels. The higher the task importance, the larger the corresponding priority value: Priority 10, 9: used to characterize real-time and critical tasks, that is, the task requires real-time calculation, and the calculated data is critical data; Priority 8, 7: used to characterize real-time but non-critical tasks, that is, the task requires real-time calculation, but the calculated data is non-critical data; Priority 6, 5: used to characterize quasi-real-time tasks, that is, the task requires strong real-time performance; Priority 4, 3: used to characterize non-real-time single-critical tasks, that is, the task does not require real-time calculation, but the calculated data is critical data; Priority 2, 1: used to characterize non-real-time and non-critical tasks, that is, the task does not require real-time calculation, and the calculated data is non-critical data. According to the business importance of the currently running stream computing task, a matching priority is set for each stream computing task.

[0038] Step 102: Based on the task parallelism model, determine the parallelism of each task when the total value of all currently running stream computing tasks is the largest.

[0039] Optionally, the task parallelism model determines the value of the task by the difference between the task benefit and the task overhead. The task benefit is determined by the preset task priority and task throughput, and the task overhead is determined by the resources consumed by the task. The resources include CPU, memory, and network bandwidth. The task throughput and the resources consumed by the task are functions of the task parallelism.

[0040] In the embodiment of the present invention, a task parallelism model can be pre-constructed to determine the parallelism of each task in the stream computing based on the constructed task parallelism model. The task parallelism model can be composed of task benefits and task costs. i , the task parallelism model can be expressed as formula 1:

[0041] Value i =Income i –Cost i (Formula 1)

[0042] Among them, i is an integer, representing the stream computing task Task i Ordinal number of Income i For task benefits, it is to run the task Task i Business benefits gained; Cost i It is the task overhead, which is the time it takes to run the task. i Resources consumed; when the task benefit is greater than the task cost, run the task i Will get the value of the task Value i The following will explain the task income i and task cost i The influencing factors are explained as follows:

[0043] Mission income i It can be determined by task priority and task throughput. The task benefit can be expressed by formula 2 as follows:

[0044] Income i =Priority i *Capacity i (Formula 2)

[0045] Among them, Priority i Task priority is the priority of the task. i Capacity is set according to the business importance; iis the task throughput, indicating the task i The amount of data that can be processed per unit time.

[0046] For any task i The higher the degree of parallelism, the more operators are calculated, and the task throughput Capacity i The larger the value, the task throughput can be expressed as formula 3:

[0047] Capacity i =Stream i *Parallel i (Formula 3)

[0048] Among them, Stream i Task i The number of data records processed per unit time in each data processing link, Parallel i Task i The degree of parallelism.

[0049] Task Cost i It can include: CPU overhead, memory overhead and network bandwidth overhead. The task overhead can be expressed by formula 4 as:

[0050] Cost i =Cost i cpu +Cost i memory +Cost i network (Formula 4)

[0051] Among them, Cost i cpu is the CPU overhead of task Taski, Cost i memory is the memory overhead of the task Taski, Cost i network It is the network bandwidth overhead of task Taski.

[0052] Operators are the execution units of stream computing tasks. Since a stream computing task may be very complex, it may contain many operators. Taking the Flink stream computing system as an example, Flink uses threads for scheduling. It is usually unrealistic to assign a thread to each operator. During the task compilation phase, Flink usually shares threads and tries to assign operators on the same link to one thread for execution. Therefore, generally speaking, for a task with a concurrency of n, n CPU cores will be occupied. Therefore, the CPU overhead can be expressed by Formula 5 as follows:

[0053] Cost i cpu =Parallel i (Formula 5)

[0054] Among them, Parallel i Task i The degree of parallelism.

[0055] Taking the Flink stream computing system as an example, Flink runs on the Java virtual machine. Through the parameter configuration of the Java virtual machine, a specified amount of memory can be allocated to each virtual machine. Since the Java virtual machine does not support setting thread memory quotas, when calculating memory overhead, it is usually assumed that threads in the same virtual machine share the virtual machine's memory equally. Therefore, the memory overhead can be expressed as Formula 6:

[0056] Cost i memory =Ratio i *Parallel i (Formula 6)

[0057] Among them, Ratio i Parallel is the ratio of threads occupied by all parallel links in the Java virtual machine. i Task i The degree of parallelism.

[0058] Taking the Flink stream computing system as an example, the logical topology of the stream computing task is scheduled to the physical node, also called the computing node. After that, there are usually the following three situations:

[0059] 1) The data transmission between operator i and operator j is inter-thread data transmission: operator i and operator j are allocated to the same Java process, that is, the same Java virtual machine. The data transmission between operator i and operator j is usually memory reading and writing, and the overhead is very small and can be ignored;

[0060] 2) The data transmission between operator i and operator j is inter-process data transmission: operator i and operator j are allocated to different Java processes on the same node, that is, two Java virtual machines on the same node. The data transmission between operator i and operator j is usually transmitted by the operating system through shared memory, and the overhead is relatively small;

[0061] 3) Data transmission between operator i and operator j is inter-node data transmission: Operator i and operator j are assigned to different nodes, that is, two different physical computers. Data transmission between operator i and operator j is usually transmitted over the TCP / IP network, which occupies operating system kernel resources and network bandwidth resources, and has a large transmission overhead.

[0062] The network bandwidth overhead mainly considers the occupation of network bandwidth resources in the third case. In order to facilitate the statistics of the network bandwidth overhead of the task, taking the Flink stream computing system as an example, by adding location tags when compiling the logical topology of the stream computing task, when the logical topology of the stream computing task is scheduled to the physical node for execution, each operator sets the IP address of the current node as the location tag. When the physical topology of the stream computing task is executed, it is easy to know whether network bandwidth overhead has been generated based on the location tags of the upstream nodes and the current node. Figure 2 As shown in the figure, when the logical topology of the stream computing task is scheduled to two physical computing nodes with a concurrency of 2, the straight line with an arrow between the two computing nodes in the figure represents the network bandwidth overhead that the data flow will generate. By counting the number of straight lines with arrows between the two computing nodes, the network bandwidth overhead of the entire task can be obtained.

[0063] When parallel links are allocated to different nodes, the network bandwidth overhead is proportional to the square of the parallelism, as can be seen from the topology. Therefore, the network bandwidth overhead can be expressed by Formula 7 as:

[0064] Cost i network =0 (if all parallel links are on the same physical node)

[0065] =Proportion i *Parallel i *Parallel i (If parallel links are allocated on different physical nodes) (Formula 7)

[0066] Among them, Proportion i Task i The bandwidth ratio consumed across nodes, Parallel i Task i The degree of parallelism.

[0067] In the embodiment of the present invention, since the task parallelism model is a model that determines the task value by task revenue and task cost, after constructing the task parallelism model, the total value of all stream computing tasks can be obtained by determining the task value of each task. For a stream computing system with a fixed total number of resources, since the task throughput and the resources consumed by the task are related to the task parallelism, i A function that determines the parallelism of each task while maximizing the total value of all currently running stream computing tasks. i , is a task parallelism Parallel iThe optimization problem belongs to a nonlinear programming problem. Optionally, based on the task parallelism model, the parallelism of each task when the total value of all currently running stream computing tasks is maximized can be determined by an existing nonlinear programming algorithm; or, based on the task parallelism model, the parallelism of each task when the total value of all currently running stream computing tasks is maximized can be determined by improving an existing nonlinear programming algorithm; the embodiment of the present invention does not limit the implementation method of the nonlinear programming algorithm for determining the parallelism of each task when the total value of all currently running stream computing tasks is maximized.

[0068] Step 103: Adjust the parallelism of all currently running stream computing tasks according to the determined parallelism of each task.

[0069] In an embodiment of the present invention, after determining the optimal parallelism of each task, the parallelism of all currently running stream computing tasks can be adjusted according to the optimal parallelism of each task. For example, for a Flink stream computing system, after determining the optimal parallelism of each task, an adjustment task parallelism instruction can be issued to a Flink task control node, and the Flink task control node completes the adjustment of the parallelism of each task of the Flink task computing node according to the adjustment task parallelism instruction, and feeds back the result of the adjustment of the parallelism of each task.

[0070] It can be understood that, through the scheme in the embodiment of the present invention, in an environment where stream computing resources are limited, the optimal parallelism of each stream computing task can be calculated in combination with task characteristics and resource conditions, and the parallelism of each task can be dynamically adjusted without human intervention, which can maximize the utilization rate of stream computing resources and maximize the value benefits while ensuring the stable operation of stream computing tasks; wherein, by introducing task priorities representing the importance of the business, the parallelism of the task can be optimally configured according to the importance of the business, so that the more important the business can obtain more operation guarantees, which solves the problem that the current stream computing does not properly configure the parallelism of the task; the task parallelism model can be used to evaluate the value obtained by running a stream computing task, and by optimizing the parallelism of all stream computing tasks, the requirements of maximizing the overall value of stream computing and maximizing resource utilization can be met; and the method is simple to implement, and the optimal parallelism of all stream computing tasks can be determined at one time, and the parallelism of all tasks can be adjusted, with less changes to the stream computing system; experiments show that the use of this method can effectively improve the stream computing throughput by more than 10%; this method can be applied to processing scenarios of complex business data such as the Internet of Things.

[0071] See also Figure 3 , Figure 3 is a flow chart of a method for determining task parallelism through a genetic algorithm provided by an embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:

[0072] Step 301: construct a fitness function according to the task parallelism model.

[0073] In the embodiment of the present invention, for a stream computing system with a fixed total number of resources, the goal of optimizing task parallelism is to maximize the total value of the stream computing system by finding the parallelism of each task. Since the task parallelism model is a nonlinear function of task parallelism, the parallelism of each task is determined based on the task parallelism model when the total value of all currently running stream computing tasks is the largest. i , which belongs to nonlinear programming problems. Genetic algorithm is a heuristic optimization method that finds a local optimal value in a limited number of iterations and is widely used in linear and nonlinear programming problems. This embodiment constructs the fitness function of the genetic algorithm according to the task parallelism model, and determines the parallelism of each task when the total value of all currently running stream computing tasks is the largest through the genetic algorithm. i The fitness function constructed according to the task parallelism model can be expressed as Formula 8:

[0074] Target=Max(∑Value i ) (Formula 8)

[0075] Target is the total value of all currently running stream computing tasks; Value i Compute the task Task for the i-th stream i The value of can be determined according to Formula 1.

[0076] Step 302: determine the parallelism of the stream computing task and the constraints of the resources of each computing node.

[0077] In an embodiment of the present invention, the parallelism of the stream computing task and the resources of each computing node need to meet certain constraints. Therefore, based on the task parallelism model, the parallelism of each task is determined when the total value of all currently running stream computing tasks is the largest, which belongs to a nonlinear programming problem with constraints. The constraints that the parallelism of the stream computing task and the resources of each computing node need to meet include: the sum of the parallelism of all currently running stream computing tasks is less than or equal to the number of CPU cores of the available physical nodes; the CPU occupancy rate of all stream computing tasks running on each physical node is less than or equal to the preset upper limit value; the memory occupancy rate of all stream computing tasks running on each physical node is less than or equal to the preset upper limit value; the network bandwidth occupancy rate of all stream computing tasks running on each physical node is less than or equal to the preset upper limit value; the parallelism of each stream computing task is an integer.

[0078] Step 303, when the constraints are met, according to the fitness function, through a genetic algorithm, after a finite number of iterations, the parallelism of each task is determined when the total value of all currently running stream computing tasks is maximized.

[0079] In an embodiment of the present invention, under the condition of satisfying the above-mentioned constraints, according to the constructed fitness function, the basic steps of determining the parallelism of each task through a genetic algorithm may include: 1) randomly selecting a feasible solution in the possible solution space, and then entering the iteration phase; 2) calculating the fitness of the feasible solution, that is, calculating the total value of the task under the constraints; 3) crossing the feasible solutions, that is, selecting the parallelism of some tasks and combining them with the parallelism of some tasks of the feasible solution in the previous iteration; 4) mutating the feasible solution, that is, randomly selecting the parallelism of some tasks to modify; 5) copying the feasible solution, that is, according to the size of the fitness, copying part of the parallelism of the previous iteration to the feasible solution of this time according to probability to form a new feasible solution; 6) repeating step 2).

[0080] Due to the adjustment of the parallelism of stream computing tasks, each task needs to be expanded or reduced, that is, the operator needs to be recreated or deleted in the task topology. Taking the Flink stream computing system as an example, most of the operators of the task are stateful operators, that is, the state of the operator is determined by the arriving data. The expansion or reduction of the operator requires the state of the operator to be backed up first, that is, the state of the operator is written to the persistent storage space, and then the state of the operator is copied and split. After the new operator is created, the state of the operator is loaded from the persistent storage space. The entire process of the stream computing system has a large overhead and a high cost. Therefore, the adjustment of task parallelism is usually only performed when the resources of the stream computing system are tight.

[0081] For example, for the Flink stream computing system, there are 4 running tasks, and the task parallelism is 9, 6, 5, and 3 respectively; when the resources are tight for the first time, the corresponding task parallelism is adjusted to 10, 5, 5, and 3; when the resources are tight for the second time, the task parallelism is determined by the above optimization method to be 9, 6, 4, and 4, which is almost the same as the result of the previous parallelism adjustment. Although the task parallelism result determined for the second time is feasible, considering the high cost of adjusting the task parallelism, the adjustment of the task parallelism may not be worth the cost. The reason for this result may be that the data to be processed for all tasks has increased, even approaching the threshold of the stream computing system, resulting in continuous resource shortages, so that the task parallelism obtained by the optimization method may be almost the same as the current task parallelism.

[0082] In order to reduce the number of times the task parallelism is adjusted and prevent unnecessary parallelism adjustments, the embodiment of the present invention introduces a priority influence factor into the task benefit of the task parallelism model and improves the existing genetic algorithm. When the task parallelism obtained by the optimization method this time is not much different from the task obtained by the optimization method last time, the priority influence factor is increased to amplify the weight of the task with a higher priority, thereby giving priority to high-priority tasks when stream computing resources are limited.

[0083] See also Figure 4 , Figure 4 is a flow chart of a method for determining task parallelism through an improved genetic algorithm provided by an embodiment of the present invention, such as Figure 4 As shown, the method comprises the following steps:

[0084] Step 401 : constructing a fitness function according to a task parallelism model, wherein the task benefits of the task parallelism model include a priority influence factor.

[0085] In the embodiment of the present invention, the task benefit of the task parallelism model including the priority influencing factor can be expressed as Formula 9:

[0086] Income _i =Priority _i *Capacity _i *Θ (Formula 9)

[0087] Among them, Priority i Task priority is the priority of the task. i Capacity is set according to the business importance; i is the task throughput, indicating the task i The amount of data that can be processed per unit time; Θ is the priority influencing factor.

[0088] In the embodiment of the present invention, the description of constructing the fitness function using the task parallelism model of the task benefit of Formula 9 can be found in Figure 3 The description of step 301 is given in , so it will not be repeated here.

[0089] Step 402: determine the parallelism of the stream computing task and the constraints of the resources of each computing node.

[0090] In the embodiment of the present invention, the description of step 402 can be found in Figure 3 The description of step 302 is not repeated here.

[0091] Step 403, when the constraints are met, according to the fitness function, through a genetic algorithm, after a finite number of iterations, the parallelism of each task is determined when the total value of all currently running stream computing tasks is maximized.

[0092] In the embodiment of the present invention, the description of step 403 can be found in Figure 3 The description of step 303 is given in , so it will not be repeated here.

[0093] Step 404 , determining whether the difference between the determined parallelism of each task and the current parallelism of each task is less than a preset threshold.

[0094] If the difference between the determined parallelism of each task and the current parallelism of each task is less than the preset threshold, execute step 405, and continue to execute step 403 after step 405; if the difference between the determined parallelism of each task and the current parallelism of each task is greater than or equal to the preset threshold, execute step 406.

[0095] Step 405: Increase the priority impact factor in the task parallelism model, and construct a fitness function according to the task parallelism model with the increased priority impact factor.

[0096] Step 406: Adjust the parallelism of all currently running stream computing tasks according to the determined parallelism of each task.

[0097] In an embodiment of the present invention, under the condition that the above-mentioned constraints are met, according to the constructed fitness function, after a finite number of iterations through a genetic algorithm, the parallelism of each task when the total value of all currently running stream computing tasks is maximized is determined, it is possible to determine whether the difference between the determined parallelism of each task and the current parallelism of each task is less than a preset threshold. If the difference between the determined parallelism of each task and the current parallelism of each task is less than the preset threshold, the priority influence factor in the task parallelism model can be increased, and a fitness function can be constructed according to the task parallelism model with the increased priority influence factor. Continue to determine the parallelism of each task when the total value of all currently running stream computing tasks is maximized according to the constructed fitness function through a genetic algorithm after a finite number of iterations under the condition that the above-mentioned constraints are met, until the difference between the determined parallelism of each task and the current parallelism of each task is greater than or equal to the preset threshold, and then the parallelism of all currently running stream computing tasks is adjusted according to the parallelism of each task determined at this time.

[0098] Optionally, the method for increasing the priority impact factor in the task parallelism model can increase the priority impact factor in the task parallelism model according to the difference between the determined parallelism of each task and the current parallelism of each task, and the number of times the difference is less than a preset threshold. For example, the priority impact factor Θ can be expressed as formula 10:

[0099] Θ = 1 (if the difference between the two parallelisms is greater than or equal to the preset threshold)

[0100] =1+(C / δ 2 )(If the difference between the two parallelisms is less than the preset threshold) (Formula 10)

[0101] Among them, δ 2 is the variance of the difference between two parallelisms, and C is the number of times the cumulative difference is less than the preset threshold.

[0102] See also Figure 5 , Figure 5 is another flow chart of stream computing task parallelism optimization provided by an embodiment of the present invention. Figure 5 As shown, the method is applied to an electronic device, and the method comprises the following steps:

[0103] Step 501, obtaining the performance parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing, wherein the performance parameter value of each computing node includes: the parameter value of the CPU, memory, network bandwidth and task throughput of each computing node.

[0104] Step 502: Obtain task parameter values ​​for stream computing.

[0105] In an embodiment of the present invention, the performance parameter values ​​of each computing node in the existing stream computing system and the task parameter values ​​of the stream computing system can be obtained respectively. For example, the performance parameter values ​​of each computing node can include the parameter values ​​of performance indicators such as CPU, memory, network bandwidth, and task throughput of each computing node. The obtained performance parameter values ​​of each computing node can be stored in a database to provide corresponding performance parameter values ​​for determining the parallelism of each task. Taking the Flink stream computing system as an example, the performance parameter values ​​of each computing node can be obtained from the Flink task control node by deploying a performance monitoring module, and the task parameter values ​​of the stream computing can be obtained from the Flink task control node by deploying a scheduling strategy module.

[0106] Step 503: Determine whether the stream computing resource shortage occurs according to the performance parameter value.

[0107] Step 504: determine whether the number of tasks in the stream computing has changed according to the task parameter value.

[0108] If the stream computing encounters resource shortage and / or the number of stream computing tasks changes, execute step 505; if the stream computing does not encounter resource shortage, execute step 501; if the number of stream computing tasks does not change, execute step 502.

[0109] In an embodiment of the present invention, after obtaining the performance parameter values ​​of each computing node in the stream computing and the task parameter values ​​of the stream computing, it is possible to determine whether the stream computing has experienced resource shortages based on the obtained performance parameter values, and determine whether the number of stream computing tasks has changed based on the obtained task parameter values. If at least one of the following situations occurs: the stream computing has experienced resource shortages and the number of stream computing tasks has changed, it is necessary to adjust the parallelism of each task currently running in the stream computing so that more important businesses can obtain more operational guarantees. Taking the Flink stream computing system as an example, Figure 6 As shown, the deployed performance monitoring module can determine whether resource shortage occurs in stream computing according to the obtained performance parameter values, and when resource shortage occurs in stream computing, a task parallelism optimization request is sent to the scheduling strategy module. The deployed scheduling strategy module can determine whether the number of stream computing tasks changes according to the obtained task parameter values, and when the number of stream computing tasks changes and / or when a task parallelism optimization request is received, the parallelism of each task is determined based on the task parallelism model when the total value of all currently running stream computing tasks is maximized, so as to obtain the optimal parallelism of each task.

[0110] Step 505: Based on the task parallelism model, determine the parallelism of each task when the total value of all currently running stream computing tasks is the largest.

[0111] In the embodiment of the present invention, the description of step 505 can be found in Figure 1 The description of step 101 in Figure 3 The description of steps 301 to 303 in Figure 4 The description of steps 401 to 405 is not repeated here.

[0112] Step 506: Adjust the parallelism of all currently running stream computing tasks according to the determined parallelism of each task.

[0113] In the embodiment of the present invention, the description of step 506 can be found in Figure 1 The description of step 102 in Figure 4 The description of steps 404 to 405 in , so we will not repeat them here. Taking the Flink stream computing system as an example, Figure 6As shown, by deploying a scheduling control module, the optimal parallelism of each task obtained by the scheduling strategy module can be received. The scheduling control module sends an instruction to adjust the task parallelism to the Flink task control node. The Flink task control node adjusts the parallelism of each task of the Flink task computing node according to the instruction to adjust the task parallelism, and feeds back the result of the adjustment of the parallelism of each task to the scheduling control module.

[0114] See also Figure 7 , Figure 7 1 is a schematic diagram of a flow computing task parallelism optimization device provided by an embodiment of the present invention. The device is applied to an electronic device, which may be a server. The server may be a physical server including an independent host, or a virtual server carried by a host cluster, or a cloud server, etc. The embodiment of the present invention does not limit this. Figure 6 As shown, the stream computing task parallelism optimization device 700 may include:

[0115] The performance monitoring module 710 is used to obtain the performance parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing, wherein the performance parameter value of each computing node includes: the parameter value of the CPU, memory, network bandwidth and / or task throughput of each computing node.

[0116] The scheduling strategy module 720 is used to determine the parallelism of each task when the total value of all currently running stream computing tasks is maximized based on the task parallelism model, wherein the task parallelism model determines the value of the task by the difference between the task benefit and the task overhead, the task benefit is determined by the preset task priority and task throughput, the task overhead is determined by the resources consumed by the task, and the resources include CPU, memory and network bandwidth, and the task throughput and the resources consumed by the task are functions of the task parallelism.

[0117] The scheduling control module 730 is used to adjust the parallelism of all currently running stream computing tasks according to the determined parallelism of each task.

[0118] Optionally, the scheduling strategy module 720 includes:

[0119] A construction unit, used for constructing a fitness function according to the task parallelism model;

[0120] A first determining unit, used to determine the parallelism of the stream computing task and the constraints of each computing node resource;

[0121] The second determination unit is used to determine the parallelism of each task when the total value of all currently running stream computing tasks is maximized through a genetic algorithm after a finite number of iterations according to the fitness function when the constraint conditions are met.

[0122] Optionally, the task benefit of the task parallelism model also includes a priority impact factor; the scheduling strategy module 720 also includes:

[0123] A judging unit, used to judge whether the difference between the determined parallelism of each task and the current parallelism of each task is less than a preset threshold;

[0124] An adjustment unit, configured to increase a priority influencing factor in the task parallelism model when a difference between the determined parallelism of each task and the current parallelism of each task is less than a preset threshold;

[0125] The construction unit is also used to construct a fitness function according to a task parallelism model that increases the priority impact factor.

[0126] Optionally, the adjustment unit is further configured to increase a priority influencing factor in the task parallelism model according to a difference between the determined parallelism of each task and the current parallelism of each task, and a number of times the difference is less than a preset threshold.

[0127] Optionally, the scheduling control module 730 is also used to adjust the parallelism of all currently running stream computing tasks according to the determined parallelism of each task when the difference between the determined parallelism of each task and the current parallelism of each task is greater than or equal to a preset threshold.

[0128] Optionally, the determined parallelism of the stream computing task and the constraints of the computing node resources include at least one of the following:

[0129] The sum of the parallelism of all currently running stream computing tasks is less than or equal to the number of CPU cores of the available computing nodes;

[0130] The CPU usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit;

[0131] The memory usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit;

[0132] The network bandwidth usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit;

[0133] The parallelism of each stream computing task is an integer.

[0134] Optionally, the performance monitoring module 710 is further used to determine whether resource shortage occurs in the stream computing based on the performance parameter value; the scheduling strategy module 720 is further used to obtain the task parameter value of the stream computing; determine whether the number of tasks of the stream computing changes based on the task parameter value; if resource shortage occurs in the stream computing and / or the number of tasks of the stream computing changes, then based on the task parallelism model, determine the parallelism of each task when the total value of all currently running stream computing tasks is the largest.

[0135] It is understandable that the stream computing task parallelism optimization device 700 of the embodiment of the present invention can achieve the above Figure 1 , Figure 3 , Figure 4 and Figure 5 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0136] In addition, an embodiment of the present invention further provides a stream computing system, including the above-mentioned stream computing task parallelism optimization device 700.

[0137] It is understandable that the stream computing system of the embodiment of the present invention can implement the above Figure 1 , Figure 3 , Figure 4 and Figure 5 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0138] In addition, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program can achieve the above-mentioned Figure 1 , Figure 3 , Figure 4 and Figure 5 The various processes of the method embodiment shown can achieve the same technical effect, and to avoid repetition, they will not be described again here.

[0139] See also Figure 8 As shown, an embodiment of the present invention further provides an electronic device 80 , including a bus 81 , a transceiver 82 , an antenna 83 , a bus interface 84 , a processor 85 and a memory 86 .

[0140] In the embodiment of the present invention, the electronic device 80 further includes: a program or instruction stored in the memory 86 and executable on the processor 85. Optionally, when the program or instruction is executed by the processor 85, the following steps may be implemented:

[0141] Obtaining the performance parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing, wherein the performance parameter value of each computing node includes: the parameter value of the CPU, memory, network bandwidth and / or task throughput of each computing node;

[0142] Based on the task parallelism model, determine the parallelism of each task when the total value of all currently running stream computing tasks is the largest, wherein the task parallelism model determines the value of the task by the difference between the task benefit and the task overhead, the task benefit is determined by the preset task priority and task throughput, the task overhead is determined by the resources consumed by the task, the resources include CPU, memory and / or network bandwidth, and the task throughput and the resources consumed by the task are functions of the task parallelism;

[0143] The parallelism of all currently running stream computing tasks is adjusted according to the determined parallelism of each task.

[0144] It is understandable that when the computer program is executed by the processor 85, the above Figure 1 , Figure 3 , Figure 4 and Figure 5 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0145] exist Figure 8 In the embodiment, a bus architecture (represented by bus 81) is provided, wherein bus 81 may include any number of interconnected buses and bridges, and bus 81 links together various circuits including one or more processors represented by processor 85 and memory represented by memory 86. Bus 81 may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 84 provides an interface between bus 81 and transceiver 82. Transceiver 82 may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. Data processed by processor 85 is transmitted on a wireless medium via antenna 83, and further, antenna 83 also receives data and transmits the data to processor 85.

[0146] The processor 85 is responsible for managing the bus 81 and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 86 can be used to store data used by the processor 85 when performing operations.

[0147] Optionally, the processor 85 may be a CPU, an ASIC, an FPGA or a CPLD.

[0148] The embodiment of the present invention further provides a computer-readable storage medium having a program or instruction stored thereon, which can implement the above-mentioned Figure 1 , Figure 3 , Figure 4 and Figure 5 The various processes of the method embodiment shown can achieve the same technical effect, and to avoid repetition, they will not be described again here.

[0149] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0150] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0151] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0152] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a service classification device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0153] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for optimizing the parallelism of stream computing tasks, applied to electronic devices, characterized in that: include: Obtaining the performance parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing, wherein the performance parameter value of each computing node includes: the parameter value of the CPU, memory, network bandwidth and / or task throughput of each computing node; Based on the task parallelism model, determine the parallelism of each task when the total value of all currently running stream computing tasks is the largest, wherein the task parallelism model determines the value of the task by the difference between the task benefit and the task overhead, the task benefit is determined by the preset task priority and task throughput, the task overhead is determined by the resources consumed by the task, the resources include CPU, memory and / or network bandwidth, and the task throughput and the resources consumed by the task are functions of the task parallelism; Adjust the parallelism of all currently running stream computing tasks according to the determined parallelism of each task; The task parallelism model is used to determine the parallelism of each task when the total value of all currently running stream computing tasks is the largest, including: Constructing a fitness function according to the task parallelism model; Determine the parallelism of the stream computing task and the resource constraints of each computing node; Under the condition that the constraint conditions are met, according to the fitness function, through a genetic algorithm, after a finite number of iterations, the parallelism of each task is determined when the total value of all currently running stream computing tasks is maximized; The task benefit of the task parallelism model also includes a priority impact factor; Under the condition that the constraint condition is satisfied, after determining the parallelism of each task when the total value of all currently running stream computing tasks is maximized through a genetic algorithm after a finite number of iterations according to the fitness function, the method further includes: Determine whether the difference between the determined parallelism of each task and the current parallelism of each task is less than a preset threshold; If the difference between the determined parallelism of each task and the current parallelism of each task is less than a preset threshold, the priority influence factor in the task parallelism model is increased, and a fitness function is constructed according to the task parallelism model with the increased priority influence factor.

2. The method according to claim 1, characterized in that The step of increasing the priority influencing factor in the task parallelism model includes: According to the difference between the determined parallelism of each task and the current parallelism of each task, and the number of times the difference is less than a preset threshold, the priority influencing factor in the task parallelism model is increased.

3. The method according to claim 2, characterized in that The method further comprises: If the difference between the determined parallelism of each task and the current parallelism of each task is greater than or equal to a preset threshold, the parallelism of all currently running stream computing tasks is adjusted according to the determined parallelism of each task.

4. The method according to claim 1, characterized in that: The constraint condition includes at least one of the following: The sum of the parallelism of all currently running stream computing tasks is less than or equal to the number of CPU cores of the available computing nodes; The CPU usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit; The memory usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit; The network bandwidth usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit; The parallelism of each stream computing task is an integer.

5. The method according to any one of claims 1 to 4, characterized in that Before determining the parallelism of each task when the total value of all currently running stream computing tasks is the maximum based on the task parallelism model, the method further includes: Obtaining task parameter values ​​of the stream computing; Determining whether resource shortage occurs in the stream computing according to the performance parameter value, and determining whether the number of tasks in the stream computing changes according to the task parameter value; The task parallelism model is based on which the parallelism of each task is determined when the total value of all currently running stream computing tasks is the largest, including: If the stream computing encounters resource shortage and / or the number of tasks of the stream computing changes, the parallelism of each task is determined based on the task parallelism model when the total value of all currently running stream computing tasks is maximized.

6. A device for optimizing the parallelism of stream computing tasks, characterized in that: include: The performance monitoring module is used to obtain the performance parameter value of each computing node in the stream computing and the preset task priority of each task currently running in the stream computing, wherein the performance parameter value of each computing node includes: the parameter value of the CPU, memory, network bandwidth and / or task throughput of each computing node; A scheduling strategy module, for determining the parallelism of each task when the total value of all currently running stream computing tasks is the largest based on a task parallelism model, wherein the task parallelism model determines the value of a task by the difference between a task benefit and a task overhead, the task benefit is determined by a preset task priority and task throughput, the task overhead is determined by resources consumed by the task, the resources include CPU, memory and / or network bandwidth, and the task throughput and the resources consumed by the task are functions of task parallelism; The scheduling control module is used to adjust the parallelism of all currently running stream computing tasks according to the determined parallelism of each task; Wherein, the scheduling strategy module includes: A construction unit, used for constructing a fitness function according to the task parallelism model; A first determining unit, used to determine the parallelism of the stream computing task and the constraints of each computing node resource; A second determination unit is used to determine the parallelism of each task when the total value of all currently running stream computing tasks is maximized through a genetic algorithm after a finite number of iterations according to the fitness function when the constraint condition is satisfied; The task benefit of the task parallelism model also includes a priority impact factor; The scheduling strategy module includes: A judging unit, used to judge whether the difference between the determined parallelism of each task and the current parallelism of each task is less than a preset threshold; An adjustment unit, configured to increase a priority influencing factor in the task parallelism model when a difference between the determined parallelism of each task and the current parallelism of each task is less than a preset threshold; The construction unit is also used to construct a fitness function according to a task parallelism model that increases the priority impact factor.

7. The device according to claim 6, characterized in that The adjustment unit is further configured to increase the priority influencing factor in the task parallelism model according to the difference between the determined parallelism of each task and the current parallelism of each task, and the number of times the difference is less than a preset threshold.

8. The device according to claim 6, characterized in that The constraint condition includes at least one of the following: The sum of the parallelism of all currently running stream computing tasks is less than or equal to the number of CPU cores of the available computing nodes; The CPU usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit; The memory usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit; The network bandwidth usage of all stream computing tasks running on each computing node is less than or equal to the preset upper limit; The parallelism of each stream computing task is an integer.

9. An electronic device, characterized in that: It includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein when the program or instruction is executed by the processor, the steps of the method for optimizing the parallelism of a stream computing task as described in any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for optimizing the parallelism of stream computing tasks as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Cost benefit-based storm task scheduling method

    CN111522637A