Distributed computing scheduling method, device and system
By introducing a serverless FaaS engine into the big data computing system and utilizing its communication with the big data computing engine, the transformation from SQL queries to function call requests and fine-grained processing are realized. This solves the problems of low resource utilization and insufficient computing efficiency in existing technologies, and improves the efficiency and reliability of distributed computing.
Patent Information
- Application Number
- CN202511986658.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-26
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-12-26
AI Technical Summary
Existing mainstream big data computing engines still have shortcomings in task scheduling and execution optimization, especially in how to further improve resource utilization and computing efficiency in master-slave architectures.
The serverless FaaS engine communicates with the big data computing engine, receives SQL query requests, converts them into function call requests, and determines the target partition and physical machine node in multiple scheduling partitions for processing, thereby achieving fine-grained function execution.
It improves resource utilization, avoids resource idleness, enhances the efficiency and reliability of distributed computing scheduling, and optimizes the task scheduling and execution process.
Smart Images

Figure CN121433907A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of big data processing technology, and in particular to a distributed computing scheduling method, apparatus and system. Background Technology
[0002] In the field of big data processing technology, distributed computing engines are one of the core technologies for achieving efficient data processing.
[0003] Currently, mainstream big data computing engines typically adopt a master-slave architecture, such as Apache Spark. In this architecture, the driver, or driver node, is responsible for scheduling and coordinating tasks, while the executors, or execution nodes, are responsible for executing the tasks.
[0004] The industry's main optimization efforts have focused on the big data computing engine itself, such as improving performance through task partitioning, memory management, or parallel computing strategies. However, how to further optimize task scheduling and / or execution remains a key concern for the industry.
[0005] It should be noted that the above-mentioned related technologies are only information known to the inventor personally, and do not mean that the above information had entered the public domain before the application date of this specification, nor do they mean that it can be considered prior art in this specification. Summary of the Invention
[0006] This specification provides a distributed computing scheduling method, apparatus, and system to solve at least one of the above-mentioned technical problems.
[0007] Firstly, this specification provides a distributed computing scheduling method. The method is applied to a serverless computing model (FaaS) engine in a distributed computing scheduling system. The system further includes a big data computing engine communicatively connected to the FaaS engine. The FaaS engine controls multiple scheduling partitions, each of which includes at least one physical machine node. The method includes: Receive a function call request sent by the big data computing engine, wherein the function call request is used to request the target function corresponding to the structured query language SQL query to be processed; From the plurality of scheduling partitions, a target partition for processing the function call request is determined; and Control the physical machine nodes in the target partition to execute the function call request, obtain and output the function call result corresponding to the function call request, wherein the function call result is used to determine the query result corresponding to the SQL query.
[0008] Secondly, this specification provides a distributed computing scheduling device, which is a serverless computing model FaaS engine in a distributed computing scheduling system. The system also includes a big data computing engine communicatively connected to the FaaS engine. The FaaS engine includes multiple scheduling partitions, and each scheduling partition includes at least one physical machine node. The device includes: At least one storage medium stores at least one instruction set for distributed computing scheduling; At least one processor is communicatively connected to the at least one storage medium, wherein when the at least one processor is running, it reads the at least one instruction set and executes the method as described in the first aspect according to the instructions of the at least one instruction set.
[0009] Thirdly, this specification provides a distributed computing scheduling system, the system including a serverless computing model FaaS engine and a big data computing engine communicatively connected to the FaaS engine; the FaaS engine controls multiple scheduling partitions, each scheduling partition including at least one physical machine node, wherein... The big data computing engine is used to obtain a structured query language (SQL) query, determine and send a function call request corresponding to the SQL query to the FaaS engine, wherein the function call request is used to request the target function corresponding to the SQL query to be processed; The FaaS engine is used to execute the method described in the first aspect according to the function call request, and to obtain and feed back the function call result corresponding to the function call request to the big data computing engine. The big data computing engine is also used to determine the query result corresponding to the SQL query based on the function call result.
[0010] Fourthly, this specification provides a computer-readable non-transitory storage medium, wherein the computer-readable non-transitory storage medium stores at least one instruction set, which is executed by at least one processor to implement the method as described in the first aspect.
[0011] As can be seen from the above technical solutions, the distributed computing scheduling method, device, and system provided in this specification allow the FaaS engine to communicate with the big data computing engine to receive function call requests corresponding to SQL queries initiated by the big data computing engine, and execute the function call requests based on the target partition. This can convert coarse-grained SQL queries into fine-grained function processing, thereby improving resource utilization and avoiding resource idleness. Furthermore, it can improve the efficiency of distributed computing scheduling.
[0012] Other functions of the distributed computing scheduling methods, apparatuses, and systems provided in this specification will be partially listed in the following description. The inventive aspects of the distributed computing scheduling methods, apparatuses, and systems provided in this specification can be fully understood through practice or use of the methods, apparatuses, and combinations described in the detailed examples below. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a schematic diagram illustrating an application scenario of the distributed computing scheduling method provided in the embodiments of this specification; Figure 2 This is a schematic diagram of the computer structure provided in the embodiments of this specification; Figure 3 A flowchart illustrating the distributed computing scheduling method provided in the embodiments of this specification; Figure 4 This is a schematic diagram of the framework of the distributed computing scheduling system provided in the embodiments of this specification; Figure 5 This is a schematic diagram illustrating the process of scheduling function call requests to the corresponding physical machine nodes, provided for embodiments of this specification. Figure 6 A flowchart illustrating the execution function call request provided in the embodiments of this specification; Figure 7 This is a schematic diagram of the preheating stage provided for an embodiment of this specification. Detailed Implementation
[0015] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification as detailed in the appended claims.
[0016] It should be understood that the terms “comprising” and “having”, and any variations thereof, in the embodiments of this specification are intended to cover but not exclude inclusion. For example, a product or device that includes a series of components is not necessarily limited to those components that are explicitly listed, but may include other components that are not explicitly listed or that are inherent to such product or device.
[0017] The term "and / or" in the embodiments of this specification describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0018] In the embodiments of this specification, the term "multiple" refers to two or more, and other quantifiers are similar.
[0019] The terms “first,” “second,” “third,” etc., used in this specification are used to distinguish similar or related objects or entities and do not necessarily imply a specific order or sequence, unless otherwise indicated. It should be understood that such terms can be used interchangeably where appropriate, for example, in situations where implementation can proceed in an order other than those given in the embodiments illustrated or described in this specification.
[0020] As used in this specification, the term "unit / module" means any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code capable of performing the functions associated with that element.
[0021] To facilitate readers' understanding of this manual, the application scenarios of this manual are introduced below.
[0022] The technical solutions provided in this specification are applicable to scenarios requiring distributed computing scheduling. For example, the technical solutions provided in this specification can be applied to big data processing scenarios (including computation and analysis). For instance, the technical solutions provided in this specification can be used to determine a scenario where an e-commerce platform processes one month's sales data.
[0023] Figure 1 This is a schematic diagram illustrating an application scenario of the distributed computing scheduling method described in this specification. The distributed computing scheduling method described in this specification can be applied to, for example... Figure 1 Scenario 100 is shown. (e.g.) Figure 1 As shown, scenario 100 may include user 101 and distributed computing scheduling system 102. Distributed computing scheduling system 102 includes a serverless architecture computing model (Function as a Service, FaaS) engine 1021 and a big data computing engine 1022 with communication connections.
[0024] Among them, the FaaS engine 1021 allows developers to decompose the functionality of their applications into corresponding small, independent functions. These functions can run on FaaS without managing the underlying servers or infrastructure. Users only need to focus on the logic of the code, without having to worry about server configuration and management. It also features rapid startup, on-demand use, excellent elasticity, and maintenance-free operation.
[0025] A Function defines an executable (user) function, including the corresponding user code, runtime information, resource configuration, etc., and is the smallest unit of user code execution.
[0026] Big data engines include, but are not limited to, the Spark engine.
[0027] In such Figure 1 In the scenario shown, user 101 can send a Structured Query Language (SQL) query to the big data engine 1022.
[0028] After receiving the SQL query sent by user 101, the big data engine 1022 can first parse the SQL query to determine the corresponding function call request. For example, the big data engine 1022 can parse the SQL query into function-level subtasks, and a subtask can be understood as a function call request. Then, the big data engine 1022 sends the function call request to the FaaS engine 1021.
[0029] Correspondingly, the FaaS engine 1021 receives the function call request sent by the big data engine 1022. The FaaS engine 1021 executes the distributed computing scheduling method provided in this specification to obtain and send the function call result corresponding to the function call request to the big data engine 1022.
[0030] Correspondingly, the big data engine 1022 receives the function call result sent by the FaaS engine 1021, and determines the query result corresponding to the SQL query based on the function call result. Then, the big data engine 1022 outputs the query result to user 101.
[0031] Correspondingly, user 101 receives the query results fed back by big data engine 1022.
[0032] It should be understood that the above examples are only for illustrative purposes to show the possible application scenarios for the distributed computing scheduling methods provided in this specification, and should not be construed as limiting the application scenarios.
[0033] Figure 2A hardware structure diagram of a computer 200 according to an embodiment of this specification is shown. The computer 200 can be a computer deployed with a FaaS engine (it can be a standalone computer or a computer cluster), and the FaaS engine can execute the distributed computing scheduling method described in this specification. The distributed computing scheduling method is described in other parts of this specification.
[0034] like Figure 2 As shown, computer 200 may include at least one storage medium 203 and at least one processor 202. In some embodiments, computer 200 may also include a communication port 204 and an internal communication bus 201. Computer 200 may also include I / O components 205.
[0035] The internal communication bus 201 can connect to different system components. For example, the internal communication bus 201 can connect to storage medium 203, processor 202, communication port 204, and I / O component 205.
[0036] I / O component 205 supports input / output between computer 200 and other components.
[0037] Communication port 204 is used for data communication between computer 200 and the outside world. For example, communication port 204 can be used for data communication between computer 200 and a network. Communication port 204 can be a wired communication port or a wireless communication port.
[0038] Storage medium 203 may include a data storage device. The data storage device may be a non-transitory storage medium or a temporary storage medium. For example, the data storage device may include one or more of a disk 2031, a read-only storage medium (ROM) 2032, or a random access storage medium (RAM) 2033. Storage medium 203 also includes at least one instruction set stored in the data storage device. The instruction set includes computer program code, which may include programs, routines, objects, components, data structures, procedures, modules, etc., that execute the query methods provided in this specification.
[0039] At least one processor 202 may be communicatively connected to at least one storage medium 203. At least one processor 202 is used to execute at least one instruction set described above. When the computer 200 is running, at least one processor 202 reads the at least one instruction set and, according to the instructions of the at least one instruction set, executes the distributed computing scheduling method provided in this specification. Processor 202 may execute all steps included in the distributed computing scheduling method. Processor 202 may be in the form of one or more processors. In some embodiments, processor 202 may include one or more hardware processors, such as microcontrollers, microprocessors, reduced instruction set computers (RISC), application-specific integrated circuits (ASICs), application-specific instruction set processors (ASIPs), central processing units (CPUs), graphics processing units (GPUs), physical processing units (PPUs), microcontroller units, digital signal processors (DSPs), field-programmable gate arrays (FPGAs), advanced RISC machines (ARMs), programmable logic devices (PLDs), any circuit or processor capable of performing one or more functions, or any combination thereof.
[0040] For illustrative purposes only, only one processor 202 is shown in the accompanying drawings of computer 200. However, it should be noted that computer 200 may also include multiple processors in this specification. Therefore, the operation and / or method steps disclosed in this specification may be executed by one processor or by multiple processors in combination. For example, if the processor 202 of computer 200 is described in this specification as executing steps A and B, it should be understood that steps A and B may also be executed jointly or separately by two different processors 202 (e.g., the first processor executes step A, the second processor executes step B, or the first and second processors jointly execute steps A and B).
[0041] Alternatively, computer 200 can also be a computer deployed with a big data computing engine. For a description of computers deployed with big data computing engines, please refer to [link to relevant documentation]. Figure 2 As with the examples above, we will not repeat them here.
[0042] Please see Figure 3 , Figure 3 This is a flowchart illustrating the distributed computing scheduling method provided in the embodiments of this specification.
[0043] Based on the above description, it can be concluded that Figure 3 The method shown can be applied to the FaaS engine in a distributed computing scheduling system, which also includes a big data computing engine that communicates with the FaaS engine. The FaaS engine controls multiple scheduling partitions, and each scheduling partition includes at least one physical machine node.
[0044] For example, a distributed computing scheduling system may include multiple physical machine nodes. The FaaS engine may divide the multiple physical machine nodes into multiple scheduling partitions, and a scheduling partition may include one or more (usually multiple) physical machine nodes.
[0045] In some embodiments, the multiple scheduling partitions are obtained by the FaaS engine proportionally dividing each physical machine node. For example, if there are 30 physical machine nodes, the FaaS engine can proportionally divide these 30 physical machine nodes into 3 scheduling partitions, with each scheduling partition containing 10 physical machine nodes.
[0046] like Figure 3 As shown, the method includes the following steps S301 to S303: S301: Receives a function call request sent by the big data computing engine, wherein the function call request is used to request the target function corresponding to the SQL query to be processed.
[0047] For example, in combination Figure 1 The scenario shown and the target Figure 1 As described, the big data computing engine can receive SQL queries, and these SQL queries can be initiated by user 101. Relatively speaking, the big data computing engine focuses more on parsing the user's SQL query and transforming it into a function call request suitable for the FaaS engine to process.
[0048] For example, big data computing engines analyze SQL queries to break them down into function-level requests, thereby obtaining function call requests at the function granularity.
[0049] Specifically, in combination Figure 4 It can be seen that if the big data computing engine is the Spark engine, the driver in the Spark engine can analyze the SQL query and send function call requests to the FaaS engine.
[0050] S302: Determine the target partition for processing function call requests from the plurality of scheduling partitions.
[0051] For example, the FaaS engine can select the most suitable scheduling partition (i.e., the target partition) from the multiple scheduling partitions to handle the function call request.
[0052] For example, combining Figure 4 As can be seen, a FaaS engine may include a function scheduling module. After receiving a function call request, the function scheduling module can determine the target partition according to certain strategies and route the function call request to the target partition. These strategies may include, but are not limited to, hash strategies, load balancing strategies, resource strategies, and historical performance strategies.
[0053] Specifically, determining the target partition based on the load balancing strategy can be understood as the FaaS engine determining the target partition based on the load conditions of each scheduling partition (such as CPU utilization, memory usage, etc.) to ensure a relatively even load distribution across the partitions. Determining the target partition based on the historical performance strategy can be understood as the FaaS engine selecting the scheduling partition with the best historical performance (such as response time, throughput, etc.) from among the multiple scheduling partitions as the target partition.
[0054] For example, combining the above examples and Figure 5 As can be seen, the FaaS engine can first partition each physical machine node to divide different physical machine nodes into different partitions, thereby obtaining the multiple scheduling partitions.
[0055] Then, the FaaS engine obtains the resource information corresponding to each scheduling partition, such as the total amount of resources, the amount of resources allocated, and the resource allocation rate.
[0056] Next, the FaaS engine may receive function call requests initiated by the big data computing engine. The FaaS engine routes the function call requests to the target partition based on the strategy described above.
[0057] S303: Controls the physical machine nodes in the target partition to execute function call requests, obtains and outputs the function call results corresponding to the function call requests, whereby the function call results are used to determine the query results corresponding to the SQL query.
[0058] Based on the above example, after determining the target partition for handling function call requests, the FaaS engine can route the function call requests to physical machine nodes within the target partition.
[0059] Correspondingly, when a physical machine node in the target partition receives a function call request, it executes the function call request to obtain and feed back the function call result to the FaaS engine.
[0060] Combining the above examples and Figure 1 The FaaS engine can send function call results to the Spark engine. Correspondingly, the Spark engine determines and returns query results to the user based on the function call results.
[0061] Based on the analysis of S301 to S303 above, it can be seen that in this embodiment, the FaaS engine communicates with the big data computing engine to receive function call requests corresponding to SQL queries initiated by the big data computing engine, and executes the function call requests based on the target partition. This can convert coarse-grained SQL queries into fine-grained function processing, thereby improving resource utilization and avoiding resource idleness. Furthermore, it can improve the efficiency of distributed computing scheduling.
[0062] It's worth noting that a single SQL query can represent a task that calls multiple different functions. Correspondingly, there can be multiple function call requests, each indicating a different target function to be called.
[0063] In other words, in some embodiments, the number of function call requests is multiple. Accordingly, S303 may include the following steps 11 to 13: Step 11: Combine the function call requests into at least one batch.
[0064] For example, given multiple received function call requests, the FaaS engine can merge these requests into one or more batches. Each batch typically includes at least one function call request, and usually more.
[0065] It is worth noting that different function call requests may have different priorities and / or resource granularities. Resource granularity can be understood as the granularity of resource consumption corresponding to the target function call.
[0066] Taking priority as an example, different function call requests are used to indicate the invocation of different target functions, and different target functions have different call priorities. Priorities can be determined by the FaaS engine based on requirements, historical records, experiments, etc., and this embodiment does not limit this.
[0067] Therefore, combining the above examples and Figure 5 It is understood that the FaaS engine can merge function call requests based on priority and / or resource granularity. That is, when there are multiple function call requests, the FaaS engine can merge them to obtain at least one batch based on priority and / or resource granularity.
[0068] For example, a FaaS engine can merge function call requests with the same priority and / or resource granularity into a single batch. Alternatively, a FaaS engine can merge function call requests with the same priority and / or resource granularity into a single batch.
[0069] Step 12: Determine the target physical machine node from the physical machine nodes of the target partition for executing the at least one batch.
[0070] As can be seen from the above example, the target partition may include multiple physical machine nodes. After merging to obtain the at least one batch, the FaaS engine can select a suitable physical machine node (i.e., the target physical machine node) from the multiple physical machine nodes of the target partition to execute the at least one batch.
[0071] Continuing with the examples above and Figure 4 The FaaS engine can include a function scheduling module. The function scheduling module is used to execute functions such as... Figure 5 The scheduling logic of the function scheduling phase is shown. For example, the function scheduling module is used to obtain the multiple scheduling partitions, and after determining the target partition from the scheduling partitions, to determine the... Figure 4 The target physical machine node is shown.
[0072] In some embodiments, step 12 may include the following steps 121 and 122: Step 121: Obtain the remaining resource slots corresponding to each physical machine node in the target partition, as well as the occupied slots of the at least one batch.
[0073] Remaining resource slots can be understood as resources that can still be utilized. Within the target partition, different physical machine nodes may have different remaining resource slots. That is, different physical machine nodes may have different amounts of usable resources. Therefore, the FaaS engine can obtain the remaining resource slots corresponding to each physical machine node within the target partition.
[0074] A reserved slot can be understood as the resource required to execute the at least one batch. To ensure that the at least one batch can be executed effectively and reliably, the FaaS engine can acquire the corresponding reserved slots.
[0075] Step 122: Identify the physical machine nodes in the target partition whose remaining resource slots are greater than the occupied slots as the target physical machine nodes.
[0076] For example, the FaaS engine can compare the remaining resource slots of the physical machine nodes of the target partition with the slots required to execute the at least one batch (i.e., occupied slots) to select physical machine nodes from the physical nodes of the target partition whose remaining slot resources are greater than or equal to the occupied slots. This physical machine node is the target physical machine node used to execute the at least one batch.
[0077] For example, continuing to combine the above examples and Figure 5The FaaS engine can iterate through the physical machine nodes of the target partition to calculate the remaining resource slots of the physical machine nodes of the target partition until the target physical machine node with remaining resource slots is greater than or equal to the occupied slots.
[0078] Based on the above analysis of steps 121 and 122, it can be seen that in this embodiment, the FaaS engine selects physical machine nodes with remaining resource slots greater than or equal to the occupied slots from each physical machine node of the target partition as target physical machine nodes, and executes the at least one batch based on the target physical machine nodes. This ensures that the at least one batch is executed smoothly, thereby improving the effectiveness and reliability of distributed computing scheduling.
[0079] Step 13: Control the target physical machine node to execute at least one batch, obtain and output the function call results.
[0080] Accordingly, after determining the target physical machine node for processing the at least one batch, the FaaS engine can schedule the at least one batch to the target physical machine node. This allows the target physical machine node to execute the at least one batch, that is, to execute the target functions within the at least one batch, thereby obtaining the function call results corresponding to the function call requests.
[0081] Continuing with the examples above and Figure 5 The FaaS engine can dequeue the at least one batch from high to low priority and / or resource granularity to schedule each function call request in the batch to a target physical machine node with available resources in the dequeue order.
[0082] Accordingly, the target physical machine node executes each function call request in the dequeue order to finally obtain the function call result corresponding to the function call request.
[0083] Based on the above analysis of steps 11 to 13, it can be seen that in this embodiment, when there are multiple function call requests, the FaaS engine can merge the function call requests in batches to improve scheduling throughput and thus improve the efficiency of distributed computing calls.
[0084] In some embodiments, the FaaS engine can determine whether each function call request in the at least one batch has been scheduled, such as by routing it to the corresponding physical machine node. For function call requests that have not been scheduled, the FaaS engine can route them to the corresponding physical machine node in another scheduling partition.
[0085] In other words, to ensure that all function call requests are successfully scheduled so that each function call request has a corresponding physical machine node for execution, the FaaS engine can detect the scheduling status of at least one batch in order to continue allocating other scheduling partitions to schedule any unallocated function call requests.
[0086] For example, if there are unscheduled function call requests in at least one batch, the FaaS engine can determine and route the unscheduled function call requests to the next scheduling partition based on the principle described in the above example, until a function call request that has not been scheduled is routed to the corresponding scheduling partition, or all scheduling partitions are traversed.
[0087] Specifically, let's continue to combine the above examples and... Figure 5 The FaaS engine can determine whether all function call requests in the at least one batch have been successfully scheduled, i.e., routed to the corresponding physical machine node. If not, i.e., there are function call requests that failed to be scheduled, the FaaS engine will route the failed function call requests to other scheduling partitions until all scheduling partitions have been traversed.
[0088] For example, if the FaaS engine fails to find a physical machine node with enough remaining resource slots to fill all function call requests in a given batch, it will continue to determine the next call partition to execute that batch. Correspondingly, the FaaS engine can still determine if there are any physical machine nodes with enough remaining resource slots in the next scheduling partition. If so, the FaaS engine will schedule the batch to that physical machine node. If not, the FaaS engine will continue searching for a physical machine node with enough remaining resource slots in the next scheduling partition. This process continues until the FaaS engine finds a scheduling partition containing a physical machine node with enough remaining resource slots and schedules the batch to that physical machine node; or, until the FaaS engine has traversed all scheduling partitions.
[0089] In some embodiments, S303 may include the following steps 21 and 22: Step 21: Obtain the target cache instance corresponding to the function call request, as well as the input data. The target cache instance is a physical machine node in the target partition, obtained by preheating the target software package of the target function. A cache instance can also be called a function instance. Therefore, the target cache instance can also be called the target function instance.
[0090] For example, each physical machine node in each scheduling partition can preheat the software package of the function that may need to be scheduled (such as the target software package of the target function).
[0091] For example, combining the above examples and Figure 4 The target physical machine node can store software packages (such as the target software package) and generate corresponding function instances (i.e. cache instances) based on the target software package.
[0092] Correspondingly, upon receiving a function call request scheduled by the FaaS engine, the FaaS engine can control the target physical machine node to obtain the target cache instance corresponding to the function call request and which has been preheated.
[0093] For example, such as Figure 4 As shown, the FaaS engine can also include a function instance management module. The function instance management module can control the creation and activation of cache instances on the target physical machine, such as... Figure 4 The cache instances shown are Cache Instance 1, Cache Instance 2, up to Cache Instance N (N is an integer greater than or equal to 1). Among the N cache instances, the target cache instance is included.
[0094] Additionally, the FaaS engine can control the target physical machine node to pull the payload (such as input data) corresponding to the function call request. In FaaS, the payload refers to the data or message passed in when the function is executed. This data can be the event that triggers the function, request parameters, or any other information that needs to be processed.
[0095] In some embodiments, the physical machine nodes in the target partition include a target cache pool for storing cache instances built based on preheated software packages.
[0096] Continuing with the examples above and Figure 4 The FaaS engine can also include a caching module. This caching module can control the preheating of software packages on physical machine nodes and create cache instances for storing packages generated based on this preheating. For example... Figure 4 As shown, the caching module can control the target physical machine to preheat software packages, thereby caching the packages locally on the target physical machine. Furthermore, the caching module can control the target physical machine to create a cache pool to store cache instances.
[0097] The cache pool can be a cache container or a virtual machine (VM).
[0098] Accordingly, based on this, step 21, "obtaining the target cache instance corresponding to the function call request," may include the following sub-steps 11 to 13: Sub-step 11: Perform a lookup in the target cache pool to determine if the target cache instance is included in the target cache pool.
[0099] For example, a cache pool can be pre-created in each physical machine node within each scheduling partition. For instance, the target physical machine node may include a target cache pool.
[0100] As illustrated in the examples above, each physical machine node can pre-warm the software packages containing functions that may require scheduling to obtain corresponding cache instances. Therefore, the cache pool can store pre-obtained cache instances. For example, the target cache pool may store target cache instances.
[0101] Correspondingly, the FaaS engine can control the target physical machine node to search in the target cache pool to determine whether the target cache instance is already stored in the target cache pool.
[0102] For example, combining the above examples and Figure 6 When the target physical machine node receives a function call request, it can obtain the target function's metadata based on the function call request. This includes the target function itself, as well as the name, version, and code package of the runtime environment required by the target function (its code).
[0103] Continue to combine Figure 6 The target physical machine node can determine whether there is a target cache instance in the target cache pool that corresponds to the runtime environment.
[0104] The search results may fall into two categories: 1) The target cache instance is already stored in the target cache pool; 2) The target cache instance is not found in the target cache pool.
[0105] For scenario 1, the FaaS engine can control the target physical machine node to execute the following sub-step 12. For scenario 2, the FaaS engine can control the target physical machine node to execute the following sub-step 13.
[0106] Sub-step 12: If the search result indicates that the target cache pool contains the target cache instance, then obtain the target cache instance from the target cache.
[0107] Continuing with the examples above and Figure 6 If the target cache pool contains a target cache instance, the target physical machine node can directly obtain the target cache instance from the target cache pool.
[0108] Sub-step 13: If the search result indicates that the target cache instance is not included in the target cache pool, then control the physical machine nodes in the target partition to create the target cache instance.
[0109] Continuing with the examples above and Figure 6If there is no target cache instance in the target cache pool, the target physical machine node can create a target cache instance based on the preheated target package.
[0110] Based on the above analysis of sub-steps 11 to 13, it can be seen that in this embodiment, if a target cache instance exists in the target cache pool, the target cache instance can be obtained directly; if no target cache instance exists in the target cache pool, a target cache instance can be created. This improves the effectiveness and reliability of obtaining the target cache instance.
[0111] Based on the above analysis and Figure 4 As can be seen, the distributed computing scheduling method provided in this specification may also include a warm-up phase to store the corresponding software packages and to create a corresponding virtualized cache pool to store cache instances based on the virtualized cache pool. For example, in some embodiments, the warm-up phase may include the following steps 31 and 32: Step 31: Receive a creation request sent by the big data computing engine. The creation request is used to request the FaaS engine to create function-related information, including the target function, the function runtime environment, and the function metadata information.
[0112] For example, in conjunction with the above examples, Figure 4 , Figure 7 Big data computing engines (such as drivers in the Spark engine) can send a creation request to the FaaS engine so that the FaaS engine can create the function runtime environment, target function, and function metadata (such as package type, address, etc.).
[0113] Step 32: Based on the function-related information, control each physical machine node in each scheduling partition to download and store the target software package of the target function in order to warm up the target software package.
[0114] For example, the FaaS engine can provide each physical node with function-related information for downloading software packages (such as addresses in function metadata), so that each physical node can download and store the corresponding software packages based on the addresses, thereby enabling each physical node to preheat the software packages.
[0115] For example, combining the above examples, Figure 4 , Figure 7 The FaaS engine can control each physical machine node to preheat the software package separately.
[0116] Specifically, such as Figure 7As shown, the FaaS engine can create function-related information such as the function runtime environment, target function, and function metadata. The FaaS engine can extract the download address of the software package (such as the target package) from this function-related information. The FaaS engine can also issue software package warm-up commands to each physical machine node.
[0117] Correspondingly, when a physical machine node receives a package preheating instruction, it can pull the package based on the download address, thereby preheating the package.
[0118] For example, after a physical machine node receives a software package preheating instruction, it can concurrently download all software packages to be preheated through a peer-to-peer (P2P) mechanism.
[0119] Based on the above analysis of steps 31 and 32, it can be seen that in this embodiment, the FaaS engine controls each physical machine node in each scheduling partition to download and store the target software package of the target function through function-related information, which can improve the comprehensiveness and reliability of software package preheating.
[0120] In some embodiments, the warm-up phase may further include warming up the cache pool. For example, the warm-up phase may further include step 33: creating and storing a target cache instance in the target cache pool based on the target package that has been warmed up.
[0121] For example, continuing to combine the above examples and Figure 4 The FaaS engine can also control each physical machine node to create a runtime environment virtualization cache pool (i.e., a cache pool) to preheat the cache pool.
[0122] In this embodiment, by creating a corresponding cache pool, the efficiency of distributed computing scheduling can be further improved.
[0123] In some embodiments, step 33 above may include the following steps 331 and 332: Step 331: Obtain the free slots in the target cache pool.
[0124] It's understandable that the cache pool has a certain capacity to store cache instances of a certain size. Correspondingly, free slots can be understood as the amount of cache instances the cache pool can still store.
[0125] The capacity of the cache pool can be set based on the specifications of the physical machine nodes, and this embodiment does not impose any limitations.
[0126] Step 332: Create and store the target cache instance in the target cache pool based on the available slots.
[0127] Once the Spark engine obtains available slots in the target cache pool, i.e., knows how many target cache instances the target cache pool can still store, it can control the physical machine nodes to generate target cache instances based on the preheated target packages and store the target cache instances in the target cache pool.
[0128] For example, combining the above examples and Figure 7 The Spark engine can determine whether the cache pool is full, that is, whether the cache pool can still store the corresponding cache instances. If the cache pool is full, meaning it can no longer store cache instances, then no more cache instances will be stored in the cache pool. Conversely, if the cache pool is not full, the Spark engine can control the physical machine nodes to generate cache instances based on the pre-warmed packages and the remaining slots (i.e., free slots) in the cache pool, and store the cache instances in the not-full cache pool to replenish the cache pool.
[0129] In some embodiments, the Spark engine can replenish each cache pool proportionally and can dynamically replenish the cache pool using a Least Recently Used (LRU) strategy.
[0130] For example, when a new container cache instance is needed but the cache pool is full, the Spark engine can remove the cache instance that has not been used for the longest time according to the LRU policy to make room for the cache instance corresponding to the SQL query.
[0131] Based on the above analysis of steps 331 and 332, it can be seen that in this embodiment, the Spark engine supplements the cache instances in the cache pool by combining the free slots in the cache pool, thereby achieving effective management and dynamic adjustment of resources.
[0132] Step 22: Determine and output the function call result based on the target cache instance and the input data.
[0133] For example, the FaaS engine can control the target physical machine node to start executing computational logic based on the target cache instance and input data, so as to finally obtain and output the function call result.
[0134] For example, continuing to combine the above examples and Figure 6 The FaaS engine can control the target physical machine node to inject the function code of the target function into the target cache instance to activate the target function instance, thereby pulling the payload and executing the corresponding computation logic.
[0135] Continue reading Figure 6 It is known that in some embodiments, the FaaS engine can synchronize the execution status of the computational logic to the big data computing engine (such as the driver in the Spark engine).
[0136] Based on the above analysis of steps 21 and 22, it can be seen that in this embodiment, the FaaS engine can preheat the software package (such as the target software package) and obtain a cache instance. Upon receiving a function call request, it can then obtain the corresponding cache instance (such as the target cache instance) and complete the function call request based on the cache instance. This can accelerate function startup and reduce the overhead caused by cold starts.
[0137] In some embodiments, the distributed computing scheduling method provided in this specification may further include: deleting cache instances that meet preset cleanup conditions. The cache instances meeting the preset cleanup conditions include: cache instances that are no longer in use and / or cache instances whose idle time has reached a preset time threshold.
[0138] For example, the FaaS engine can control each physical machine node to periodically or irregularly clean up cache instances that have reached preset cleanup conditions. Figure 4 As shown, the function instance management module in the FaaS engine can also delete cache instances.
[0139] For example, the FaaS engine can manage the lifecycle of cache instances. For a cache instance, if the cache instance has exited, the instance is deleted; or, if the cache instance is idle and its idle time has exceeded a preset maximum idle time (such as a preset time threshold), the instance is deleted.
[0140] For example, continuing to combine the above examples and Figure 6 The target physical machine node can periodically or regularly traverse all cache instances and delete all exited cache instances (such as cache instances that are no longer in use), or delete cache instances whose idle time has reached a preset time threshold.
[0141] The preset time threshold can be determined by the FaaS engine based on demand, historical records, experiments, etc., and this embodiment does not limit it.
[0142] In this embodiment, the FaaS engine can effectively release resources occupied by cache instances that have met preset cleanup conditions by cleaning up mixed-data instances, thereby improving resource utilization.
[0143] It is worth noting that the above examples are merely illustrative of possible implementations of the distributed computing scheduling method of this specification, and should not be construed as limiting the implementation of the distributed computing scheduling method of this specification. For example, based on the above technical concept, some of the technical features described above can be combined to obtain new embodiments; new technical features can be added to the above examples to obtain new embodiments; some technical features can be removed from the above examples to obtain new embodiments; some technical features in the above examples can be replaced with other technical features; some technical features and their order in the above examples can be adjusted to obtain new embodiments, and so on, which will not be listed here.
[0144] In addition, this specification also provides a distributed computing scheduling device, which can be used as follows: Figure 2 The computer shown is a FaaS engine in a distributed computing scheduling system. The system also includes a big data computing engine that communicates with the FaaS engine. The FaaS engine includes multiple scheduling partitions, and each scheduling partition includes at least one physical machine node. The device includes: At least one storage medium stores at least one instruction set for distributed computing scheduling; At least one processor is communicatively connected to the at least one storage medium, wherein when the at least one processor is running, it reads the at least one instruction set and executes the distributed computing scheduling method as described in any of the above embodiments according to the instructions of the at least one instruction set.
[0145] In addition, this specification also provides a distributed computing scheduling system, including a FaaS engine and a big data computing engine. Combined with... Figure 7 It is understood that a big data computing engine may include a driver, so that it can receive SQL queries based on the driver and send creation requests and function call requests corresponding to the SQL queries to the FaaS engine.
[0146] For example, the driver parses SQL queries to obtain the corresponding function call requests.
[0147] Accordingly, the FaaS engine executes the distributed scheduling method described in the example above, obtains and sends the function call result corresponding to the function call request to the big data computing engine (specifically, the driver).
[0148] Correspondingly, the big data computing engine receives the function call results sent by the FaaS engine. Based on these results, the big data computing engine can determine and output the query results corresponding to the SQL query.
[0149] In addition, this specification also provides a computer-readable non-transitory storage medium storing at least one instruction set, which, when executed by a processor, implements the steps of the distributed computing scheduling method described in this specification.
[0150] In some possible implementations, various aspects of this specification can also be implemented as a program product comprising program code. When the program product is run on computer 200, the program code causes computer 200 to perform the steps of the distributed computing scheduling method described in this specification. The program product for implementing the above method may employ a portable compact disk read-only memory (CD-ROM) containing program code and may run on computer 200. However, the program product of this specification is not limited thereto. In this specification, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system. The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. The computer-readable storage medium may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof. Program code for performing the operations described herein can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on computer 200, partially on computer 200, as a standalone software package, partially on computer 200 and partially on a remote query system, or entirely on a remote computer 200.
[0151] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0152] In summary, after reading this detailed disclosure, those skilled in the art will understand that the foregoing detailed disclosure is presented by way of example only and is not restrictive. Although not explicitly stated herein, those skilled in the art will understand that this specification requires various reasonable changes, improvements, and modifications to the embodiments. These changes, improvements, and modifications are intended to be made by this specification and are within the spirit and scope of the exemplary embodiments described herein.
[0153] Furthermore, certain terms in this specification have been used to describe embodiments of this specification. For example, "an embodiment," "an embodiment," and / or "some embodiments" mean that a particular feature, structure, or characteristic described in connection with that embodiment may be included in at least one embodiment of this specification. Therefore, it is to be emphasized and understood that two or more references to "an embodiment" or "an embodiment" or "alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. Moreover, specific features, structures, or characteristics may be suitably combined in one or more embodiments of this specification.
[0154] It should be understood that in the foregoing description of the embodiments in this specification, various features are combined in a single embodiment, drawing, or description for the purpose of simplifying the description and to aid in understanding a feature. However, this does not mean that the combination of these features is necessary, and those skilled in the art, upon reading this specification, may readily identify some of the devices as separate embodiments. That is, the embodiments in this specification can also be understood as an integration of multiple secondary embodiments. And the content of each secondary embodiment is valid even if it contains fewer than all the features of a single foregoing disclosed embodiment.
[0155] Every patent, patent application, publication of a patent application, and other material cited herein, such as articles, books, specifications, publications, documents, and literature (excluding any related historical examination documents), is referenced for all purposes relevant to this document, including in the specification and claims herein. However, in the event of any inconsistency or conflict between the descriptions, definitions, and / or terms used in the foregoing and those used herein, the descriptions, definitions, and / or terms used herein shall prevail.
[0156] Finally, it should be understood that the embodiments disclosed herein are illustrative of the principles of the embodiments described in this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are merely examples and not limitations. Those skilled in the art can implement the applications described in this specification using alternative configurations based on the embodiments in this specification. Therefore, the embodiments in this specification are not limited to the embodiments precisely described in the applications.
Claims
1. A distributed computing scheduling method, the method being applied to a function as a service (FaaS) engine of a serverless computing model in a distributed computing scheduling system, the system further comprising a big data computing engine communicatively connected to the FaaS engine, the FaaS engine controlling a plurality of scheduling partitions, one scheduling partition comprising at least one physical machine node, the method comprising: receiving a function invocation request sent by the big data computing engine, wherein the function invocation request is used to request processing of a target function corresponding to a structured query language (SQL) query; determining, from the plurality of scheduling partitions, a target partition for processing the function invocation request; and controlling a physical machine node in the target partition to execute the function invocation request to obtain and output a function invocation result corresponding to the function invocation request, wherein the function invocation result is used to determine a query result corresponding to the SQL query. The number of function invocation requests is a plurality; the controlling the physical machine node in the target partition to execute the function invocation request to obtain and output the function invocation result corresponding to the function invocation request comprises: merging each function invocation request into at least one batch; determining, from the physical machine nodes of the target partition, a target physical machine node for executing the at least one batch; and controlling the target physical machine node to execute the at least one batch to obtain and output the function invocation result. The determining, from the physical machine nodes of the target partition, the target physical machine node for executing the at least one batch comprises: obtaining respective remaining resource slots of each physical machine node in the target partition and occupied slots of the at least one batch; and determining, as the target physical machine node, a physical machine node of the target partition whose remaining resource slot is greater than the occupied slot. The controlling the physical machine node in the target partition to execute the function invocation request to obtain and output the function invocation result corresponding to the function invocation request comprises: obtaining a target cache instance corresponding to the function invocation request and input data, wherein the target cache instance is obtained by pre-warming a target software package of the target function by a physical machine node in the target partition; and determining and outputting the function invocation result according to the target cache instance and the input data. The physical machine node in the target partition comprises a target cache pool, the target cache pool being used to store a cache instance constructed based on a pre-warmed software package; the obtaining the target cache instance corresponding to the function invocation request comprises: searching in the target cache pool to determine whether the target cache instance is included in the target cache pool; and if the searching result is that the target cache instance is included in the target cache pool, obtaining the target cache instance from the target cache. The method further comprises: if the searching result is that the target cache instance is not included in the target cache pool, controlling the physical machine node in the target partition to create the target cache instance. 2. The method of claim 1, wherein, 3. The method of claim 2, wherein, 4. The method of any one of claims 1 to 3, wherein, 5. The method of claim 4, wherein, 6. The method of claim 5, wherein, 7. The method of claim 5, wherein, The method further includes: deleting the cache instance satisfying the preset cleaning condition; wherein the cache instance satisfying the preset cleaning condition includes a cache instance no longer in use and / or a cache instance with an idle time reaching a preset time threshold.
8. The method of claim 5, wherein, The method further includes: receiving a creation request sent by the big data computing engine, wherein the creation request is used to request the FaaS engine to create function-related information, wherein the function-related information includes the target function, a function running environment, and function metadata information; and controlling each physical machine node in each scheduling partition to download and store a target software package of the target function according to the function-related information, so as to preheat the target software package.
9. The method of claim 8, wherein, The method further includes: creating and storing the target cache instance into the target cache pool according to the preheated target software package.
10. The method of claim 9, wherein, The creating and storing the target cache instance into the target cache pool according to the preheated target software package includes: obtaining an idle slot of the target cache pool; and creating and storing the target cache instance into the target cache pool according to the idle slot.
11. A distributed computing scheduling apparatus, the apparatus being a function-as-a-service (FaaS) engine in a distributed computing scheduling system, the system further including a big data computing engine in communication connection with the FaaS engine, the FaaS engine including a plurality of scheduling partitions, and one scheduling partition including at least one physical machine node, the apparatus including: at least one storage medium storing at least one instruction set for distributed computing scheduling; at least one processor in communication connection with the at least one storage medium, wherein the at least one processor reads the at least one instruction set when running, and executes the method according to any one of claims 1 to 10 according to the indication of the at least one instruction set.
12. A distributed computing scheduling system, the system including a function-as-a-service (FaaS) engine and a big data computing engine in communication connection with the FaaS engine; the FaaS engine controlling a plurality of scheduling partitions, and one scheduling partition including at least one physical machine node, wherein the big data computing engine is configured to obtain a structured query language (SQL) query, determine and send a function invocation request corresponding to the SQL query to the FaaS engine, wherein the function invocation request is used to request processing of a target function corresponding to the SQL query; the FaaS engine is configured to execute the method according to any one of claims 1 to 10 according to the function invocation request, and obtain and feed back a function invocation result corresponding to the function invocation request to the big data computing engine; the big data computing engine is further configured to determine a query result corresponding to the SQL query according to the function invocation result.
Citation Information
Patent Citations
Calculation engine control method and device for distributed index calculation
CN114238463A
Function service scheduling method and system, computing equipment and storage medium
CN114518932A
Implementation system for custom function in distributed database
CN116150269A
Dynamic function resource configuration method under server-free architecture and function management platform
CN116382881A
Serverless distributed computing platform for big data scene
CN119127509A