Node configuration method, device and system
Patent Information
- Application Number
- CN202280099503.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2025-04-04
AI Technical Summary
In stream computing, existing technology requires restarting all nodes when expanding or reducing operator capacity, resulting in large delays in task processes, and may lead to data loss and waste of computing resources.
By controlling the node, only the node of the operator that needs to be expanded and reduced and its adjacent nodes are restarted, while other nodes maintain normal execution. Checkpoints are used to obtain historical status data to avoid data loss, and business data information is carried when inputting data. Indicate uniqueness in to avoid double counting.
It reduces the impact of operator expansion and contraction on the work of system nodes, reduces the overall task process delay, and ensures data integrity and computing resource utilization efficiency.
Smart Images

Figure CN119768773A_ABST
Abstract
Description
A node configuration method, device and system Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a node configuration method, device, and system. Background Art
[0002] Stream computing: Stream computing, also known as streaming computing, is a continuous, low-latency, event-triggered computing job. Stream computing can be implemented by a node system. The node system can include multiple business nodes responsible for operator execution and control nodes on the control side. The algorithm can be deployed and executed on multiple business nodes, where each business node can be responsible for executing a part of the operators in the algorithm. After the execution is completed, the business node can pass the execution results of the operator to the adjacent downstream node. Stream computing generally includes data input (data source), processing operators (one or more) and data output. The data source and data output can be one or more.
[0003] For stream computing tasks, task traffic can vary across time periods. For example, if the task is to count the daily traffic volume within a city, the traffic volume during the morning and evening rush hours will be significantly higher than during other time periods, resulting in higher flow data during these peak hours. In this case, due to the real-time fluctuations in task traffic, the task computation is always performed using the originally allocated resources. When task traffic is low, only a portion of the resources are required, resulting in wasted resources. However, when task traffic is high, even if all allocated resources are used to execute the task, the load will be high and throughput will be reduced. Therefore, for stream computing tasks, resources need to be adjusted based on real-time traffic to match the current task traffic.
[0004] One current resource adjustment method involves scaling operators when task traffic changes during stream computing. The control node triggers a checkpoint, reallocating resources such as concurrent operators based on the current task traffic and restarting all nodes (stopping operator execution during the restart process) to allow all nodes to resume executing operators. However, this resource adjustment method requires stopping the entire task before adjusting resources, and halting the entire task can have a wide-ranging impact, affecting all nodes involved.
[0005] As can be seen from the above, when scaling up or down operators in stream computing, the existing technology requires restarting all nodes, resulting in a large delay in the overall task process.
[0006] Summary of the Invention
[0007] The present application provides a node configuration method, device, and system, which reduce the impact of operator scaling on the operation of system nodes, thereby reducing the overall task process delay.
[0008] In the first aspect, the present application provides a node configuration method, which is applied to a control node, wherein the control node is connected to multiple nodes, each of which is used to execute part of the operators in the algorithm, and the stream computing of the algorithm is realized through data transmission between the multiple nodes. The multiple nodes include a first node and a second node. The method includes: determining first configuration information, the first configuration information includes first information, and the first information indicates that the first node performs a restart; wherein the operator executed by the first node needs to be expanded or reduced in capacity, or the operator executed by the adjacent node of the first node needs to be expanded or reduced in capacity; when the second node maintains the execution of the operator task, the first configuration information is sent to the first node.
[0009] In one possible implementation, the control node can maintain the execution of the operator task on the second node. That is, when the control node determines that the first node is the node that executes the scaling operator (or the adjacent node of the node that executes the scaling operator), and determines that the second node is not the node that executes the scaling operator, nor is it the adjacent node of the node that executes the scaling operator, it can send a restart instruction to the first node and not send a restart instruction to the second node. Since the second node does not receive the restart instruction sent by the control node, it can maintain the normal execution of the operator without being affected.
[0010] In the existing implementation, the control node needs to control all nodes to execute restart and obtain status data. In the embodiment of the present application, after determining the operator that needs to be scaled up or down, the control node can only control the node that executes the operator (and the adjacent nodes of the node that executes the operator) to execute restart and configuration, while other nodes other than the node that executes the operator (and the adjacent nodes of the node that executes the operator) can maintain the normal execution of the operator without the need to execute restart and obtain status data, thereby reducing the impact of operator scaling on the work of system nodes, and thus reducing the overall task process delay.
[0011] It should be understood that the first configuration information can be sent to the first node by the control node in one control instruction at one time, or it can be sent in multiple times. For example, the first information and the second information (and the third information introduced later) can be carried in different control instructions and sent separately to the first node.
[0012] In a possible implementation, the first configuration information further includes second information, where the second information instructs the first node to obtain historical state data generated when executing an operator from a storage location corresponding to a checkpoint.
[0013] During the node configuration process (including restart) for operator scaling, some calculated state data is generated and sent to the nodes of the operators that need to be adjusted. However, the states of these operators have changed due to the parallelism adjustment, which can cause the corresponding information to be lost in the state data, leading to errors and data loss. In this application, for nodes that need to be restarted, the backed-up historical state data can be retrieved from the checkpoint, ensuring that data is not lost.
[0014] In one possible implementation,
[0015] The operator executed by the second node does not need to be expanded or reduced in capacity; or,
[0016] Operators executed by adjacent nodes of the second node do not need to be expanded or reduced in capacity.
[0017] In one possible implementation, if the first node is the node closest to the source node among multiple nodes whose data transmission relationship is affected by the expansion and contraction of the operator (or the first node is the source node), then the first node needs to actively obtain input data, and the input data is the first calculation result obtained by the adjacent upstream node after the last checkpoint (if the first node is the source node, it is necessary to obtain the first to-be-processed business data after the checkpoint), and execute the operation corresponding to the operator based on the obtained input data (and status data), and the obtained calculation result can be passed to the adjacent downstream node.
[0018] For the business node, it is impossible to actively determine whether it is the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator. This part of information can be determined by the control node. Therefore, the control node needs to send indication information to the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator. Taking the first node as the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator as an example, the first configuration information sent by the control node to the first node may also include third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first execution result obtained by the second node executing the operator after the checkpoint, or the first configuration information may also include third information, and the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first to-be-processed business data after the checkpoint.
[0019] For example, the third information may be an identifier, which may indicate that the first node is the node closest to the source node among multiple nodes whose data transmission relationship between nodes is affected due to operator scaling.
[0020] In existing implementations, all nodes need to be restarted when the operator is scaled up or down, that is, all source nodes will be restarted. Since the source node is the input side of the business data, the input of the business data will be blocked during the restart, and the business data will not be saved for a long time, which may cause a timeout, resulting in data loss and inaccurate calculation results. In the embodiment of the present application, when the source node is not the node whose data transmission relationship between nodes is affected by the expansion or contraction of the operator (such as the second node), it does not need to be restarted, thereby ensuring that the input of the business data will not be blocked and will not cause data loss due to timeout.
[0021] In an embodiment of the present application, when the operator is expanded or reduced in size, only some nodes are restarted. For the restarted nodes, it may be necessary to repeat the operator calculations that have been completed in the past (for example, the operator calculations that have been completed after the adjacent previous checkpoint). This part of the calculation results will be passed to the downstream node. If the downstream node is not restarted, it will receive the input data that has been received in the past. After the downstream node has completed the operator execution of this part of the input data in the past, if it re-executes the operator operation based on the repeated input data, it will cause a waste of computing resources.
[0022] In order to solve the above problem, for the node, each input data and business data have a unique correspondence. In an embodiment of the present application, the information indicating the business data is carried in the input data of the node to indicate the uniqueness of each input data. Specifically, after the source node completes the execution of the operator based on the business data, the information indicating the business data can be carried in the calculation result and passed to the downstream node. After the subsequent nodes complete the operator operation of the input data corresponding to the business data, they can carry the information indicating the business data in the calculation result and pass it to the downstream node. In addition, each node itself can also maintain an information indicating the business data corresponding to the latest completed operator operation, and determine whether to execute the operator operation based on the input data based on the comparison between the information indicating the business data carried by the input data and the information maintained by itself. If the information maintained by itself indicates that the operation of the input data has been completed, the operator operation will not be executed on the input data. If the information maintained by itself indicates that the operation of the input data has not been completed, the operator operation can be executed on the input data, and the information maintained by itself can be updated so that the updated information indicates the latest business data. In this way, it can be ensured that the node that has not been restarted does not repeat the operator operation, thereby reducing the computing power overhead.
[0023] Taking the second node as an adjacent downstream node of the first node as an example, after restarting, the first node can execute the first operator based on the input first data to obtain the second data; and transmit the second data and first indication information to the second node, where the first indication information is used to indicate the business data corresponding to the first data; the second node is also used to obtain second indication information maintained by itself, where the second indication information indicates the business data corresponding to the input data most recently processed by the second node; if it is determined based on the first indication information and the second indication information that the second data has not been executed, the second operator is executed based on the second data. If it is determined based on the first indication information and the second indication information that the second data has been executed, the second operator may not be executed based on the second data.
[0024] In a possible implementation, the first indication information includes an identification number of service data corresponding to the first data.
[0025] In a possible implementation, the second node may further modify the second indication information into third indication information when executing the second operator according to the second data, where the third indication information indicates the business data corresponding to the second data.
[0026] In a second aspect, the present application provides a system, including a control node, the control node being connected to a plurality of nodes, each of the nodes being used to execute a portion of operators in an algorithm, the plurality of nodes implementing stream computing of the algorithm through data transmission, the plurality of nodes including the first node and the second node; wherein,
[0027] The control node is configured to send first configuration information to the first node, where the first configuration information includes first information, and the first information instructs the first node to perform a restart; wherein an operator executed by the first node needs to be expanded or reduced in capacity, or an operator executed by a node adjacent to the first node needs to be expanded or reduced in capacity;
[0028] When the first node restarts according to the first configuration information, the second node is used to maintain the execution of the operator task.
[0029] In the existing implementation, the control node needs to control all nodes to execute restart and obtain status data. In the embodiment of the present application, after determining the operator that needs to be scaled up or down, the control node can only control the node that executes the operator (and the adjacent nodes of the node that executes the operator) to execute restart and configuration, while other nodes other than the node that executes the operator (and the adjacent nodes of the node that executes the operator) can maintain the normal execution of the operator without the need to execute restart and obtain status data, thereby reducing the impact of operator scaling on the work of system nodes, and thus reducing the overall task process delay.
[0030] It can be seen that the second aspect corresponds to the first aspect. In addition to controlling the behavior of the node, it also describes the perspective of the second node. Many nouns in the second aspect correspond to those in the first aspect, as well as the description of the technical effects. If the first aspect involves it, then it is also applicable to the second aspect and will not be repeated.
[0031] In a possible implementation, the first node is further configured to, after restart, execute the first operator according to the input first data to obtain the second data;
[0032] transmitting the second data and second indication information to the second node, where the second indication information is used to indicate the service data corresponding to the first data;
[0033] The second node is further configured to obtain third indication information, where the third indication information indicates service data corresponding to the input data most recently processed by the second node;
[0034] If it is determined according to the first indication information and the second indication information that the second data has not been executed, a second operator is executed according to the second data.
[0035] In a possible implementation, the second indication information includes an identification number of service data corresponding to the first data.
[0036] In a possible implementation, the second node is further configured to:
[0037] The third indication information is modified into fourth indication information, where the fourth indication information indicates the business data corresponding to the second data.
[0038] In a possible implementation, the first indication information further includes third information, where the third information instructs the first node to obtain the first data from a storage space after performing a restart;
[0039] The first data is the first execution result obtained by the upstream node of the first node executing the operator after the checkpoint; or, the first data is the first business data to be processed after the checkpoint.
[0040] In a third aspect, the present application provides a node configuration device, the device being located at a control node, the control node being connected to a plurality of nodes, each of the nodes being used to execute a portion of an operator in an algorithm, the plurality of nodes being used to implement stream computing of the algorithm through data transmission, the plurality of nodes including a first node and a second node, the device comprising:
[0041] a configuration module, configured to determine first configuration information, the first configuration information including first information, the first information instructing the first node to perform a restart; wherein an operator executed by the first node needs to be expanded or reduced in capacity, or an operator executed by a node adjacent to the first node needs to be expanded or reduced in capacity;
[0042] A sending module is used to send the configuration information to the first node when the second node maintains the execution of the operator task.
[0043] In a possible implementation, the first configuration information further includes second information, where the second information instructs the first node to obtain historical state data generated when executing an operator from a storage location corresponding to a checkpoint.
[0044] In one possible implementation,
[0045] The operator executed by the second node does not need to be expanded or reduced in capacity; or,
[0046] Operators executed by adjacent nodes of the second node do not need to be expanded or reduced in capacity.
[0047] In one possible implementation, the second node is an adjacent upstream node of the first node, and the first configuration information also includes third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first execution result obtained by the second node executing the operator after the checkpoint.
[0048] In one possible implementation,
[0049] The first node is the source node of the multiple nodes, and the first configuration information also includes third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first business data to be processed after the checkpoint.
[0050] In a possible implementation, the second node is a source node among the multiple nodes.
[0051] In a fourth aspect, an embodiment of the present application provides a device for performing node configuration, the device comprising: a storage medium and a processing circuit, the storage medium being coupled to the processing circuit, the storage medium being used to store computer program code, the computer program code comprising computer instructions, and when the computer instructions are executed by the processing circuit, the node configuration method described in the first aspect is executed.
[0052] The fourth aspect is an apparatus corresponding to the method of the first aspect, which has the function of implementing the node configuration method in any implementation of the first aspect. Many terms in the fourth aspect correspond to those in the first aspect and are also related to the system of the second aspect. Therefore, the descriptions of various words or sentences, descriptions of various implementation methods, and descriptions of technical effects in the first and second aspects, if they are related to the fourth aspect, are also applicable to the fourth aspect and will not be repeated here.
[0053] The following fifth to ninth aspects correspond to the first and second aspects. The explanations of various words or sentences, the descriptions of various implementation methods and the descriptions of technical effects in the first and second aspects, if involved in the following aspects, are also applicable in the following aspects and will not be repeated.
[0054] In a fifth aspect, a communication device is provided, comprising: a processor; the processor is configured to be coupled to a memory, and after reading instructions in the memory, execute a node configuration method as described in any one of the above aspects according to the instructions.
[0055] In a sixth aspect, embodiments of the present application provide a communication device, which may be a system-on-a-chip (SoC), including a processor and a memory, configured to implement the functions of the method described in any of the above aspects. The SoC may consist of a single chip or may include a chip and other discrete components.
[0056] In a seventh aspect, a communication device is provided. The device may be a circuit system, the circuit system including a processing circuit, and the processing circuit is configured to execute any method as described in any of the above aspects.
[0057] In an eighth aspect, an embodiment of the present application further provides a computer-readable storage medium comprising instructions, which, when executed on a computer, enables the computer to execute any of the above methods.
[0058] In a ninth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 provides a schematic diagram of the architecture of this application;
[0060] Figure 2 provides a schematic diagram of the architecture of this application;
[0061] FIG3 is a schematic diagram of an operator before expansion provided in this application;
[0062] FIG4 is a schematic diagram of an operator after expansion provided by this application;
[0063] FIG5 is a flow chart illustrating a stateful stream computing process provided by the present application;
[0064] FIG6 is a flow chart of a stateless stream computing process provided by the present application;
[0065] FIG7 is a schematic diagram of an operator before scaling down provided by the present application;
[0066] FIG8 is a schematic diagram of an operator after scaling down provided by the present application;
[0067] FIG9 is a flowchart illustrating a node configuration method provided by the present application;
[0068] FIG10 is a schematic diagram of a node configuration device provided by the present application;
[0069] FIG11 is a schematic diagram of a node configuration device provided in the present application. DETAILED DESCRIPTION
[0070] First, some expressions that may appear in this application are explained.
[0071] “First” and “second” and the like are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0072] "At least one" means one or more, while "a plurality" means two or more.
[0073] "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
[0074] The character “ / ” generally indicates that the related objects are in an “or” relationship. For example, A / B can mean A or B.
[0075] Furthermore, the terms "comprises," "includes," and "having" as used in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include other steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0076] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples or illustrations. Any implementation (such as the embodiments in this application) or design scheme that is "exemplary" or "for example" should not be interpreted as being preferred or advantageous over other implementations or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete way.
[0077] In the specification and drawings of this application, the terms "of", "relevant" and "corresponding" may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to express are consistent.
[0078] Below, some of the terms that appear in this application are briefly described.
[0079] Node: A node is a device that has at least one of the following functions: processing data and storing data. Nodes run an operating system, and nodes can be distinguished by their operating system; that is, different nodes run different operating systems. Alternatively, the hardware and software used to run an operating system can be considered to belong to the same node. In this application, a node can be a complete physical machine, such as a terminal or a network device, such as a server or server agent. A node can also be a component within a physical machine, such as a processor, memory, or storage. When a physical machine includes two nodes, and these two nodes run different operating systems—for example, if the physical machine includes a central processing unit (CPU) running operating system 1 and a graphics processing unit (GPU) running operating system 2—the CPU and the GPU can be considered to belong to different nodes. When a node is a component, it is a relatively independent entity in terms of hardware. "Independent entity" can be understood as a circuit or module with specialized functions, packaged or assembled on a physical machine. Data access in this application can be understood as one node accessing data maintained by another node through an instance. A physical machine refers to a computer packaged into a product, such as a server, desktop computer, All-In-One PC (AIO), laptop computer, or smartphone.
[0080] In this application, a node can be a software module within a physical machine, such as one or more cores or a portion of computing resources. Computing resources can be instances. An instance is a software module that can run applications or system programs. An instance is only considered an instance when it is run by an operating system; otherwise, it is just a piece of code. Instances can take many forms, such as processes, threads, containers, or functions.
[0081] Terminal: may include desktop, laptop, handheld, and vehicle-mounted user equipment (UE) devices, such as smartphones, cellular phones, desktop computers, tablet computers, smart TVs, smart TV boxes, ultra-mobile personal computers (UMPCs), laptops, personal digital assistants (PDAs), portable multimedia players (PMPs), dedicated media players, consumer communication devices, wearable devices (such as smart watches), AR (augmented reality) / VR (virtual reality) devices, and other types of communication devices.
[0082] Identifiers: Used to distinguish a type or object from other similar or different types of objects. For example, node identifiers, network identifiers, and network card identifiers. Identifiers can be names, numbers, or some other distinguishing characteristic, such as a category identifier. This application does not restrict the implementation of various identifiers, as long as they can be used to distinguish.
[0083] Storage space, also known as address space, refers to one or more address segments available to a device or instance. For example, the virtual address space of a device or instance is the virtual address space available to that device or instance, specifically the virtual address space that belongs to that device or instance. The virtual address space of a device or instance is allocated by the operating system that hosts the device or instance. Another example is the physical address space of a device or instance, which is the physical address space allocated to that device or instance. While the physical address space is used by that device or instance, other devices or instances cannot use the addresses in this physical address space. The physical address space of an instance is allocated by the operating system that runs the instance. This allocation can be dynamic, for example, as the instance runs, the physical address space occupied increases, but there is an upper limit. The size and range of a device's physical address space are typically fixed.
[0084] Stream computing: Stream computing, also known as streaming computing, is a continuous, low-latency, event-triggered computing job. Stream computing can be implemented by a node system. The node system can include multiple business nodes responsible for operator execution and control nodes on the control side. The algorithm can be deployed and executed on multiple business nodes, where each business node can be responsible for executing a part of the operators in the algorithm. After the execution is completed, the business node can pass the execution results of the operator to the adjacent downstream node. Stream computing generally includes data input (data source), processing operators (one or more) and data output. The data source and data output can be one or more.
[0085] Operator Scaling: Scaling operators can be referred to as the parallelism of an operator. Some operators can be executed by multiple parallel execution nodes, with each node processing a subset of the input data. The number of parallel nodes for an operator can be referred to as the parallelism of that operator. For example, input data A can include input data A1 and input data A2. Input data A serves as the input of operator A. If operator A is deployed only on node 1, and all input data A is input to node 1, then the parallelism of operator A is 1. If operator A is deployed on nodes 1 and 2, and input data A1 is input to node 1 and input data A2 is input to node 2, then the parallelism of operator A is 2.
[0086] For stream computing tasks, the task traffic will vary in different time periods. For example, if the task is to count the daily traffic volume in the city, the traffic volume during the morning and evening peak hours will be significantly higher than in other time periods, resulting in higher flow data during the morning and evening peak hours than in other time periods. In this case, due to the real-time changes in task traffic, the originally allocated resources are always used for task calculation. When the task traffic is small, only part of the resources are required to execute, which leads to resource waste. When the task traffic is large, even if all the allocated resources are used to execute the task, it will lead to high load pressure and reduced throughput. Based on this, for stream computing tasks, it is necessary to adjust resources according to real-time traffic (or other factors) to match the current task traffic. One current resource adjustment method is to perform corresponding operator scaling processing when the task traffic changes during the execution of stream computing tasks, that is, to adjust the parallelism of the operators.
[0087] For example, if operator A is deployed only on node 1 and all input data A is input to node 1, the parallelism of operator A is 1. When the load on the node is too large, the parallelism of operator A needs to be adjusted to 2, that is, operator A needs to be expanded. Specifically, part of the data originally executed by node 1 (input data A2) is transferred to other nodes (such as node 2) for execution. After expansion, operator A is deployed on nodes 1 and 2, where input data A1 is input to node 1 and input data A2 is input to node 2.
[0088] For example, if operator A is deployed on nodes 1 and 2, input data A1 in input data A is input to node 1, and input data A2 in input data A is input to node 2, then the parallelism of operator A is 2. When the load on the node is too small, the parallelism of operator A needs to be adjusted to 1, that is, operator A is scaled down. Specifically, the data originally executed by node 2 (input data A2) is transferred to node 1 for execution. The scaled-down operator A is deployed on node 1, where input data A1 and input data A2 are input to node 1.
[0089] State data: The historical data obtained by a node when executing the operations corresponding to an operator in stream computing. In some scenarios, state data is stored in a preconfigured storage space and used in subsequent operator executions.
[0090] Stateless computing: In stream computing, when executing an operator, a node only needs to process the current input data to calculate the correct result.
[0091] Stateful computing: Corresponding to stateless computing, in stream computing, when a node executes an operator, it needs to perform related operations with some historical state data in order to calculate the correct result (such as accumulation).
[0092] Checkpoint: A checkpoint is a global operation that is triggered from the source node of a stream computation and completed by all downstream operators. The real-time tasks of downstream operators periodically perform persistent state backups. The checkpoint mechanism is based on the Chandy-Lamport algorithm. The Chandy-Lamport algorithm simplifies a distributed system into a finite number of processes and the channels between them, essentially a directed graph where nodes are processes and edges are channels. The global state of a distributed system is composed of the information in the processes and channels, which is what the Chandy-Lamport algorithm needs to preserve.
[0093] A hallmark of stream processing is its ability to process a continuous stream of data. Unless the user actively stops it, it typically continues running. This process can be subject to machine failures, network issues, external storage issues, and other issues. To ensure the continued stability of real-time tasks, they must have automatic fault-tolerance and recovery capabilities. Checkpoints are a fault-tolerance and recovery mechanism that ensures that real-time programs can recover even if they encounter unexpected exceptions or machine problems. Checkpoints can reduce fault-tolerance recovery time because recovery starts from the latest checkpoint, rather than from the state at program startup.
[0094] Barrier: Also called a barrier or data fence (which can be understood as the dividing line for persistent storage of detection point status), it is a special internal message generated by the stream computing framework. It will flow to downstream operators as part of the data flow and will not affect the normal data flow.
[0095] In distributed checkpointing, barriers are a key concept, also known as data fences. Barriers are special internal messages that are periodically injected at the source of the data stream during a checkpoint. These barriers flow to downstream operators as part of the data stream without affecting the normal data flow.
[0096] For stream computing tasks, task traffic can vary across time periods. For example, if the task is to count the daily traffic volume within a city, the traffic volume during the morning and evening rush hours will be significantly higher than during other time periods, resulting in higher flow data during these peak hours. In this case, due to the real-time fluctuations in task traffic, the task computation is always performed using the originally allocated resources. When task traffic is low, only a portion of the resources are required, resulting in wasted resources. However, when task traffic is high, even if all allocated resources are used to execute the task, the load will be high and throughput will be reduced. Therefore, for stream computing tasks, resources need to be adjusted based on real-time traffic to match the current task traffic.
[0097] One current resource adjustment method involves scaling operators when task traffic changes during stream computing. The control node triggers a checkpoint to reallocate resources such as concurrent operators based on the current task traffic and restart all nodes (stopping operator execution during the restart process) to allow all nodes to resume executing operators. However, this resource adjustment method requires stopping the entire task before adjusting resources. This complete task stoppage can have a wide-ranging impact, affecting all nodes associated with the task and also affecting task throughput and stability.
[0098] In order to solve the above problems, the present application provides a node configuration method.
[0099] Refer to Figure 1, which is a schematic diagram of an application architecture of the present application.
[0100] FIG1 shows an example of a system 100 in an embodiment of the present application. As shown in FIG1 , the system 100 may include at least one control node 110 and multiple service nodes 120 (service nodes may be referred to as nodes in the embodiment of the present application), and the control node 110 is in communication with each service node 120. The control node 110 may be used to coordinate and manage the operation of each service node 120, for example, allocating resources such as operator nodes to tasks, managing checkpoints, and controlling the data transmission path of tasks between each service node. When the system 100 includes one control node 110, the control node 110 performs the above operations in the system 110; when the system 100 includes multiple control nodes 110, one of the multiple control nodes 110 serves as the main control node to perform the above operations in the system 110, and the other control nodes 110 serve as backup control nodes. The service node 120 may be a working node for executing tasks (e.g., operator execution tasks). Stream computing tasks can be performed between the service nodes 120 through data transmission.
[0101] Refer to Figure 2, which is a schematic diagram of an application architecture of the present application.
[0102] Regarding the Stream Pattern SDK in business algorithms, users write stream applications based on the provided Stream Pattern SDK. The coordinator is responsible for building user stream applications into schedulable, executable graphs, managing the state machines of each computing function in the user stream application, controlling and managing checkpoints for the stream application. The executor is the executor of the user stream application function and is responsible for executing checkpoints and restarting user functions. The data system master is responsible for managing the distributed read and write of functions. The data worker is responsible for controlling the data side of the distributed read and write of functions.
[0103] Next, the system in the embodiment of the present application is introduced with reference to the accompanying drawings.
[0104] In one possible implementation, a system provided by an embodiment of the present application may include a control node, which is connected to multiple nodes (or business nodes), each of which is used to execute part of the operators in the algorithm, and the stream computing of the algorithm is implemented through data transmission between the multiple nodes.
[0105] In one possible implementation, a control node (coordinator) may detect the backpressure value of an operator (exemplarily, the detection may be performed periodically). The backpressure value may also be referred to as the load level. When the backpressure value exceeds or falls below a set threshold, the execution parallelism of the operator may be adjusted.
[0106] Next, we will introduce an example of how to detect the backpressure value of an operator:
[0107] In one possible implementation, the back pressure value can be represented by a cache usage ratio of the node. For example, when the cache usage ratio is between 0 and 0.1, the back pressure value is considered too low; when the cache usage ratio is between 0.1 and 0.5, the back pressure value is considered normal; and when the cache usage ratio is between 0.5 and 1, the back pressure value is considered too high.
[0108] When the control node determines that the backpressure value of the operator is too low, it can trigger the relevant nodes to execute the operator's scaling down. When the control node determines that the backpressure value of the operator is too high, it can trigger the relevant nodes to execute the operator's scaling up.
[0109] In an embodiment of the present application, the control node may determine that an operator executed by a first node among multiple nodes needs to be scaled up or down, or that an upstream node or a downstream node of the first node among multiple nodes needs to be scaled up or down.
[0110] Next, we will introduce how the control node determines which nodes among multiple nodes execute operators that need to be scaled up or down:
[0111] In one possible implementation, the control node can use a scaling algorithm to determine the operators to be scaled down and the number of operators to be scaled down. For example, the control node can collect the idle ratio of the data system cache on each node once every certain time (for example, 1 minute), and then mark each operator as OK / HIGH / LOW according to the threshold division. Then, for the operators marked as LOW, sort them according to the cache usage ratio to determine that operator B needs to be scaled down. According to the ratio a of the maximum value of the OK threshold (i.e., 0.5) / the current cache usage ratio, the actual number of operators required = the number of parallelism of operator B / a, and the number of operators to be scaled down = the current number of operators - the actual number of operators required.
[0112] In one possible implementation, after determining the operator that needs to be scaled up or down, the control node can update the partitioning strategy, state partitioning, and data transmission relationship between nodes whose data transmission relationship is affected by the operator scaling up or down.
[0113] The nodes whose data transmission relationships are affected by operator scaling can be the node executing the scaling operator, as well as its adjacent nodes. Adjacent nodes here can be understood as nodes with a connected relationship. Two adjacent nodes can include adjacent upstream and downstream nodes. When performing stream computing, the calculation results of the upstream node are transmitted to the downstream node, and the downstream node can perform the corresponding operation of the operator based on the calculation results obtained by the upstream node.
[0114] Among them, the partitioning strategy can be the distribution mode of the running data stream, that is, the way of distributing the stream data to the nodes where the downstream operators are located. The state partition can be due to the change of the parallelism of the stream operator. The state persisted before the restart needs to be divided and redistributed according to the new operator parallelism. The data transmission relationship can be the producer / consumer (producer / consumer) relationship between the operator and the upstream and downstream nodes for sending and receiving data.
[0115] For example, referring to Figure 3, in Figure 3, the operator executed by node B needs to be expanded. Therefore, the adjacent upstream nodes of node B and the adjacent downstream nodes of node B are the nodes whose data transmission relationship between nodes is affected by the expansion and contraction of the operator. Specifically, referring to Figure 4, Figure 4 shows the node system after expansion. At this time, the parallelism of the operator of node B changes from 1 to 2, that is, nodes B1 and B2 jointly execute the operator originally executed by node B. In Figure 3, the calculation result obtained by node A can be transmitted to node B. In the system after the operator expansion, part of the calculation result executed by node A needs to be transmitted to node B1, and the other part needs to be transmitted to node B2. In other words, the data transmission relationship between node A and other nodes has changed. Therefore, the data transmission relationship between node A and other nodes needs to be reconfigured by the control node. Similarly, in Figure 3, node C only needs to obtain the calculation result from node B. In the system after the operator expansion, node C needs to obtain the calculation result from nodes B1 and B2. In other words, the data transmission relationship between node C and other nodes has changed. Therefore, the data transmission relationship between node C and other nodes needs to be reconfigured by the control node.
[0116] In addition, the node B1 and the node B2 need to obtain the state data they need from the original state data of the node B.
[0117] In the existing implementation, the control node needs to control all nodes to execute restart and obtain status data. In the embodiment of the present application, after determining the operator that needs to be scaled up or down, the control node can only control the node that executes the operator (and the adjacent nodes of the node that executes the operator) to execute restart and configuration, while other nodes other than the node that executes the operator (and the adjacent nodes of the node that executes the operator) can maintain the normal execution of the operator without the need to execute restart and obtain status data, thereby reducing the impact of operator scaling on the work of system nodes, and thus reducing the overall task process delay.
[0118] In one possible implementation, the control node may determine first configuration information, where the first configuration information includes first information, and the first information indicates that the first node performs a restart; wherein, the operator executed by the first node needs to be expanded or reduced in capacity, or the operator executed by an adjacent node of the first node needs to be expanded or reduced in capacity.
[0119] In one possible implementation, the first configuration information may further include second information instructing the first node to retrieve historical state data generated when executing an operator from a storage location corresponding to a checkpoint. For nodes whose inter-node data transmission relationships are affected by operator scaling, state data may be lost after a restart. Therefore, it is necessary to retrieve historical state data generated when executing an operator from the storage location corresponding to the checkpoint to ensure that state data is not lost during computation.
[0120] It should be understood that the first configuration information can be sent to the first node by the control node in one control instruction at one time, or it can be sent in multiple times. For example, the first information and the second information (and the third information introduced later) can be carried in different control instructions and sent separately to the first node.
[0121] In one possible implementation, the control node can maintain the execution of the operator task on the second node. That is, when the control node determines that the first node is the node that executes the scaling operator (or the adjacent node of the node that executes the scaling operator), and determines that the second node is not the node that executes the scaling operator, nor is it the adjacent node of the node that executes the scaling operator, it can send a restart instruction to the first node and not send a restart instruction to the second node. Since the second node does not receive the restart instruction sent by the control node, it can maintain the normal execution of the operator without being affected.
[0122] In existing implementations, all nodes need to be restarted when the operator is scaled up or down, that is, all source nodes will be restarted. Since the source node is the input side of the business data, the input of the business data will be blocked during the restart, and the business data will not be saved for a long time, which may cause a timeout, resulting in data loss and inaccurate calculation results. In the embodiment of the present application, when the source node is not the node whose data transmission relationship between nodes is affected by the expansion or contraction of the operator (such as the second node), it does not need to be restarted, thereby ensuring that the input of the business data will not be blocked and will not cause data loss due to timeout.
[0123] In a possible implementation, after the first node is restarted, the calculation results after the last checkpoint will be lost. In order to ensure the integrity of the calculation results, it is necessary to re-execute the operator operations after the last checkpoint.
[0124] In one possible implementation, if the first node is the node closest to the source node among multiple nodes whose data transmission relationship is affected by the expansion and contraction of the operator (or the first node is the source node), then the first node needs to actively obtain input data, and the input data is the first calculation result obtained by the adjacent upstream node after the last checkpoint (if the first node is the source node, it is necessary to obtain the first to-be-processed business data after the checkpoint), and execute the operation corresponding to the operator based on the obtained input data (and status data), and the obtained calculation result can be passed to the adjacent downstream node.
[0125] For example, in the order from upstream to downstream, node A, node B and node C are nodes whose data transmission relationship is affected by the scaling of operators. Node B is the node where the operator is scaled, node A is the upstream node of node B, and node C is the downstream node of node B. Node D and node E are nodes whose data transmission relationship is not affected by the scaling of operators. Node D is the upstream node of node A, and node E is the downstream node of node C. The control node can control nodes A, node B and node C to restart, while nodes D and node E execute operators normally. The calculation results of node D after the last checkpoint are data 1 and data 2 respectively. Node A can obtain data 1 after restart (even if the operator execution based on data 1 has been completed before restart) and pass the calculation results to the downstream nodes.
[0126] For example, in the order from upstream to downstream, node A, node B and node C are nodes whose data transmission relationship is affected by the scaling of operators, node B is the node where the operator is scaled, node A is the source node and the upstream node of node B, node C is the downstream node of node B, node E is the node whose data transmission relationship is not affected by the scaling of operators, and node E is the downstream node of node C. The control node can control nodes A, B and C to restart, while nodes D and E execute operators normally. The business data to be executed by node A after the last checkpoint are business data 1 and business data 2 respectively. After restarting, node A can obtain business data 1 (even if the operator execution based on business data 1 has been completed before restarting) and pass the calculation results to the downstream nodes.
[0127] For the business node, it is impossible to actively determine whether it is the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator. This part of information can be determined by the control node. Therefore, the control node needs to send indication information to the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator. Taking the first node as the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator as an example, the first configuration information sent by the control node to the first node may also include third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first execution result obtained by the second node executing the operator after the checkpoint, or the first configuration information may also include third information, and the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first to-be-processed business data after the checkpoint.
[0128] For example, the third information may be an identifier, which may indicate that the first node is the node closest to the source node among multiple nodes whose data transmission relationship between nodes is affected due to operator scaling.
[0129] In one possible implementation, the control unit for receiving data of the restarted operator can update the data reading index in the data buffer to the starting position when reading data for the first time. After consuming the data, the index moves normally, ensuring that the stream data will not be missed in the calculation.
[0130] In an embodiment of the present application, when the operator is expanded or reduced in size, only some nodes are restarted. For the restarted nodes, it may be necessary to repeat the operator calculations that have been completed in the past (for example, the operator calculations that have been completed after the adjacent previous checkpoint). This part of the calculation results will be passed to the downstream node. If the downstream node is not restarted, it will receive the input data that has been received in the past. After the downstream node has completed the operator execution of this part of the input data in the past, if it re-executes the operator operation based on the repeated input data, it will cause a waste of computing resources.
[0131] For example, in order from upstream to downstream, nodes A, B, and C are nodes whose data transmission relationship is affected by operator scaling. Node B is the node where the operator scaling is located, A is the upstream node of node B, C is the downstream node of node B, and E is the node whose data transmission relationship is not affected by operator scaling. Node E is the downstream node of node C. Before nodes A, B, and C are restarted, node C obtains data 1 and data 2 respectively in two operator operations after the checkpoint. Data 1 and data 2 are passed to node E, and node E completes the operator operation based on data 1 and data 2. Due to the restart of nodes A, B, and C, node C needs to re-execute the operator operation to obtain data 1 and data 2 and pass them to node E. However, node E has already completed the operator operation based on data 1 and data 2, and node E has not been restarted. If the operator operation based on data 1 and data 2 is executed again, it will cause a waste of computing resources.
[0132] In order to solve the above problem, for the node, each input data and business data have a unique correspondence. In an embodiment of the present application, the information indicating the business data is carried in the input data of the node to indicate the uniqueness of each input data. Specifically, after the source node completes the execution of the operator based on the business data, it can carry the information indicating the business data in the calculation result and pass it to the downstream node. After the subsequent nodes complete the operator operation of the input data corresponding to the business data, they can carry the information indicating the business data in the calculation result and pass it to the downstream node. In addition, each node itself can also maintain information indicating the business data corresponding to the latest completed operator operation, and determine whether to execute the operator operation based on the input data based on the comparison between the information indicating the business data carried by the input data and the information maintained by itself. If the information maintained by itself indicates that the operation of the input data has been completed, the operator operation will not be executed on the input data. If the information maintained by itself indicates that the operation of the input data has not been completed, the operator operation can be executed on the input data, and the information maintained by itself can be updated so that the updated information indicates the latest business data. In this way, it can be ensured that the node that has not been restarted does not repeat the operator operation, thereby reducing the computing power overhead.
[0133] Taking the second node as an adjacent downstream node of the first node as an example, after restarting, the first node can execute the first operator based on the input first data to obtain the second data; and transmit the second data and first indication information to the second node, where the first indication information is used to indicate the business data corresponding to the first data; the second node is also used to obtain second indication information maintained by itself, where the second indication information indicates the business data corresponding to the input data most recently processed by the second node; if it is determined based on the first indication information and the second indication information that the second data has not been executed, the second operator is executed based on the second data. If it is determined based on the first indication information and the second indication information that the second data has been executed, the second operator may not be executed based on the second data.
[0134] In a possible implementation, the first indication information includes an identification number of service data corresponding to the first data.
[0135] In a possible implementation, the second node may further modify the second indication information into third indication information when executing the second operator according to the second data, where the third indication information indicates the business data corresponding to the second data.
[0136] Exemplarily, the above identifier can be a uuid. A uuid list can be maintained inside the executor of each operator to cache the uuid information of the data that has been processed between two adjacent barriers. The uuid information is used to determine whether the data sent upstream is duplicate data. If it is duplicate, it is discarded and not processed. If it is not duplicate, it is processed normally, ensuring that the stream data is not counted repeatedly.
[0137] Next, we will introduce an example of stream computing in the embodiment of this application with a specific example:
[0138] Referring to Figure 5, which is a schematic diagram of the process of stateful stream computing, it should be understood that the node where the operator is located in this embodiment can be simply referred to as an operator. For example, the source node can be referred to as a source operator.
[0139] The control node coordinator schedules each operator in the execution graph generated by the user-written stream application and deploys and starts the operators based on the scheduling results. For stateful computations, stream application users configure checkpoint-related parameters such as the checkpoint detection interval and checkpoint timeout through the Stream Pattern SDK API. The Source operator's executor calls the user's Source operator function to read data from the data source. The Source operator's executor generates a UUID for each business data item and passes this UUID along with the business data to downstream operators. Data flow is transmitted through the data system's data plane.
[0140] The executor of a non-source operator receives data sent by the upstream operator from the data plane of the data system, extracts the user data, calls the user function (that is, the operator) to perform the calculation, updates the uuid list maintained in the executor memory after the calculation is completed, and then passes the calculation result and the uuid of the data to the downstream operator.
[0141] The executor of the Sink operator receives data sent by the upstream operator from the data plane of the data system, extracts the user data, and calls the user function to write the data into the output system.
[0142] The Coordinator starts checkpointing and state preservation, and begins to dynamically adjust the parallelism of the operator. Based on the checkpoint information configured by the user, the Coordinator periodically sends checkpoint start messages to the executor of the Source operator. The start messages can carry the checkpoint ID.
[0143] The executor of the Source operator receives the checkpoint start message, constructs a barrier type of data, broadcasts it to the data plane of the data system of all connected downstream operators, saves the state of this operator, and responds to the Coordinator with the checkpoint completion status.
[0144] If the executor of a non-Source operator receives business data sent from the upstream, it saves the uuid information carried by the data into the uuid list, then calls the user function to perform the calculation, and then sends the calculation result together with the uuid to the data plane of the data system, which is then sent to the downstream operator by the data system; if a barrier is received, it first broadcasts the barrier through the data plane of the data system to all downstream operators connected to the operator, then saves the state of this operator, responds to the Coordinator with the checkpoint completion status, clears the current information in the uuid list, and finally notifies the data system that it can clear the data information including the barrier.
[0145] If the executor of the Sink operator receives business data sent from the upstream, it saves the UUID information carried by the data into the UUID list, then calls the user function to write the data to the output specified by the user; if a barrier is received, it first saves the state of this operator, responds to the Coordinator with the checkpoint completion status, clears the current information in the UUID list, and then notifies the data system that it can clear the data information including the barrier and previous data.
[0146] In this way, a complete checkpoint is completed, and the Coordinator converts the checkpoint from pending state to completed.
[0147] When the Coordinator detects data accumulation or data reduction in a business flow operator through the detection system, and the backpressure value exceeds the threshold or falls below the threshold, it triggers the operator scaling operation (the following process uses the parallelism of the scaling operator as an example; the parallelism of the scaling operator is similar). The Coordinator determines the operator to be scaled, and then confirms the upstream and downstream operators connected to the operator. It updates the data partitioning mode, operator parallelism, and the producer / consumer relationship between the operator and the upstream and downstream operators in the execution graph. The Coordinator schedules and deploys the newly expanded operator executor. After the newly expanded operator executor is successfully started, the Coordinator notifies the original operator executor that needs to be expanded and the upstream and downstream operator executors connected to the operator executor to restart. The restart command can include the new partitioning mode, the data connection information of each operator with the upstream operator and the downstream operator, the corresponding state storage information in the checkpoint that the operator needs to restore, the operator that needs to adjust the read data index and send the data flag (the operator that is ranked first in the stream application order among several restarted operators).
[0148] The executor of the restarted operator reestablishes the data connection relationship with the executors of the upstream and downstream operators and restores the state information from the most recently completed checkpoint determined by the Coordinator. The operator executor that needs to adjust the data reading index and the data sending flag should set the flag that adjusts the starting index of the data cache to 0 to true when reading data from the data plane of the data system for the first time. Then, it will start reading data from the first data of the replayed data cached on the data plane of the data system (data is a structure containing one or more of the following elements: business flow data, timestamp, key value, label, restart flag, etc.). After receiving the data, the executor of the operator calls the user function to perform the calculation. After the calculation is completed, it updates the maintained uuid list and then passes the calculation result, restart flag, and the uuid of the data to the downstream operator. When reading data from the data plane of the data system subsequently, the flag that adjusts the index to 0 is set to false. Then, it will start reading data from the normal index of the replayed data cached on the data plane of the data system. After receiving the barrier, it is first broadcast to all downstream operators connected to the operator through the data plane of the data system. Then the state of the operator is saved, the checkpoint completion status is notified to the Coordinator, the current information in the uuid list is cleared, and finally the data system is notified to clear the barrier and previous data information. Subsequent data sent to downstream does not need to carry the restart flag.
[0149] The executors of other restarted operators process data and barriers according to the normal process.
[0150] Downstream operators of the last operator in the stream application order among the restarted operators do not need to be restarted. For the executor of the operator that does not need to be restarted, upon receiving data from the upstream restarted operator executor, it first checks whether the data carries the restart flag. If so, it checks whether the UUID carried in the data already exists in the UUID list maintained by this executor. If so, it indicates that the data has already been processed and the data is discarded. If not, it calls the user function to perform the calculation, updates the maintained UUID list after the calculation is complete, and then passes the calculation result and the UUID of the data to the downstream operator. If the user function does not carry the restart flag, it calls the user function to perform the calculation, updates the maintained UUID list after the calculation is complete, and then passes the calculation result and the UUID of the data to the downstream operator. Upon receiving a barrier, it first saves the state of this operator, notifies the Coordinator of the checkpoint completion status, clears the current information in the UUID list, and then notifies the data system that it can clear the information including the barrier and previous data.
[0151] In this way, after passing a complete barrier, the entire business process returns to the normal processing process.
[0152] To scale out the Source operator, since it has no upstream operators, the Coordinator simply notifies the Source and downstream operators to restart. The restart command includes the new partitioning scheme, data connection information for each operator with its upstream and downstream operators, and the corresponding state storage information from the checkpoint that the operator needs to recover. The restarted Source operator simply reads data from the data source and sends it to the downstream operators. The processing for downstream restarts and non-restarted operators is the same as described in the previous embodiment.
[0153] For the expansion of the Sink operator, since the Sink operator has no downstream operators, the Coordinator only needs to notify the restart of the Sink operator and the upstream operator. The restart command contains the new partition mode, the data connection information of each operator and the upstream and downstream operators, the corresponding state storage information in the checkpoint that the operator needs to restore, and the operator that needs to adjust the read data index and send data flag (the operator that is at the front of the stream application order among the restarted operators). The restarted operator processing is the same as described in the above embodiment.
[0154] In the existing implementation, the control node needs to control all nodes to execute restart and obtain status data. In the embodiment of the present application, after determining the operator that needs to be scaled up or down, the control node can only control the node that executes the operator (and the adjacent nodes of the node that executes the operator) to execute restart and configuration, while other nodes other than the node that executes the operator (and the adjacent nodes of the node that executes the operator) can maintain the normal execution of the operator without the need to execute restart and obtain status data, thereby reducing the impact of operator scaling on the work of system nodes, and thus reducing the overall task process delay.
[0155] Refer to Figure 6, which illustrates a stateless stream computation process. For stateless stream computation with the checkpoint mechanism and related parameters configured, no state needs to be saved throughout the entire stream application. Therefore, the core process is identical to a stateful stream application process, with the exception of the lack of state values. The flowchart is similar to Figure 5.
[0156] The process for stream application users who do not configure checkpoint-related parameters is as follows:
[0157] The Coordinator schedules each operator in the execution graph generated by the user-written stream application and deploys and starts the operators based on the scheduling results. For stateless computation, the stream application user does not need to configure checkpoint-related parameters. No information is saved in the entire stream application, and barriers are not triggered periodically.
[0158] The executor of the Source operator calls the user's Source operator function to read data from the data source, and then passes the business data to the downstream operator. The data flow is transmitted through the data system data plane.
[0159] The executor of the non-Source operator receives data sent by the upstream operator from the data plane of the data system, extracts the user data, calls the user function to perform the calculation, and then passes the calculation result to the downstream operator, and then notifies the data system that it can clear the data information that has been received.
[0160] The executor of the Sink operator receives data sent by the upstream operator from the data plane of the data system, extracts the user data, calls the user function to write the data to the output system, and then notifies the data system that it can clear the data information that has been received.
[0161] The Coordinator starts to dynamically adjust the parallelism of the operator.
[0162] When the Coordinator detects through the detection system that there is data accumulation or data reduction in the business flow operator, and the backpressure value exceeds the threshold or the backpressure value is lower than the threshold, the operator expansion and contraction operation is triggered (the following process takes the parallelism of the expansion operator as an example, and the parallelism of the contraction operator is similar). The Coordinator determines the operator that needs to be expanded, and then confirms the upstream and downstream operators connected to the operator, updates the data partitioning mode, operator parallelism, and the producer / consumer relationship of the operator and the upstream and downstream operators in the execution graph. The Coordinator schedules and deploys the newly expanded operator executor. After the newly expanded operator executor is successfully started, the Coordinator notifies the original operator executor that needs to be expanded and the upstream and downstream operator executors connected to the operator executor to restart. The restart command contains the new partitioning mode and the data connection information of each operator with the upstream operator and the downstream operator.
[0163] The executor of the restarted operator re-establishes the data connection relationship with the executors of the upstream and downstream operators, and then reads data from the data surface of the data system. After receiving the data, the executor of the operator calls the user function to perform the calculation, passes the calculation results to the downstream operator, and then notifies the data system that it can clear the data information that has been received.
[0164] The executors of other restarted operators process data according to the normal process.
[0165] For the downstream operators of the last operator in the stream application order among the restarted operators, they do not need to be restarted. For the executor of the operator that is at the front of the stream application and does not need to be restarted, after receiving the data sent by the executor of the upstream restarted operator, it calls the user function to perform the calculation, passes the calculation result to the downstream operator, and then notifies the data system to clear the data information that has been received.
[0166] Next, we will use a specific example to introduce an implementation of operator expansion in stateful stream computing:
[0167] Stream application users use the stream pattern SDK interface to write stateful streaming business applications, configure checkpoint-related parameters through the stream pattern SDK interface, such as the checkpoint detection interval, checkpoint execution timeout, and the maximum number of running checkpoints, and then submit the streaming business application.
[0168] The deployed software system receives the submitted streaming service application and starts the Coordinator.
[0169] The Coordinator schedules each operator in the execution graph generated by the user-written stream application, and deploys and starts the operators based on the scheduling results. In this embodiment, six operators, Source, A, B, C, D, and Sink, are started, as shown in Figures 3 and 4.
[0170] The executor of the Source operator calls the user's Source operator function to read data from the data source. The executor of the Source operator generates a uuid for each data and passes this uuid together with the business flow data to the downstream operator. The data flow is transmitted through the data system data plane.
[0171] The executor of the non-Source operator receives data sent by the upstream operator from the data plane of the data system, extracts the user data, calls the user function to perform the calculation, updates the maintained UUID list after the calculation is completed, and then passes the calculation result, timestamp, key value, label, etc. and the UUID of the data to the downstream operator.
[0172] The executor of the Sink operator receives data sent by the upstream operator from the data plane of the data system, extracts the user data, and calls the user function to write the data into the output system.
[0173] The Coordinator starts checkpointing and state preservation, and begins to dynamically adjust the parallelism of the operators.
[0174] The Coordinator periodically sends checkpoint start messages to the executor of the Source operator based on the checkpoint information configured by the user.
[0175] The executor of the Source operator receives the checkpoint start message, constructs a barrier type of data, broadcasts it to the data plane of the data system of all connected downstream operators, saves the state of this operator, and responds to the Coordinator with the checkpoint completion status.
[0176] If the executor of a non-Source operator (A / B / C / D operator) receives business data sent from the upstream, it saves the UUID information carried by the data into the UUID list, then calls the user function to perform the calculation, and then sends the calculation result together with the UUID to the data plane of the data system, which is then sent to the downstream operator by the data system; if a barrier is received, it first broadcasts the barrier through the data plane of the data system to all downstream operators connected to the operator, then saves the state of the operator, responds to the Coordinator with the checkpoint completion status, clears the current information in the UUID list, and finally notifies the data system that it can clear the data information including the barrier and previous data.
[0177] If the executor of the Sink operator receives business data sent from the upstream, it saves the UUID information carried by the data into the UUID list, then calls the user function to write the data to the output specified by the user; if a barrier is received, it first saves the state of this operator, responds to the Coordinator with the checkpoint completion status, clears the current information in the UUID list, and then notifies the data system that it can clear the data information including the barrier and previous data.
[0178] In this way, a complete checkpoint is completed, and the Coordinator converts the checkpoint from pending state to completed.
[0179] When the Coordinator detects through the detection system that there is data accumulation in the B business flow operator and the back pressure value exceeds the threshold, the operator expansion operation is triggered. The Coordinator can use one of the expansion and contraction algorithms to determine the operators to be expanded and the number of expansions. For example, the Coordinator collects the idle ratio of the data system cache on each node every 1 minute, and then marks each operator as OK / HIGH / LOW according to the threshold division. Then, for the operators marked as HIGH, they are sorted according to the cache usage ratio to determine that the B operator needs to be expanded. The number of operators to be expanded is determined based on the ratio a of the current cache usage ratio / the maximum value of the OK threshold (i.e. 0.1), (a-1)*the current number of operators. After determining the operators to be expanded and the number of expansions, the upstream and downstream operators connected to the operator are confirmed. The upstream operator is operator A and the downstream operator is operator C. The data partitioning mode and operator parallelism are updated in the execution graph. The Coordinator schedules and deploys the newly expanded operator executor B1. After the newly expanded operator executor B1 is successfully started (including establishing data connection relationships with upstream operator executor A and downstream operator executor C), the Coordinator notifies the original B operator executor and A and C operator executors to restart. The restart command includes the new partition mode (the partition mode of operator A is RoundRobin, the partition mode of operator B1 is Forword, the partition mode of operator B2 is Forward, and the partition mode of operator C is Forward). word), data connection information between each operator and upstream and downstream operators (the upstream operator of operator A is Source, the downstream operators of operator A are operators B1 and B2, the upstream operator of operator B1 is operator A, the downstream operator of operator B1 is operator C, the upstream operator of operator B2 is operator A, the downstream operator of operator B2 is operator C, the upstream operators of operator C are operators B1 and B2, and the downstream operator of operator C is operator D), the corresponding state storage information in the checkpoint that the operator needs to recover, and the A operator that needs to adjust the read data index and data sending flag.
[0180] The restarted operator's executor A / B1 / C reestablishes the data connection relationship with the executors of the upstream and downstream operators and restores the status information from the corresponding checkpoint. When the A operator executor reads data from the data plane of the data system for the first time, it sets the flag that adjusts the index to 0 to true. It then starts reading data from the first replayed data cached in the data plane of the data system. After receiving the data, the operator executor calls the user function to perform the calculation. After the calculation is completed, it updates the maintained uuid list and then passes the calculation result, the restart flag, and the uuid of the data to the downstream operator. When reading data from the data plane of the data system subsequently, the flag that adjusts the index to 0 is set to false. It then starts reading data from the normal index of the replayed data cached in the data plane of the data system. After receiving the barrier, it is first broadcast to all downstream operators connected to the operator through the data plane of the data system. Then the state of the operator is saved, the checkpoint completion status is notified to the Coordinator, the current information in the uuid list is cleared, and finally the data system is notified to clear the barrier and previous data information. Subsequent data sent to downstream does not need to carry the restart flag.
[0181] Executors B1 / C of other restarted operators process data and barriers according to the normal process, and executor B2 of the newly deployed and started operator processes data and barriers according to the normal process.
[0182] The downstream operators of operator C do not need to be restarted. When the executor of operator D receives data from the upstream restart operator executor, it first checks whether the data carries a restart flag. If so, it checks whether the UUID carried by the data already exists in the UUID list maintained by this executor. If it does exist, it means that the data has been processed and the data is discarded. If not, the user function is called to perform the calculation. After the calculation is completed, the maintained UUID list is updated, and the calculation result and the UUID of the data are passed to the downstream operator. If the data does not carry a restart flag, the user function is called to perform the calculation. After the calculation is completed, the maintained UUID list is updated, and the calculation result and the UUID of the data are passed to the downstream operator. When a barrier is received, the state of this operator is first saved, the checkpoint completion status is notified to the Coordinator, the current information of the UUID list is cleared, and the data system is notified that the barrier and previous data information can be cleared.
[0183] In this way, after passing a complete barrier, the entire business process returns to the normal processing process.
[0184] In the existing implementation, the control node needs to control all nodes to execute restart and obtain status data. In the embodiment of the present application, after determining the operator that needs to be scaled up or down, the control node can only control the node that executes the operator (and the adjacent nodes of the node that executes the operator) to execute restart and configuration, while other nodes other than the node that executes the operator (and the adjacent nodes of the node that executes the operator) can maintain the normal execution of the operator without the need to execute restart and obtain status data, thereby reducing the impact of operator scaling on the work of system nodes, and thus reducing the overall task process delay.
[0185] Next, we will use a specific example to introduce an implementation of operator scaling in stateful stream computing:
[0186] Stream application users use the stream pattern SDK interface to write stateful streaming business applications, configure checkpoint-related parameters through the stream pattern SDK interface, such as the checkpoint detection interval, checkpoint execution timeout, and the maximum number of running checkpoints, and then submit the streaming business application.
[0187] The deployed software system receives the submitted streaming service application and starts the Coordinator.
[0188] The Coordinator schedules each operator in the execution graph generated by the user-written stream application, and deploys and starts the operators based on the scheduling results. In this embodiment, seven operators, Source, A, B1, B2, C, D, and Sink, are started, as shown in Figures 7 and 8.
[0189] The executor of the Source operator calls the user's Source operator function to read data from the data source. The executor of the Source operator generates a uuid for each data and passes this uuid together with the business flow data to the downstream operator. The data flow is transmitted through the data system data plane.
[0190] The executor of the non-Source operator receives data sent by the upstream operator from the data plane of the data system, extracts the user data, calls the user function to perform the calculation, updates the maintained UUID list after the calculation is completed, and then passes the calculation result, timestamp, key value, label, etc. and the UUID of the data to the downstream operator.
[0191] The executor of the Sink operator receives data sent by the upstream operator from the data plane of the data system, extracts the user data, and calls the user function to write the data into the output system.
[0192] The Coordinator starts checkpointing and state preservation, and begins to dynamically adjust the parallelism of the operators.
[0193] The Coordinator periodically sends checkpoint start messages to the executor of the Source operator based on the checkpoint information configured by the user.
[0194] The executor of the Source operator receives the checkpoint start message, constructs a barrier type of data, broadcasts it to the data plane of the data system of all connected downstream operators, saves the state of this operator, and responds to the Coordinator with the checkpoint completion status.
[0195] If the executor of a non-Source operator (A / B1 / B2 / C / D operator) receives business data sent from the upstream, it saves the UUID information carried by the data into the UUID list, then calls the user function to perform the calculation, and then sends the calculation result together with the UUID to the data plane of the data system, which is then sent to the downstream operator by the data system; if a barrier is received, it first broadcasts the barrier through the data plane of the data system to all downstream operators connected to the operator, then saves the state of the operator, responds to the Coordinator with the checkpoint completion status, clears the current information in the UUID list, and finally notifies the data system that it can clear the data information including the barrier and previous data.
[0196] If the executor of the Sink operator receives business data sent from the upstream, it saves the UUID information carried by the data into the UUID list, then calls the user function to write the data to the output specified by the user; if a barrier is received, it first saves the state of this operator, responds to the Coordinator with the checkpoint completion status, clears the current information in the UUID list, and then notifies the data system that it can clear the data information including the barrier and previous data.
[0197] In this way, a complete checkpoint is completed, and the Coordinator converts the checkpoint from pending state to completed.
[0198] When the Coordinator detects through the detection system that the amount of data in the B business flow operator has decreased and the backpressure value is lower than the threshold, the operator scaling operation is triggered. The Coordinator can use one of the scaling algorithms to determine the operators to be scaled down and the number of operators to be scaled down. For example, the Coordinator collects the free ratio of the data system cache on each node every 1 minute, and then marks each operator as OK / HIGH / LOW according to the threshold division. Then, for the operators marked as LOW, they are sorted according to the cache usage ratio to determine that the B operator needs to be scaled down. According to the ratio a of the maximum value of the OK threshold (i.e. 0.5) / the current cache usage ratio, the actual number of operators required = the number of parallel operators of operator B / a, and the number of operators to be scaled down = the current number of operators - the actual number of operators required. After determining the operators to be scaled down and the number of operators to be scaled down, the upstream and downstream operators connected to the operator are confirmed. The upstream operator is operator A and the downstream operator is operator C. The data partitioning mode and operator parallelism are updated in the execution graph. The Coordinator stops the operator executor B2 and notifies the B1 operator executor and the A and C operator executors to restart. The restart command includes the new partitioning mode (the partitioning mode of operator A is Forword, the partitioning mode of operator B1 is Forword, and the partitioning mode of operator C is Forword), the data connection information between each operator and the upstream operator and downstream operators (the upstream operator of operator A is Source, the downstream operator of operator A is operator B1, the upstream operator of operator B1 is operator A, the downstream operator of operator B1 is operator C, the upstream operator of operator C is operator B1, and the downstream operator of operator C is operator D), the corresponding state storage information in the checkpoint that the operator needs to recover, the A operator that needs to adjust the read data index and the data sending flag.
[0199] The restarted operator's executor A / B1 / C reestablishes the data connection relationship with the executors of the upstream and downstream operators and restores the status information from the corresponding checkpoint. When the A operator executor reads data from the data plane of the data system for the first time, it sets the flag that adjusts the index to 0 to true. It then starts reading data from the first replayed data cached in the data plane of the data system. After receiving the data, the operator executor calls the user function to perform the calculation. After the calculation is completed, it updates the maintained uuid list and then passes the calculation result, the restart flag, and the uuid of the data to the downstream operator. When reading data from the data plane of the data system subsequently, the flag that adjusts the index to 0 is set to false. It then starts reading data from the normal index of the replayed data cached in the data plane of the data system. After receiving the barrier, it is first broadcast to all downstream operators connected to the operator through the data plane of the data system. Then the state of the operator is saved, the checkpoint completion status is notified to the Coordinator, the current information in the uuid list is cleared, and finally the data system is notified to clear the barrier and previous data information. Subsequent data sent to downstream does not need to carry the restart flag.
[0200] Executors B1 / C of other restarted operators process data and barriers according to the normal process.
[0201] The downstream operators of operator C do not need to be restarted. When the executor of operator D receives data from the upstream restart operator executor, it first checks whether the data carries a restart flag. If so, it checks whether the UUID carried by the data already exists in the UUID list maintained by this executor. If it does exist, it means that the data has been processed and the data is discarded. If not, the user function is called to perform the calculation. After the calculation is completed, the maintained UUID list is updated, and the calculation result and the UUID of the data are passed to the downstream operator. If the data does not carry a restart flag, the user function is called to perform the calculation. After the calculation is completed, the maintained UUID list is updated, and the calculation result and the UUID of the data are passed to the downstream operator. When a barrier is received, the state of this operator is first saved, the checkpoint completion status is notified to the Coordinator, the current information of the UUID list is cleared, and the data system is notified that the barrier and previous data information can be cleared.
[0202] In this way, after passing a complete barrier, the entire business process returns to the normal processing process.
[0203] Based on the above ideas, referring to FIG9 , FIG9 is a flowchart of a node configuration method provided by an embodiment of the present application. As shown in FIG9 , the method is applied to a control node, the control node is connected to multiple nodes, each of the nodes is used to execute part of the operator in the algorithm, and the stream computing of the algorithm is implemented through data transmission between the multiple nodes. The multiple nodes include a first node and a second node. The method includes:
[0204] 901. Determine first configuration information, where the first configuration information includes first information, and the first information indicates that the first node performs a restart; wherein, an operator executed by the first node needs to be expanded or reduced in capacity, or an operator executed by an adjacent node of the first node needs to be expanded or reduced in capacity.
[0205] 902. When the second node maintains execution of the operator task, send the first configuration information to the first node.
[0206] In one possible implementation, the control node can maintain the execution of the operator task on the second node. That is, when the control node determines that the first node is the node that executes the scaling operator (or the adjacent node of the node that executes the scaling operator), and determines that the second node is not the node that executes the scaling operator, nor is it the adjacent node of the node that executes the scaling operator, it can send a restart instruction to the first node and not send a restart instruction to the second node. Since the second node does not receive the restart instruction sent by the control node, it can maintain the normal execution of the operator without being affected.
[0207] In existing implementations, all nodes need to be restarted when the operator is scaled up or down, that is, all source nodes will be restarted. Since the source node is the input side of the business data, the input of the business data will be blocked during the restart, and the business data will not be saved for a long time, which may cause a timeout, resulting in data loss and inaccurate calculation results. In the embodiment of the present application, when the source node is not the node whose data transmission relationship between nodes is affected by the expansion or contraction of the operator (such as the second node), it does not need to be restarted, thereby ensuring that the input of the business data will not be blocked and will not cause data loss due to timeout.
[0208] In a possible implementation, the first configuration information further includes second information, where the second information instructs the first node to obtain historical state data generated when executing an operator from a storage location corresponding to a checkpoint.
[0209] During the node configuration process (including restart) for operator scaling, some calculated state data is generated and sent to the nodes of the operators that need to be adjusted. However, the states of these operators have changed due to the parallelism adjustment, which can cause the corresponding information to be lost in the state data, leading to errors and data loss. In this application, for nodes that need to be restarted, the backed-up historical state data can be retrieved from the checkpoint, ensuring that data is not lost.
[0210] In one possible implementation,
[0211] The operator executed by the second node does not need to be expanded or reduced in capacity; or,
[0212] Operators executed by adjacent nodes of the second node do not need to be expanded or reduced in capacity.
[0213] In one possible implementation, if the first node is the node closest to the source node among multiple nodes whose data transmission relationship is affected by the expansion and contraction of the operator (or the first node is the source node), then the first node needs to actively obtain input data, and the input data is the first calculation result obtained by the adjacent upstream node after the last checkpoint (if the first node is the source node, it is necessary to obtain the first to-be-processed business data after the checkpoint), and execute the operation corresponding to the operator based on the obtained input data (and status data), and the obtained calculation result can be passed to the adjacent downstream node.
[0214] For the business node, it is impossible to actively determine whether it is the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator. This part of information can be determined by the control node. Therefore, the control node needs to send indication information to the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator. Taking the first node as the node closest to the source node among the multiple nodes whose data transmission relationship between nodes is affected by the scaling of the operator as an example, the first configuration information sent by the control node to the first node may also include third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first execution result obtained by the second node executing the operator after the checkpoint, or the first configuration information may also include third information, and the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first to-be-processed business data after the checkpoint.
[0215] For example, the third information may be an identifier, which may indicate that the first node is the node closest to the source node among multiple nodes whose data transmission relationship between nodes is affected due to operator scaling.
[0216] In existing implementations, all nodes need to be restarted when the operator is scaled up or down, that is, all source nodes will be restarted. Since the source node is the input side of the business data, the input of the business data will be blocked during the restart, and the business data will not be saved for a long time, which may cause a timeout, resulting in data loss and inaccurate calculation results. In the embodiment of the present application, when the source node is not the node whose data transmission relationship between nodes is affected by the expansion or contraction of the operator (such as the second node), it does not need to be restarted, thereby ensuring that the input of the business data will not be blocked and will not cause data loss due to timeout.
[0217] In an embodiment of the present application, when the operator is expanded or reduced in size, only some nodes are restarted. For the restarted nodes, it may be necessary to repeat the operator calculations that have been completed in the past (for example, the operator calculations that have been completed after the adjacent previous checkpoint). This part of the calculation results will be passed to the downstream node. If the downstream node is not restarted, it will receive the input data that has been received in the past. After the downstream node has completed the operator execution of this part of the input data in the past, if it re-executes the operator operation based on the repeated input data, it will cause a waste of computing resources.
[0218] In order to solve the above problem, for the node, each input data and business data have a unique correspondence. In an embodiment of the present application, the information indicating the business data is carried in the input data of the node to indicate the uniqueness of each input data. Specifically, after the source node completes the execution of the operator based on the business data, the information indicating the business data can be carried in the calculation result and passed to the downstream node. After the subsequent nodes complete the operator operation of the input data corresponding to the business data, they can carry the information indicating the business data in the calculation result and pass it to the downstream node. In addition, each node itself can also maintain an information indicating the business data corresponding to the latest completed operator operation, and determine whether to execute the operator operation based on the input data based on the comparison between the information indicating the business data carried by the input data and the information maintained by itself. If the information maintained by itself indicates that the operation of the input data has been completed, the operator operation will not be executed on the input data. If the information maintained by itself indicates that the operation of the input data has not been completed, the operator operation can be executed on the input data, and the information maintained by itself can be updated so that the updated information indicates the latest business data. In this way, it can be ensured that the node that has not been restarted does not repeat the operator operation, thereby reducing the computing power overhead.
[0219] Taking the second node as an adjacent downstream node of the first node as an example, after restarting, the first node can execute the first operator based on the input first data to obtain the second data; and transmit the second data and first indication information to the second node, where the first indication information is used to indicate the business data corresponding to the first data; the second node is also used to obtain second indication information maintained by itself, where the second indication information indicates the business data corresponding to the input data most recently processed by the second node; if it is determined based on the first indication information and the second indication information that the second data has not been executed, the second operator is executed based on the second data. If it is determined based on the first indication information and the second indication information that the second data has been executed, the second operator may not be executed based on the second data.
[0220] In a possible implementation, the first indication information includes an identification number of service data corresponding to the first data.
[0221] In a possible implementation, the second node may further modify the second indication information into third indication information when executing the second operator according to the second data, where the third indication information indicates the business data corresponding to the second data.
[0222] Referring to FIG. 10 , FIG. 10 is a schematic diagram of the structure of a node configuration device provided in an embodiment of the present application. The device is located at a control node, and the control node is connected to multiple nodes. Each of the nodes is used to execute part of the operators in the algorithm. The stream computing of the algorithm is implemented through data transmission between the multiple nodes. The multiple nodes include a first node and a second node. The device 1000 includes:
[0223] Configuration module 1001 is configured to determine first configuration information, where the first configuration information includes first information indicating that the first node is to be restarted; wherein an operator executed by the first node needs to be expanded or reduced in capacity, or an operator executed by a node adjacent to the first node needs to be expanded or reduced in capacity;
[0224] The sending module 1002 is configured to send the configuration information to the first node when the second node maintains execution of the operator task.
[0225] In a possible implementation, the first configuration information further includes second information, where the second information instructs the first node to obtain historical state data generated when executing an operator from a storage location corresponding to a checkpoint.
[0226] In one possible implementation,
[0227] The operator executed by the second node does not need to be expanded or reduced in capacity; or,
[0228] Operators executed by adjacent nodes of the second node do not need to be expanded or reduced in capacity.
[0229] In one possible implementation, the second node is an adjacent upstream node of the first node, and the first configuration information also includes third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first execution result obtained by the second node executing the operator after the checkpoint.
[0230] In one possible implementation,
[0231] The first node is the source node of the multiple nodes, and the first configuration information also includes third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first business data to be processed after the checkpoint.
[0232] In a possible implementation, the second node is a source node among the multiple nodes.
[0233] The above-mentioned device 1000 is used to execute the configuration method of the aforementioned node, especially the method executed by the corresponding control node. Therefore, the specific implementation, description and technical effects can all be referred to the corresponding paragraphs above and will not be repeated here. The device 1000 can be a control node or a part of the first control node. The specific implementation of each of the above-mentioned modules is not limited in this application. For example, the above-mentioned modules can be integrated into one module for implementation. For another example, the configuration module 1001 can be a processor or controller, such as a CPU, a general-purpose processor, a DSP, an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0234] Figure 11 shows a possible logical structure diagram of a device for node configuration provided by an embodiment of the present application. Device 1100 includes a storage medium 11002 and a processing module 11001. Storage medium 11002 is coupled to processing module 11001 and is used to store computer program code and data. The computer program code includes computer instructions. When executed by processing module 11001, the aforementioned method can be performed.
[0235] The processing module 11001 can be a central processing unit, a graphics processor, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute the various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processing module 11001 can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The storage medium 11002 can be a read-only memory (ROM) or other type of storage module that can store static information and instructions, or a random access memory (RAM) or other type of storage module that can dynamically store information and instructions, or an electrically erasable programmable read-only memory (EEPROM) or other magnetic storage device.
[0236] The storage medium 11002 and the processing module 11001 can be connected via a bus. This application does not limit the layout of the various components in the device 1100. The bus here refers to a bus within the device, and can specifically be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is used in Figure 11, but this does not mean that there is only one bus or one type of bus in the device 1100.
[0237] The device 1100 corresponding to Figure 11 can be the device where the aforementioned control node is located, and is used to execute the method executed by the aforementioned control node. Therefore, the specific implementation, description and technical effects can all refer to the corresponding paragraphs of the previous methods, devices and systems, and will not be repeated here.
[0238] As an embodiment, the device 1100 may include multiple processors. Each of these processors may be a single-core processor or a multi-core processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions). In addition, the computer program code in the embodiments of the present application may also be referred to as a computer program or code, or other names, and the computer instructions may also be referred to as instructions or commands, which are not specifically limited in the embodiments of the present application.
[0239] In addition, those skilled in the art will appreciate that device 1100 may include fewer or more components than those shown in FIG. 11 , and FIG. 11 only illustrates components that are more relevant to the multiple implementations disclosed in the embodiments of the present invention. As an embodiment, device 1100 may also include an output device and an input device. The output device communicates with the aforementioned processing circuit (such as processing module 11001 or processing circuit) and can display information in a variety of ways. For example, the output device can be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device communicates with the processor and can receive user input in a variety of ways. For example, the input device can be a mouse, keyboard, touch screen device, or sensor device. In addition, FIG. 11 does not illustrate a high-performance interconnect bus, which is a bus used for communication between devices and accessed through bus terminal devices, similar in function to a wireless network.
[0240] It is understandable that, in order to realize the above functions, the above-mentioned equipment or devices include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0241] In the embodiment of the present application, the functional modules of the above-mentioned device (such as 1100) or apparatus (such as 1000) can be divided according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0242] An embodiment of the present application also provides a chip system, which is applied to the above-mentioned device. The chip system includes: one or more interface circuits and one or more processors. The interface circuits and the processors are interconnected via a circuit. The interface circuits are configured to receive signals from the device's memory and send the signals to the processors. The signals include computer instructions stored in the memory. When the processor executes the computer instructions, the device executes any method executed by the first node in the above-mentioned method embodiment, or executes any method executed by the second node in the above-mentioned method embodiment.
[0243] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on a device, the device executes any method executed by the first node in the above method embodiment, or executes any method executed by the second node in the above method embodiment.
[0244] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the device to execute any method executed by the first node in the above method embodiment, or execute any method executed by the second node in the above method embodiment.
[0245] Among them, the devices, chip systems, computer storage media or computer program products provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0246] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0247] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0248] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0249] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0250] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0251] The above content is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or replacements within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A node configuration method, characterized in that: Applied to a control node, the control node is connected to multiple nodes, each of the nodes is used to execute part of the operators in the algorithm, the stream computing of the algorithm is implemented through data transmission between the multiple nodes, the multiple nodes include a first node and a second node, and the method includes: Determining first configuration information, where the first configuration information includes first information, where the first information instructs the first node to perform a restart; wherein an operator executed by the first node needs to be expanded or reduced in capacity, or an operator executed by a node adjacent to the first node needs to be expanded or reduced in capacity; When the second node maintains execution of the operator task, the first configuration information is sent to the first node.
2. The method according to claim 1, characterized in that The first configuration information also includes second information, where the second information instructs the first node to obtain historical status data generated when executing an operator from a storage location corresponding to a checkpoint.
3. The method according to claim 1 or 2, characterized in that The operator executed by the second node does not need to be expanded or reduced in capacity; or, Operators executed by adjacent nodes of the second node do not need to be expanded or reduced in capacity.
4. The method according to any one of claims 1 to 3, characterized in that The second node is an adjacent upstream node of the first node, and the first configuration information also includes third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first execution result obtained by the second node executing the operator after the checkpoint.
5. The method according to any one of claims 1 to 3, characterized in that: The first node is the source node of the multiple nodes, and the first configuration information also includes third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first business data to be processed after the checkpoint.
6. The method according to any one of claims 1 to 4, characterized in that: The second node is a source node among the multiple nodes.
7. A system, characterized in that: The method comprises a control node connected to a plurality of nodes, each of which is used to execute a portion of operators in the algorithm, wherein the plurality of nodes implement stream computing of the algorithm through data transmission, and the plurality of nodes include the first node and the second node; wherein, The control node is configured to send first configuration information to the first node, where the first configuration information includes first information, and the first information instructs the first node to perform a restart; wherein an operator executed by the first node needs to be expanded or reduced in capacity, or an operator executed by a node adjacent to the first node needs to be expanded or reduced in capacity; When the first node restarts according to the first configuration information, the second node is used to maintain the execution of the operator task.
8. The system according to claim 7, characterized in that The first node is further configured to, after restart, execute the first operator according to the input first data to obtain second data; transmitting the second data and second indication information to the second node, where the second indication information is used to indicate the service data corresponding to the first data; The second node is further configured to obtain third indication information, where the third indication information indicates service data corresponding to the input data most recently processed by the second node; If it is determined according to the first indication information and the second indication information that the second data has not been executed, a second operator is executed according to the second data.
9. The system according to claim 8, characterized in that The second indication information includes an identification number of the service data corresponding to the first data.
10. The system according to claim 8 or 9, characterized in that The second node is further configured to: The third indication information is modified into fourth indication information, where the fourth indication information indicates the business data corresponding to the second data.
11. The system according to any one of claims 8 to 10, characterized in that: The first indication information further includes third information, where the third information instructs the first node to obtain the first data from the storage space after performing a restart; The first data is the first execution result obtained by the upstream node of the first node executing the operator after the checkpoint; or, the first data is the first business data to be processed after the checkpoint.
12. A node configuration device, characterized in that: The device is located at a control node, the control node is connected to a plurality of nodes, each of the nodes is used to execute a portion of operators in an algorithm, and the stream computing of the algorithm is implemented through data transmission between the plurality of nodes, the plurality of nodes including a first node and a second node, and the device includes: a configuration module, configured to determine first configuration information, the first configuration information including first information, the first information instructing the first node to perform a restart; wherein an operator executed by the first node needs to be expanded or reduced in capacity, or an operator executed by a node adjacent to the first node needs to be expanded or reduced in capacity; A sending module is used to send the configuration information to the first node when the second node maintains the execution of the operator task.
13. The device according to claim 12, characterized in that The first configuration information also includes second information, where the second information instructs the first node to obtain historical status data generated when executing an operator from a storage location corresponding to a checkpoint.
14. The device according to claim 12 or 13, characterized in that The operator executed by the second node does not need to be expanded or reduced in capacity; or, Operators executed by adjacent nodes of the second node do not need to be expanded or reduced in capacity.
15. The device according to any one of claims 12 to 14, characterized in that The second node is an adjacent upstream node of the first node, and the first configuration information also includes third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first execution result obtained by the second node executing the operator after the checkpoint.
16. The device according to any one of claims 12 to 14, characterized in that The first node is the source node of the multiple nodes, and the first configuration information also includes third information; the third information indicates that the first node obtains input data from the storage space after executing the restart, and the input data is the first business data to be processed after the checkpoint.
17. The device according to any one of claims 12 to 15, characterized in that The second node is a source node among the multiple nodes.
18. A chip, characterized in that: The chip includes a processing circuit and an interface circuit, the interface circuit is interconnected with the processing circuit via a line, the interface circuit is used to receive a signal from a storage medium and send the signal to the processor, the signal including a computer instruction stored in the storage medium; when the computer instruction is executed by the processing circuit, the chip executes the node configuration method according to any one of claims 1 to 6.
19. A node configuration device, characterized in that: The device includes: a storage medium and a processing circuit, the storage medium being coupled to the processing circuit, the storage medium being used to store computer program code, the computer program code including computer instructions, and when the computer instructions are executed by the processing circuit, the node configuration method according to any one of claims 1 to 6 is executed.
20. A computer storage medium, characterized in that The method comprises computer instructions, which, when executed on a computer, enable the computer to execute the node configuration method according to any one of claims 1 to 6.
21. A computer program product, characterized in that The invention comprises a computer program for implementing the method according to any one of claims 1 to 6 when the computer program is executed by one or more processors.