Module scheduling method, device, equipment and storage medium
By identifying the execution module and module status required for the target task, the module scheduling method is used to allocate the execution module to the appropriate sub-scheduler, and scheduled through the central scheduler, the problem of low expansion capabilities of the system module is solved and the controllability and expansion capabilities of the module are improved.
Patent Information
- Application Number
- CN202111535033.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-12-15
AI Technical Summary
In the prior art, the expansion capability of system modules is low, resulting in complex interface maintenance relationships between modules, difficult maintenance, and difficult expansion.
By identifying the execution module and module status required for the target task, the module scheduling method is used to allocate the execution module to the appropriate sub-scheduler, and scheduled through the central scheduler to achieve unified scheduling and expansion of the module status.
It improves the controllability and expansion capabilities of the execution module, reduces the complexity of module communication, and avoids process chaos and increased difficulty in interface maintenance.
Smart Images

Figure CN114237847B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a module scheduling method, device, medium and equipment. Background Art
[0002] In the current business system, the logic processing between multiple modules is to establish connections between modules to complete the logic of the module, and then call other module interfaces to process the logic to complete the entire business. When the business logic involves multiple interactive processes, the processes between different modules will be intertwined, resulting in chaotic processes. In addition, during the processing, each module needs to maintain a large amount of interface information related to the caller, and the more modules involved, the more chaotic the interface maintenance relationship is, and the greater the difficulty of maintenance. Therefore, it is difficult to expand between modules, that is, the expansion capability is low. Summary of the invention
[0003] The main purpose of the present application is to provide a module scheduling method, device, medium and equipment, aiming to solve the technical problem of low expansion capability of system modules in the prior art.
[0004] In order to achieve the above-mentioned invention object, the present application proposes a module scheduling method, which comprises:
[0005] Acquire a target task, and identify an execution module corresponding to the target task and a module state of the execution module;
[0006] When the module state satisfies a preset first condition, each of the execution modules is assigned to the same sub-scheduler, and the execution modules are scheduled by the sub-scheduler until the target task is completed;
[0007] When the module state satisfies a preset second condition, each of the execution modules is assigned to a plurality of different sub-schedulers according to the module state, registration information of each of the sub-schedulers is obtained, and the registration information is sent to the central scheduler to complete the registration;
[0008] Each of the sub-schedulers is scheduled by the central scheduler, and the execution module is scheduled by the sub-scheduler until the target task is completed.
[0009] Further, the acquiring of the target task and identifying the execution module corresponding to the target task and the module state of the execution module include:
[0010] In response to a target task submission instruction, identifying a task type of the target task;
[0011] According to the task type, identifying the execution identifier and computing node of the target task, and obtaining the computing amount of each computing node;
[0012] Identify the execution module according to the execution identifier, and identify the corresponding interface in the execution module through the computing node;
[0013] The execution load of the corresponding execution module is calculated according to the calculation amount, and the total number of the execution modules and the execution load are used as the module status.
[0014] Furthermore, after identifying the execution module corresponding to the target task and the module state of the execution module, the method further includes:
[0015] Obtaining the current load capacity of each of the sub-schedulers;
[0016] Whether the module status satisfies the first condition and the second condition is determined based on the current loadable capacity, the total number of execution modules and the execution load, wherein the first condition includes that the total number of execution modules is not greater than a preset number threshold, and the sum of the execution loads is not greater than the current loadable capacity, and the second condition includes that the total number of execution modules is greater than a preset number threshold, or the sum of the execution loads is greater than the current loadable capacity.
[0017] Further, the scheduling of each of the sub-schedulers by the central scheduler and the scheduling of the execution module by the sub-schedulers includes:
[0018] According to the execution logic of the target task, assign a corresponding priority parameter to each of the computing nodes;
[0019] Based on the order of the priority parameters from high to low, the sub-scheduler corresponding to the computing node is called through the central scheduler according to the registration information of the sub-scheduler.
[0020] Further, calling the sub-scheduler corresponding to the computing node according to the registration information of the sub-scheduler by the central scheduler includes:
[0021] Obtain the total number of computing nodes;
[0022] When the sub-scheduler corresponding to the computing node is called, a historical node count is performed until the number of the historical nodes is equal to the total number of nodes, and then the call is stopped.
[0023] Further, the scheduling of the execution module by the sub-scheduler includes:
[0024] Initiating a call instruction to the interface of the execution module according to the module information of each execution module by the sub-scheduler;
[0025] When the interface returns busy information, the calling instruction is initiated again after waiting for a preset first delay time.
[0026] Furthermore, before sending the registration information to the central scheduler, the method further includes:
[0027] When the number of sub-schedulers is greater than a preset sub-scheduler threshold, calculating the required number of central schedulers according to the number of sub-schedulers;
[0028] The central scheduler is initialized according to the number of central schedulers.
[0029] The present application also proposes a module scheduling device, comprising:
[0030] A state identification module, used to obtain a target task, and identify an execution module corresponding to the target task and a module state of the execution module;
[0031] A first scheduling module, configured to assign each of the execution modules to the same sub-scheduler when the module state satisfies a preset first condition, and schedule the execution modules through the sub-scheduler until the target task is completed;
[0032] a first allocation module, configured to allocate each of the execution modules to a plurality of different sub-schedulers according to the module state when the module state satisfies a preset second condition, obtain registration information of each of the sub-schedulers, and send the registration information to the central scheduler to complete the registration;
[0033] The second scheduling module is used to schedule each of the sub-schedulers through the central scheduler, and schedule the execution module through the sub-scheduler until the target task is completed.
[0034] The present application also proposes a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.
[0035] The present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0036] The module scheduling method, device, medium and equipment of the present application improve the controllability of the execution module by identifying the execution module and module status required for the target task, so as to facilitate overall scheduling, thereby improving the scalability between the execution modules; the number of sub-schedulers currently required is identified through preset judgment conditions, and when only one sub-scheduler is needed, the sub-scheduler is used to uniformly schedule each execution module, so that each execution module only needs to be connected to one sub-scheduler, thereby reducing the complexity of module communication; the number of sub-schedulers currently required is identified through preset judgment conditions, and when only multiple sub-schedulers are needed, the sub-schedulers are allocated to each execution module according to the module status, and the sub-schedulers are allocated at the central scheduler. Sub-scheduler registration enables communication between sub-schedulers, and registration is completed by sending registration information to the central scheduler, which improves the identifiability of each sub-scheduler and reduces the probability of misidentification; the sub-scheduler and the corresponding execution module are scheduled by the central scheduler, which balances the load between the sub-schedulers and relieves the execution pressure of a single sub-scheduler; when the execution module needs to be expanded, the sub-scheduler can be used to connect and maintain the interface with the new execution module, avoiding the problem of process confusion caused by the interweaving of processes between execution modules, and at the same time avoiding the problem that the execution modules perform interface maintenance separately, resulting in the maintenance difficulty increasing with the increase in the number of execution modules, thereby improving the expansion capability of the execution module. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of a module scheduling method according to an embodiment of the present application;
[0038] Figure 2 This is a schematic block diagram of the structure of a module scheduling device according to an embodiment of the present application;
[0039] Figure 3 A schematic block diagram of the structure of a computer device according to an embodiment of the present application.
[0040] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0042] Reference Figure 1 In order to achieve the above-mentioned object of the invention, this embodiment proposes a module scheduling method, which includes:
[0043] S1: Acquire a target task, and identify an execution module corresponding to the target task and a module state of the execution module;
[0044] S2: when the module state satisfies a preset first condition, allocating each of the execution modules to the same sub-scheduler, and scheduling the execution modules through the sub-scheduler until the target task is completed;
[0045] S3: when the module state meets the preset second condition, each of the execution modules is assigned to a plurality of different sub-schedulers according to the module state, registration information of each of the sub-schedulers is obtained, and the registration information is sent to the central scheduler to complete the registration;
[0046] S4: The central scheduler is used to schedule each of the sub-schedulers, and the sub-schedulers are used to schedule the execution modules until the target task is completed.
[0047] This embodiment improves the controllability of the execution module by identifying the execution module and module status required for the target task, so as to facilitate overall scheduling, thereby improving the scalability between the execution modules; the number of sub-schedulers currently required is identified through preset judgment conditions, and when only one sub-scheduler is needed, the sub-scheduler is used to uniformly schedule each execution module, so that each execution module only needs to be connected to one sub-scheduler, thereby reducing the complexity of module communication; the number of sub-schedulers currently required is identified through preset judgment conditions, and when multiple sub-schedulers are needed, the sub-schedulers are allocated to each execution module according to the module status, and the sub-schedulers are registered at the central scheduler, thereby By realizing communication between each sub-scheduler and completing registration by sending registration information to the central scheduler, the identifiability of each sub-scheduler is improved and the probability of misidentification is reduced; the sub-scheduler and the corresponding execution module are scheduled by the central scheduler, which balances the load between the sub-schedulers and relieves the execution pressure of a single sub-scheduler; when the execution module needs to be expanded, the sub-scheduler can be used to connect and maintain the interface with the new execution module, avoiding the problem of process confusion caused by process interweaving between execution modules, and at the same time avoiding the problem that the execution modules perform interface maintenance separately, resulting in the maintenance difficulty increasing with the increase in the number of execution modules, thereby improving the expansion capability of the execution module.
[0048] For step S1, this embodiment is applied to module scheduling, especially in the application of scheduling of each execution module in the business system, and the allocation of sub-schedulers and the control of the central scheduler can be performed based on artificial intelligence technology. Among them, artificial intelligence (AI) is a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Because in the prior art, if the above-mentioned target task is executed directly by calling each other between the execution modules, it will cause difficulty in coordination between the various calling tasks, and after a scheduling sequence is formed, it is difficult to expand new modules to join the scheduling; therefore, the present invention first identifies the modules and module states required for the execution of the target task before module scheduling, so as to facilitate overall scheduling. The above-mentioned module state may include the total number of execution modules, the load of the execution module, the occupancy of the interface, etc. The present invention improves the controllability of the execution module by identifying the execution module and module state required for the target task, so as to facilitate overall scheduling, thereby improving the scalability between the execution modules.
[0049] For step S2, the first condition may be that the total number of modules is not greater than a preset number threshold. For example, when the number threshold is 10, if the number of execution modules required by the target task is not greater than 10, each execution module is assigned to the same subtask scheduler for scheduling; at this time, the sub-scheduler identifies and sorts the interfaces of the execution modules that the target task needs to call, and calls the interfaces of the execution modules in sequence according to the above sorting. The present invention identifies the number of sub-schedulers currently required through preset judgment conditions. When only one sub-scheduler is needed, the sub-scheduler uniformly schedules each execution module, so that each execution module only needs to be connected to one sub-scheduler, reducing the complexity of module communication.
[0050] For step S3, the second condition may be that the total number of modules is greater than a preset number threshold. For example, when the number threshold is 10, if the number of execution modules required by the target task is greater than 10, each execution module is assigned to a different subtask scheduler for scheduling; the number of selected sub-schedulers is related to the total number of modules, that is, when the total number of modules is greater than 20, two sub-schedulers can be selected, and when the total number of modules is greater than 30, three sub-schedulers can be selected to avoid the problem of excessive load on a single sub-scheduler. In a specific implementation, each sub-scheduler needs to register the scheduler name, each sub-scheduler receives the scheduler routing information interface, and receives the scheduling execution module message interface to the central scheduler. The central scheduler collects the scheduler name, receiving routing information interface, and receiving scheduling module message interface of each sub-scheduler. The central scheduler broadcasts the scheduler name of other schedulers and the receiving scheduling module message interface to each scheduler through the receiving routing information interface of each sub-scheduler. At this time, the central scheduler identifies and sorts the interfaces of the execution modules that need to be called by the target task, and confirms the sub-schedulers corresponding to each execution module, so as to call the sub-schedulers in sequence according to the above sorting, so that the sub-schedulers further call the interfaces of the execution modules. The present invention identifies the number of sub-schedulers currently required through preset judgment conditions, and when only multiple sub-schedulers are needed, sub-schedulers are allocated to each execution module according to the module status, and the sub-schedulers are registered at the central scheduler, so as to realize the communication between each sub-scheduler, and complete the registration by sending registration information to the central scheduler, thereby improving the identifiability of each sub-scheduler and reducing the probability of misidentification.
[0051] For step S4, when multiple sub-schedulers are needed, the above-mentioned central scheduler performs unified scheduling; specifically, the execution modules under different sub-schedulers are called, and the sub-scheduler name, the service name and parameters of the execution module are sent to the central scheduler through the sub-scheduler. The central scheduler finds the corresponding sub-scheduler message receiving interface through the scheduler name, and passes the message to the corresponding sub-scheduler, so that the corresponding sub-scheduler finds the message receiving interface of the execution module according to the module service name, and the sub-scheduler passes the message to the execution module by calling this interface. The present invention schedules the sub-scheduler and the corresponding execution module through the central scheduler, balances the load between the sub-schedulers, and relieves the execution pressure of a single sub-scheduler.
[0052] In one embodiment, acquiring the target task and identifying the execution module corresponding to the target task and the module state of the execution module includes:
[0053] S11: In response to a target task submission instruction, identifying a task type of the target task;
[0054] S12: Identify the execution identifier and computing node of the target task according to the task type, and obtain the computing amount of each computing node;
[0055] S13: Identify the execution module according to the execution identifier, and identify the corresponding interface in the execution module through the computing node;
[0056] S14: Calculate the execution load of the corresponding execution module according to the calculation amount, and use the total number of the execution modules and the execution load as the module status.
[0057] This embodiment uses the execution load and the total number of execution modules as the module status for sub-scheduler allocation judgment, thereby avoiding the execution module being in a full-load state all the time, thereby improving the system's pressure resilience and abnormal response capabilities.
[0058] For step S31, after receiving the target task submission instruction submitted by the client, first identify the task type of the target task, and query the execution identifier corresponding to the target task in the pre-stored database, so as to identify the execution module related to the target task according to the execution identifier.
[0059] For step S33, after the execution module is identified, the interfaces that need to be called in each execution module are identified according to the computing node. Since more than one interface may be called in each execution module, multiple interfaces may be called in a specific application. In order to avoid the execution module being in a full-load state all the time, this embodiment uses the sum of the calculation amounts corresponding to each interface in the execution module as the execution load of the execution module.
[0060] In one embodiment, after identifying the execution module corresponding to the target task and the module state of the execution module, the method further includes:
[0061] S101: Obtain the current load capacity of each sub-scheduler;
[0062] S102: Determine whether the module status satisfies the first condition and the second condition based on the current loadable capacity, the total number of the execution modules and the execution load, wherein the first condition includes that the total number of the execution modules is not greater than a preset number threshold, and the sum of the execution loads is not greater than the current loadable capacity, and the second condition includes that the total number of the execution modules is greater than a preset number threshold, or the sum of the execution loads is greater than the current loadable capacity.
[0063] This embodiment allocates each execution module according to the current load capacity of the sub-scheduler, thereby improving the balance of module allocation.
[0064] For step S102, before allocating the sub-scheduler, the module status is judged first. Specifically, when the total number of execution modules is too small and the sum of the execution loads is not greater than the current load capacity, one sub-scheduler can complete the docking and scheduling between the various execution modules; however, if the total number of execution modules is too small, the sum of the execution loads of the execution modules is greater than the current load capacity of the sub-scheduler, which means that even if there are fewer execution modules, one sub-scheduler cannot afford its scheduling tasks, so it needs to be allocated to two or more sub-schedulers for scheduling. The specific allocation method can be calculated based on the specific current load capacity, the number of execution modules and the execution load, and this embodiment does not make specific limitations. The above-mentioned current load capacity is calculated by the rated load and the current load of the sub-scheduler.
[0065] In one embodiment, the scheduling of each of the sub-schedulers by the central scheduler and the scheduling of the execution module by the sub-schedulers include:
[0066] S41: assigning a corresponding priority parameter to each of the computing nodes according to the execution logic of the target task;
[0067] S42: Based on the order of the priority parameters from high to low, the central scheduler calls the sub-scheduler corresponding to the computing node according to the registration information of the sub-scheduler.
[0068] This embodiment improves the orderliness of module scheduling by allocating priority parameters and calling sub-schedulers in order of priority parameters.
[0069] For step S42, before the target task is executed, the execution order of each computing node is obtained according to its execution logic, and each computing node is sorted in order from front to back according to the execution order, and the corresponding priority parameters are set in sequence according to the sorting order. For example, if the execution logic of the target task in a certain business scenario is to first call the b1 interface of the B execution module, then call the b2 interface of the B execution module, then call the a2 interface of the A execution module, and finally call the c3 interface of the C execution module, then the above interfaces correspond to a computing node respectively, and the order of each computing node is b1-b2-a2-c3. It can be obtained that the priority parameter corresponding to the computing node of the b1 interface is 1, the priority parameter corresponding to the computing node of the b2 interface is 2, the priority parameter corresponding to the computing node of the a2 interface is 3, and the priority parameter corresponding to the computing node of the c3 interface is 4, so that the central scheduler can call the sub-schedulers corresponding to the computing nodes in sequence according to the above priority parameters from 1 to 4, thereby improving the orderliness of task execution and avoiding the problem of the central scheduler preferentially executing computing nodes with lower priorities due to the execution speed of each execution module and communication status delay during the actual scheduling process.
[0070] In one embodiment, calling the sub-scheduler corresponding to the computing node according to the registration information of the sub-scheduler by the central scheduler includes:
[0071] S421: Obtain the total number of computing nodes;
[0072] S422: When calling the sub-scheduler corresponding to the computing node, perform a historical node count until the number of historical nodes is equal to the total number of nodes, and then stop calling.
[0073] This embodiment determines the task execution progress through computing nodes, thereby improving the stability of target task execution.
[0074] For step S421, the above-mentioned computing nodes and the corresponding sub-schedulers are not in a one-to-one correspondence with each other. One computing node corresponds to only one sub-scheduler, but one sub-scheduler can correspond to multiple computing nodes. In a specific implementation, if the same sub-scheduler is called twice, it will be counted according to two computing nodes.
[0075] For step S422, each time a call is made, it is considered that a computing node has been executed, and the historical node count is increased by 1. When the number of historical nodes is equal to the total number of nodes, it means that the target task has been executed, and the call can be stopped at this time.
[0076] In one embodiment, scheduling the execution module by the sub-scheduler includes:
[0077] S21: Initiating a call instruction to the interface of the execution module according to the module information of each execution module through the sub-scheduler;
[0078] S22: When the interface returns busy information, wait for a preset first delay time and then initiate the call instruction again.
[0079] This embodiment uses delay time to buffer various scheduling instructions to avoid task abnormalities caused by instruction conflicts.
[0080] For step S22, under normal execution, it is only necessary to pass the computing node, service name and parameters of the execution module to the sub-scheduler. The sub-scheduler obtains the corresponding interface in the execution module from the registered service name, and the sub-scheduler directly calls the interface and passes the information to be executed. However, an execution module may be connected to multiple sub-schedulers at the same time. Therefore, when sub-scheduler A calls interface A, sub-scheduler B may also want to call interface A at the same time. At this time, the first delay time can be used for buffering to reserve execution time for the sub-scheduler that is currently calling the interface, thereby avoiding the problem of task abnormality caused by instruction conflict.
[0081] In one embodiment, before sending the registration information to the central scheduler, the method further includes:
[0082] S31: when the number of sub-schedulers is greater than a preset sub-scheduler threshold, calculating the required number of central schedulers according to the number of sub-schedulers;
[0083] S32: Initialize the central scheduler according to the number of central schedulers.
[0084] This embodiment controls the number of central schedulers by the number of sub-schedulers, thereby improving scheduling efficiency and scheduling stability.
[0085] For step S31, the above-mentioned sub-scheduler threshold can be set according to the actual load situation. When the number of sub-schedulers is large, more central schedulers are set accordingly, thereby alleviating the computing pressure of the central scheduler and improving the computing efficiency of the central scheduler.
[0086] Reference Figure 2 , the present application also proposes a module scheduling device, comprising:
[0087] The state identification module 100 is used to obtain a target task, and identify an execution module corresponding to the target task and a module state of the execution module;
[0088] A first scheduling module 200, configured to assign each of the execution modules to the same sub-scheduler when the module state satisfies a preset first condition, and schedule the execution modules through the sub-scheduler until the target task is completed;
[0089] A first allocation module 300, configured to allocate each of the execution modules to a plurality of different sub-schedulers according to the module status when the module status satisfies a preset second condition, obtain registration information of each of the sub-schedulers, and send the registration information to the central scheduler to complete the registration;
[0090] The second scheduling module 400 is used to schedule each of the sub-schedulers through the central scheduler, and schedule the execution module through the sub-scheduler until the target task is completed.
[0091] This embodiment improves the controllability of the execution module by identifying the execution module and module status required for the target task, so as to facilitate overall scheduling, thereby improving the scalability between the execution modules; the number of sub-schedulers currently required is identified through preset judgment conditions, and when only one sub-scheduler is needed, the execution modules are uniformly scheduled through the sub-scheduler, so that each execution module only needs to be connected to one sub-scheduler, thereby reducing the complexity of module communication; the number of sub-schedulers currently required is identified through preset judgment conditions, and when only multiple sub-schedulers are needed, the sub-schedulers are allocated to the execution modules according to the module status, and the sub-schedulers are registered at the central scheduler, thereby By realizing communication between each sub-scheduler and completing registration by sending registration information to the central scheduler, the identifiability of each sub-scheduler is improved and the probability of misidentification is reduced; the sub-scheduler and the corresponding execution module are scheduled by the central scheduler, which balances the load between the sub-schedulers and relieves the execution pressure of a single sub-scheduler; when the execution module needs to be expanded, the sub-scheduler can be used to connect and maintain the interface with the new execution module, avoiding the problem of process confusion caused by process interweaving between execution modules, and at the same time avoiding the problem that the execution modules perform interface maintenance separately, resulting in the maintenance difficulty increasing with the increase in the number of execution modules, thereby improving the expansion capability of the execution module.
[0092] In one embodiment, the state identification module 100 is specifically used for:
[0093] In response to a target task submission instruction, identifying a task type of the target task;
[0094] According to the task type, identifying the execution identifier and computing node of the target task, and obtaining the computing amount of each computing node;
[0095] Identify the execution module according to the execution identifier, and identify the corresponding interface in the execution module through the computing node;
[0096] The execution load of the corresponding execution module is calculated according to the calculation amount, and the total number of the execution modules and the execution load are used as the module status.
[0097] In one embodiment, the state identification module 100 is specifically used for:
[0098] Obtaining the current load capacity of each of the sub-schedulers;
[0099] Whether the module status satisfies the first condition and the second condition is determined based on the current loadable capacity, the total number of execution modules and the execution load, wherein the first condition includes that the total number of execution modules is not greater than a preset number threshold, and the sum of the execution loads is not greater than the current loadable capacity, and the second condition includes that the total number of execution modules is greater than a preset number threshold, or the sum of the execution loads is greater than the current loadable capacity.
[0100] In one embodiment, the second scheduling module 400 is specifically used for:
[0101] According to the execution logic of the target task, assign a corresponding priority parameter to each of the computing nodes;
[0102] Based on the order of the priority parameters from high to low, the sub-scheduler corresponding to the computing node is called through the central scheduler according to the registration information of the sub-scheduler.
[0103] In one embodiment, the second scheduling module 400 is specifically used for:
[0104] Obtain the total number of computing nodes;
[0105] When the sub-scheduler corresponding to the computing node is called, a historical node count is performed until the number of the historical nodes is equal to the total number of nodes, and then the call is stopped.
[0106] In one embodiment, the first scheduling module 200 is further used for:
[0107] Initiating a call instruction to the interface of the execution module according to the module information of each execution module by the sub-scheduler;
[0108] When the interface returns busy information, the calling instruction is initiated again after waiting for a preset first delay time.
[0109] In one embodiment, the first allocation module 300 is specifically used for:
[0110] When the number of sub-schedulers is greater than a preset sub-scheduler threshold, calculating the required number of central schedulers according to the number of sub-schedulers;
[0111] The central scheduler is initialized according to the number of central schedulers.
[0112] Reference Figure 3 In an embodiment of the present application, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a module scheduling method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a module scheduling method is implemented. The module scheduling method includes: obtaining a target task, and identifying an execution module corresponding to the target task and a module status of the execution module; when the module status meets a preset first condition, allocating each of the execution modules to the same sub-scheduler, and scheduling the execution modules through the sub-scheduler until the target task is completed; when the module status meets a preset second condition, allocating each of the execution modules to a number of different sub-schedulers according to the module status, obtaining registration information of each of the sub-schedulers, and sending the registration information to a central scheduler to complete registration; scheduling each of the sub-schedulers through the central scheduler, and scheduling the execution modules through the sub-schedulers until the target task is completed.
[0113] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a module scheduling method is implemented, including the following steps: obtaining a target task, and identifying an execution module corresponding to the target task and a module status of the execution module; when the module status satisfies a preset first condition, allocating each of the execution modules to the same sub-scheduler, and scheduling the execution modules through the sub-scheduler until the target task is completed; when the module status satisfies a preset second condition, allocating each of the execution modules to a number of different sub-schedulers according to the module status, obtaining registration information of each of the sub-schedulers, and sending the registration information to a central scheduler to complete registration; scheduling each of the sub-schedulers through the central scheduler, and scheduling the execution modules through the sub-scheduler until the target task is completed.
[0114] The module scheduling method for execution described above improves the controllability of the execution module by identifying the execution module and module status required for the target task, so as to facilitate overall scheduling and thus improve the scalability between the execution modules; identifies the number of sub-schedulers currently required through preset judgment conditions, and when only one sub-scheduler is required, the sub-scheduler is used to uniformly schedule each execution module, so that each execution module only needs to be connected to one sub-scheduler, thereby reducing the complexity of module communication; identifies the number of sub-schedulers currently required through preset judgment conditions, and when only multiple sub-schedulers are required, sub-schedulers are allocated to each execution module according to the module status, and the sub-schedulers are performed at the central scheduler. Registration is performed to achieve communication between sub-schedulers, and registration information is sent to the central scheduler to complete the registration, thereby improving the identifiability of each sub-scheduler and reducing the probability of misidentification; the sub-schedulers and corresponding execution modules are scheduled by the central scheduler to balance the loads between the sub-schedulers and relieve the execution pressure of a single sub-scheduler; when the execution module needs to be expanded, the sub-scheduler can be used to connect to and maintain the interface with the new execution module, avoiding the problem of process confusion caused by the interweaving of processes between execution modules, and at the same time avoiding the problem that the execution modules perform interface maintenance separately, resulting in the maintenance difficulty increasing with the increase in the number of execution modules, thereby improving the expansion capability of the execution module.
[0115] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0116] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0117] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A module scheduling method, characterized in that: The method comprises: Acquire a target task, and identify an execution module corresponding to the target task and a module state of the execution module; When the module state satisfies a preset first condition, each of the execution modules is assigned to the same sub-scheduler, and the execution modules are scheduled by the sub-scheduler until the target task is completed; When the module state satisfies a preset second condition, each of the execution modules is assigned to a plurality of different sub-schedulers according to the module state, registration information of each of the sub-schedulers is obtained, and the registration information is sent to the central scheduler to complete the registration; The central scheduler is used to schedule each of the sub-schedulers, and the sub-schedulers are used to schedule the execution modules until the target task is completed; The acquiring of the target task and identifying the execution module corresponding to the target task and the module state of the execution module include: In response to a target task submission instruction, identifying a task type of the target task; According to the task type, identifying the execution identifier and computing node of the target task, and obtaining the computing amount of each computing node; Identify the execution module according to the execution identifier, and identify the corresponding interface in the execution module through the computing node; Calculate the execution load of the corresponding execution module according to the calculation amount, and use the total number of the execution modules and the execution load as the module state; After identifying the execution module corresponding to the target task and the module state of the execution module, the method further includes: Obtaining the current load capacity of each of the sub-schedulers; Whether the module status satisfies the first condition and the second condition is determined based on the current loadable capacity, the total number of execution modules and the execution load, wherein the first condition includes that the total number of execution modules is not greater than a preset number threshold, and the sum of the execution loads is not greater than the current loadable capacity, and the second condition includes that the total number of execution modules is greater than a preset number threshold, or the sum of the execution loads is greater than the current loadable capacity.
2. The module scheduling method according to claim 1, characterized in that: The scheduling of each of the sub-schedulers by the central scheduler, and scheduling of the execution modules by the sub-schedulers, includes: According to the execution logic of the target task, assign a corresponding priority parameter to each of the computing nodes; Based on the order of the priority parameters from high to low, the sub-scheduler corresponding to the computing node is called through the central scheduler according to the registration information of the sub-scheduler.
3. The module scheduling method according to claim 2, characterized in that: The calling, by the central scheduler, the sub-scheduler corresponding to the computing node according to the registration information of the sub-scheduler includes: Obtain the total number of computing nodes; When the sub-scheduler corresponding to the computing node is called, a historical node count is performed until the number of the historical nodes is equal to the total number of nodes, and then the call is stopped.
4. The module scheduling method according to claim 1, characterized in that: The scheduling of the execution module by the sub-scheduler includes: Initiating a call instruction to the interface of the execution module according to the module information of each execution module by the sub-scheduler; When the interface returns busy information, the calling instruction is initiated again after waiting for a preset first delay time.
5. The module scheduling method according to claim 1, characterized in that: Before sending the registration information to the central scheduler, the method further includes: When the number of sub-schedulers is greater than a preset sub-scheduler threshold, calculating the required number of central schedulers according to the number of sub-schedulers; The central scheduler is initialized according to the number of central schedulers.
6. A module scheduling device, used to implement the module scheduling method according to any one of claims 1 to 5, characterized in that: include: A state identification module, used to obtain a target task, and identify an execution module corresponding to the target task and a module state of the execution module; A first scheduling module, configured to assign each of the execution modules to the same sub-scheduler when the module state satisfies a preset first condition, and schedule the execution modules through the sub-scheduler until the target task is completed; a first allocation module, configured to allocate each of the execution modules to a plurality of different sub-schedulers according to the module state when the module state satisfies a preset second condition, obtain registration information of each of the sub-schedulers, and send the registration information to the central scheduler to complete the registration; The second scheduling module is used to schedule each of the sub-schedulers through the central scheduler, and schedule the execution module through the sub-scheduler until the target task is completed.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Task scheduling method, device and system, electronic equipment and storage medium
CN112486648A
Distributed task scheduling method and device, storage medium and electronic equipment
CN112910952A