Task scheduling method, device, electronic device and storage medium
By introducing task scheduling methods in the banking system, analyzing task instructions, querying configuration tables and determining execution methods, the problem of unsatisfactory task scheduling results in the existing technology is solved, and dynamic scheduling and differentiated processing of different tasks is realized.
Patent Information
- Application Number
- CN202210460647.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-04-28
AI Technical Summary
In the prior art, after receiving task instructions, the banking system usually schedules tasks in chronological order, and does not dynamically schedule different tasks, resulting in unsatisfactory task scheduling.
A task scheduling method is provided, by receiving task scheduling request instructions sent by a third-party system, analyzing instructions to obtain task processing number groups, querying the instant task scheduling configuration table to obtain task configuration information, determining the execution mode and processing type of the task based on the configuration information, and executing the task in a determined manner until all tasks to be scheduled are executed.
This method can differentiate different external instructions and execute different tasks in different execution methods, meeting the needs of different branches of transaction processes and improving the effectiveness of task scheduling.
Smart Images

Figure CN114756351B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a task scheduling method, device, electronic device and storage medium. Background Art
[0002] In various banking systems, there are a large number of transaction scenarios triggered by task instructions initiated by other external third parties. After receiving the above task instructions, the banking system needs to execute tasks to achieve specific logical functions, such as withholding and paying various fees, remittance of customer funds, change of credit line, opening and cancellation of related contracts, etc.
[0003] In the prior art, after receiving a task instruction, the system usually schedules the tasks in chronological order, without dynamically scheduling different tasks, resulting in less than ideal task scheduling effects. Summary of the invention
[0004] In view of this, the present application provides a task scheduling method, device, electronic device and storage medium to solve the problem in the prior art that after receiving a task instruction, the system usually schedules tasks in chronological order without dynamically scheduling different tasks, resulting in less than ideal task scheduling effect.
[0005] To achieve the above objectives, this application provides the following technical solutions:
[0006] The first aspect of the present application discloses a task scheduling method, comprising:
[0007] Receive task scheduling request instructions sent by a third-party system;
[0008] Parsing the task scheduling request instruction to obtain a task processing number group of the task to be scheduled;
[0009] According to the task processing number group, query the preset instant task scheduling configuration table to obtain the configuration information of the task to be scheduled; wherein the configuration information at least includes the processing number group, task type, processing sequence number, blocking wait flag, local execution flag, task code, and remote service domain name;
[0010] Based on the configuration information, determining the execution mode and processing type of the task to be scheduled;
[0011] Execute the task to be scheduled according to the execution mode;
[0012] After the execution of the task to be scheduled is completed, the next task corresponding to the processing type is determined according to the processing type, and the execution is returned to query the preset immediate task scheduling configuration table according to the task processing number group to obtain the configuration information of the task to be scheduled, until all the tasks to be scheduled in the task scheduling request instruction are executed.
[0013] Optionally, in the above method, determining the execution mode of the task to be scheduled based on the configuration information includes:
[0014] Based on the blocking waiting flag in the configuration information, determining whether the task to be scheduled needs to block and wait;
[0015] If the task to be scheduled needs to be blocked and waited, the task to be scheduled is called up by the main calling service, and a task thread is created, and the task to be scheduled is executed by the task thread;
[0016] If the task to be scheduled does not need to block and wait, a task thread is created, and the task to be scheduled is executed through the task thread.
[0017] Optionally, the above method further includes:
[0018] Determine the service cluster corresponding to the task to be scheduled based on the processing type of the task to be scheduled;
[0019] Deploy the task to be scheduled on the service cluster.
[0020] Optionally, in the above method, the step of deploying the task to be scheduled on the service cluster includes:
[0021] If the processing type of the task to be scheduled is local execution, the program information to be called is obtained through a preset task configuration table, and the task to be scheduled is deployed based on the program information, wherein the program information at least includes program type, pre-processing program information and post-processing program information;
[0022] If the processing type of the task to be scheduled is non-local execution, the remote service domain name of the task to be scheduled and the corresponding program information of the task to be scheduled in the task configuration table are obtained, and the task to be scheduled is deployed based on the remote service domain name and the program information.
[0023] The second aspect of the application of this agency discloses a task scheduling device, including:
[0024] A receiving unit, used for receiving a task scheduling request instruction sent by a third-party system;
[0025] A parsing unit, used for parsing the task scheduling request instruction to obtain a task processing number group of the task to be scheduled;
[0026] A query unit, used to query a preset instant task scheduling configuration table according to the task processing number group, and obtain configuration information of the task to be scheduled; wherein the configuration information at least includes a processing number group, a task type, a processing sequence number, a blocking wait flag, a local execution flag, a task code, and a remote service domain name;
[0027] A first determining unit, configured to determine an execution mode and a processing type of the task to be scheduled based on the configuration information;
[0028] An execution unit, configured to execute the task to be scheduled according to the execution mode;
[0029] The second determination unit is used to determine the next task corresponding to the processing type according to the processing type after the execution of the task to be scheduled is completed, and return to execute according to the task processing number group, query the preset immediate task scheduling configuration table, and obtain the configuration information of the task to be scheduled, until all the tasks to be scheduled in the task scheduling request instruction are executed.
[0030] Optionally, in the above device, the first determining unit includes:
[0031] A judging subunit, configured to judge whether the task to be scheduled needs to be blocked and waited based on the blocking and waiting flag in the configuration information;
[0032] The first execution subunit is used for calling the task to be scheduled through the main calling service if the task to be scheduled needs to be blocked and waited, and creating a task thread, and executing the task to be scheduled through the task thread;
[0033] The second execution sub-unit is used to create a task thread if the task to be scheduled does not need to block and wait, and execute the task to be scheduled through the task thread.
[0034] Optionally, the above device further includes:
[0035] A third determining unit, configured to determine a service cluster corresponding to the task to be scheduled based on a processing type of the task to be scheduled;
[0036] A deployment unit is used to deploy the task to be scheduled on the service cluster.
[0037] Optionally, in the above-mentioned device, the deployment unit includes:
[0038] A first deployment subunit is used for, if the processing type of the task to be scheduled is local execution, obtaining program information that needs to be called through a preset task configuration table, and deploying the task to be scheduled based on the program information, wherein the program information at least includes program type, pre-processing program information, and post-processing program information;
[0039] The second deployment sub-unit is used to obtain the remote service domain name of the task to be scheduled and the program information corresponding to the task to be scheduled in the task configuration table if the processing type of the task to be scheduled is non-local execution, and deploy the task to be scheduled based on the domain name of the remote service and the program information.
[0040] The third aspect of the present application discloses an electronic device, comprising:
[0041] one or more processors;
[0042] a storage device having one or more programs stored thereon;
[0043] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of the first aspects of the present invention.
[0044] A fourth aspect of the present application discloses a computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method described in any one of the first aspects of the present invention is implemented.
[0045] It can be seen from the above technical scheme that in a task scheduling method provided by the present application, firstly, a task scheduling request instruction sent by a third-party system is received, the task scheduling request instruction is parsed, and a task processing number group of the task to be scheduled is obtained. According to the task processing number group, the preset instant task scheduling configuration table is queried to obtain the configuration information of the task to be scheduled. Based on the configuration information, the execution mode and processing type of the task to be scheduled are determined. Then the task to be scheduled is executed according to the execution mode. After the task to be scheduled is executed, according to the processing type, the next task corresponding to the processing type is determined, and the execution is returned to the preset instant task scheduling configuration table according to the task processing number group, and the configuration information of the task to be scheduled is obtained until all the tasks to be scheduled in the task scheduling request instruction are executed. It can be seen from this that, using the method of the present application, different external instructions can be processed differently, and different tasks can be executed in different execution modes. At the same time, in the multiple instant task scheduling processes of the instruction, the selection of the subsequent task can be dynamically specified according to the return of the previous task, which meets the needs of different branch processing of the transaction process. The invention solves the problem that in the prior art, after receiving the task instruction, the system usually schedules the tasks in chronological order, and does not dynamically schedule different tasks, resulting in unsatisfactory task scheduling effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0047] Figure 1 A flowchart of a task scheduling method disclosed in another embodiment of the present application;
[0048] Figure 2 A schematic diagram of a task scheduling device disclosed in another embodiment of the present application;
[0049] Figure 3 A schematic diagram of an electronic device disclosed in another embodiment of the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0052] Furthermore, in this document, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0053] As can be seen from the background technology, in the prior art, after receiving a task instruction, the system usually schedules the tasks in chronological order, without dynamically scheduling different tasks, resulting in unsatisfactory task scheduling effects.
[0054] In view of this, the present application provides a task scheduling method, device, electronic device and storage medium to solve the problem in the prior art that after receiving a task instruction, the system usually schedules tasks in chronological order without dynamically scheduling different tasks, resulting in less than ideal task scheduling effect.
[0055] The present application embodiment provides a method for scheduling tasks, specifically: Figure 1 As shown, including:
[0056] S101: Receive a task scheduling request instruction sent by a third-party system.
[0057] It should be noted that first, the application system receives the task scheduling request instruction sent by the third-party system, registers the key log element fields, and retains the original text of the instruction.
[0058] S102: parse the task scheduling request instruction to obtain a task processing number group of the task to be scheduled.
[0059] It should be noted that a general instruction parsing method is called to parse the task scheduling request instruction to obtain a task processing number group of the task to be scheduled.
[0060] S103. According to the task processing number group, query the preset instant task scheduling configuration table to obtain the configuration information of the task to be scheduled; wherein the configuration information at least includes the processing number group, task type, processing sequence number, blocking wait flag, local execution flag, task code, and remote service domain name.
[0061] It should be noted that after obtaining the task processing number group of the task to be scheduled, the preset real-time task scheduling configuration table is queried according to the task processing number group to obtain the configuration information of the task to be scheduled. Among them, the configuration information at least includes information such as the processing number group, task type, processing sequence number, blocking wait flag, local execution flag, task code, remote service domain name, etc. The real-time task scheduling configuration table is shown in Table 1:
[0062]
[0063]
[0064] Table 1
[0065] S104: Determine the execution mode and processing type of the task to be scheduled based on the configuration information.
[0066] It should be noted that after obtaining the configuration information of the task to be scheduled, the execution mode of the task to be scheduled is determined based on the blocking wait flag in the obtained configuration information. At the same time, based on the local execution flag in the obtained configuration information, the processing type of the task to be scheduled is determined, where the processing type includes local execution and non-local execution.
[0067] Optionally, in another embodiment of the present application, an implementation method of determining the execution mode of the to-be-scheduled task based on the configuration information in step S104 may include:
[0068] Based on the blocking waiting flag in the configuration information, it is determined whether the task to be scheduled needs to block and wait.
[0069] If the task to be scheduled needs to be blocked and waited, the task to be scheduled is called up by the main calling service, and a task thread is created, and the task to be scheduled is executed by the task thread.
[0070] If the task to be scheduled does not need to block and wait, a task thread is created, and the task to be scheduled is executed through the task thread.
[0071] It should be noted that after obtaining the configuration information of the task to be scheduled, check the blocking waiting flag in the configuration information to determine whether the task to be scheduled needs to be blocked and waited. If the task to be scheduled needs to be blocked and waited, call the task to be scheduled through the main calling service, create a task thread, and execute the task to be scheduled through the task thread. If the task to be scheduled does not need to be blocked and waited, create a task thread, and execute the task to be scheduled through the task thread. If the task to be scheduled is blocked and waited, after the previous process is called, it is necessary to wait for the called task to be executed and receive a clear processing result before continuing the subsequent process; if the task to be scheduled is non-blocking and waiting, the previous process can continue to execute only after the task to be scheduled is created, and the processing result of the current task to be scheduled is saved automatically. Through the above processing, it can be ensured that tasks with strict response time requirements are first called and return clear execution results; and non-blocking tasks are only triggered by the main calling program, and subsequent execution can be confirmed by other asynchronous compensation mechanisms.
[0072] S105: Execute the task to be scheduled according to the execution mode.
[0073] It should be noted that, after determining the execution mode of the task to be scheduled based on the blocking wait flag in the acquired configuration information, the task to be scheduled is executed according to the execution mode.
[0074] S106. After the execution of the task to be scheduled is completed, the next task corresponding to the processing type is determined according to the processing type, and the execution is returned to query the preset immediate task scheduling configuration table according to the task processing number group to obtain the configuration information of the task to be scheduled, until all the tasks to be scheduled in the task scheduling request instruction are executed.
[0075] It should be noted that after the execution of the task to be scheduled is completed, the next task corresponding to the processing type is determined according to the processing type, that is, when the main calling service obtains the processing type result value, it can determine which branch logic of the immediate task processing number group to go to next, determine the next task, and return to execute according to the task processing number group, query the preset immediate task scheduling configuration table, and obtain the configuration information of the task to be scheduled, that is, step S103, until all the tasks to be scheduled in the task scheduling request instruction are executed.
[0076] Through the above processing, the dynamic selection of the same external instruction execution process can be supported, and the selection range of subsequent tasks can be determined according to the processing type returned by the previous task, thereby achieving high customization of the entire system architecture.
[0077] In a task scheduling method provided by an embodiment of the present application, a task scheduling request instruction sent by a third-party system is first received, the task scheduling request instruction is parsed, and a task processing number group of the task to be scheduled is obtained. According to the task processing number group, a preset instant task scheduling configuration table is queried to obtain the configuration information of the task to be scheduled. Based on the configuration information, the execution mode and processing type of the task to be scheduled are determined. Then the task to be scheduled is executed according to the execution mode. After the task to be scheduled is executed, according to the processing type, the next task corresponding to the processing type is determined, and the execution is returned to query the preset instant task scheduling configuration table according to the task processing number group to obtain the configuration information of the task to be scheduled, until all the tasks to be scheduled in the task scheduling request instruction are executed. It can be seen from this that, using the method of the present application, different external instructions can be processed differently, and different tasks can be executed in different execution modes. At the same time, in the multiple instant task scheduling processes of the instruction, the selection of subsequent tasks can be dynamically specified according to the return of the previous task, which meets the needs of different branch processing of the transaction process. The invention solves the problem that in the prior art, after receiving the task instruction, the system usually schedules the tasks in chronological order, and does not dynamically schedule different tasks, resulting in unsatisfactory task scheduling effect.
[0078] Optionally, in another embodiment of the present application, the above task scheduling method may further include:
[0079] Based on the processing type of the task to be scheduled, a service cluster corresponding to the task to be scheduled is determined.
[0080] Deploy the task to be scheduled on the service cluster.
[0081] It should be noted that after determining the processing type of the task to be scheduled, the service cluster corresponding to the task to be scheduled is determined based on the processing type of the task to be scheduled, and then the task to be scheduled is deployed on the service cluster. In this way, different types of tasks can be independently deployed in different service clusters according to the processing logic, which is in line with the concept of efficient release, rapid iteration, and mutual isolation of each microservice in the microservice architecture.
[0082] Optionally, in another embodiment of the present application, the above-mentioned implementation of deploying the to-be-scheduled task on the service cluster may include:
[0083] If the processing type of the task to be scheduled is local execution, the program information that needs to be called up is obtained through the preset task configuration table, and the task to be scheduled is deployed based on the program information, wherein the program information at least includes program type, pre-processing program information and post-processing program information.
[0084] If the processing type of the task to be scheduled is non-local execution, the remote service domain name of the task to be scheduled and the corresponding program information of the task to be scheduled in the task configuration table are obtained, and the task to be scheduled is deployed based on the remote service domain name and the program information.
[0085] It should be noted that if the processing type of the task to be scheduled is local execution, the program information to be called is obtained through the preset task configuration table, and the task to be scheduled is deployed based on the program information, wherein the program information at least includes the program type, pre-processing program information and post-processing program information. The task configuration table is shown in Table 2:
[0086]
[0087]
[0088] Table 2
[0089] If the processing type of the task to be scheduled is non-local execution, the remote service domain name of the task to be scheduled and the corresponding program information of the task to be scheduled in the task configuration table are obtained, and the task to be scheduled is deployed based on the remote service domain name and the program information.
[0090] Another embodiment of the present application also discloses a task scheduling device, such as Figure 2 As shown, specifically including:
[0091] The receiving unit 201 is used to receive a task scheduling request instruction sent by a third-party system.
[0092] The parsing unit 202 is used to parse the task scheduling request instruction to obtain a task processing number group of the task to be scheduled.
[0093] The query unit 203 is used to query the preset instant task scheduling configuration table according to the task processing number group to obtain the configuration information of the task to be scheduled; wherein the configuration information at least includes the processing number group, task type, processing sequence number, blocking wait flag, local execution flag, task code, and remote service domain name.
[0094] The first determining unit 204 is configured to determine an execution mode and a processing type of the task to be scheduled based on the configuration information.
[0095] The execution unit 205 is used to execute the task to be scheduled according to the execution mode.
[0096] The second determination unit 206 is used to determine the next task corresponding to the processing type according to the processing type after the execution of the task to be scheduled is completed, and return to execute according to the task processing number group, query the preset instant task scheduling configuration table, and obtain the configuration information of the task to be scheduled, until all the tasks to be scheduled in the task scheduling request instruction are executed.
[0097] In this embodiment, the specific execution process of the receiving unit 201, the parsing unit 202, the query unit 203, the first determination unit 204, the execution unit 205 and the second determination unit 206 can be referred to in the corresponding Figure 1 The content of the method embodiment will not be repeated here.
[0098] In a task scheduling device provided in an embodiment of the present application, first, a receiving unit 201 receives a task scheduling request instruction sent by a third-party system, and a parsing unit 202 parses the task scheduling request instruction to obtain a task processing number group of the task to be scheduled. The query unit 203 queries the preset instant task scheduling configuration table according to the task processing number group to obtain the configuration information of the task to be scheduled. The first determination unit 204 determines the execution mode and processing type of the task to be scheduled based on the configuration information. Then the execution unit 205 executes the task to be scheduled according to the execution mode. After the task to be scheduled is executed, the second determination unit 206 determines the next task corresponding to the processing type according to the processing type, and returns to execute the preset instant task scheduling configuration table according to the task processing number group to obtain the configuration information of the task to be scheduled, until all the tasks to be scheduled in the task scheduling request instruction are executed. It can be seen that, using the method of the present application, different external instructions can be processed differently, and different tasks can be executed in different execution modes. At the same time, in the process of scheduling multiple immediate tasks of the instruction, the selection of subsequent tasks can be dynamically specified according to the return of the previous task, meeting the needs of processing different branches of the transaction process. It solves the problem in the prior art that after receiving the task instruction, the system usually schedules the tasks in chronological order, and does not dynamically schedule different tasks, resulting in less than ideal task scheduling effect.
[0099] Optionally, in another embodiment of the present application, an implementation of the first determining unit 204 includes:
[0100] The judging subunit is used to judge whether the task to be scheduled needs to be blocked and waited based on the blocking and waiting flag in the configuration information.
[0101] The first execution subunit is used for calling the task to be scheduled through the main calling service if the task to be scheduled needs to block and wait, and creating a task thread, and executing the task to be scheduled through the task thread.
[0102] The second execution sub-unit is used to create a task thread if the task to be scheduled does not need to block and wait, and execute the task to be scheduled through the task thread.
[0103] In this embodiment, the specific execution process of the judgment subunit, the first execution subunit, and the second execution subunit can be found in the corresponding method embodiments described above, and will not be repeated here.
[0104] Optionally, in another embodiment of the present application, the above task scheduling device may further include:
[0105] The third determining unit is configured to determine a service cluster corresponding to the task to be scheduled based on a processing type of the task to be scheduled.
[0106] A deployment unit is used to deploy the task to be scheduled on the service cluster.
[0107] In this embodiment, the specific execution process of the third determination unit and the deployment unit can be found in the corresponding method embodiment described above, and will not be repeated here.
[0108] Optionally, in another embodiment of the present application, an implementation of the above deployment unit includes:
[0109] The first deployment sub-unit is used to obtain the program information that needs to be called up through a preset task configuration table if the processing type of the task to be scheduled is local execution, and deploy the task to be scheduled based on the program information, wherein the program information at least includes program type, pre-processing program information and post-processing program information.
[0110] The second deployment sub-unit is used to obtain the remote service domain name of the task to be scheduled and the program information corresponding to the task to be scheduled in the task configuration table if the processing type of the task to be scheduled is non-local execution, and deploy the task to be scheduled based on the domain name of the remote service and the program information.
[0111] In this embodiment, the specific execution process of the first deployment sub-unit and the second deployment sub-unit can be found in the corresponding method embodiment described above, and will not be repeated here.
[0112] Another embodiment of the present application further provides an electronic device, such as Figure 3 As shown, specifically including:
[0113] One or more processors 301 .
[0114] The storage device 302 stores one or more programs.
[0115] When one or more programs are executed by one or more processors 301 , the one or more processors 301 implement any one of the methods in the above embodiments.
[0116] Another embodiment of the present application further provides a computer storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, any one of the methods in the above embodiments is implemented.
[0117] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0119] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A task scheduling method, characterized in that: include: Receive task scheduling request instructions sent by a third-party system; Parsing the task scheduling request instruction to obtain a task processing number group of the task to be scheduled; According to the task processing number group, query the preset instant task scheduling configuration table to obtain the configuration information of the task to be scheduled; wherein the configuration information at least includes the processing number group, the task type, the processing sequence number, the blocking wait flag, the local execution flag, the task code and the remote service domain name; Based on the configuration information, determining the execution mode and processing type of the task to be scheduled; wherein the processing type includes local execution and non-local execution; Execute the task to be scheduled according to the execution mode; After the execution of the task to be scheduled is completed, the next task corresponding to the processing type is determined according to the processing type, and the execution is returned to query the preset immediate task scheduling configuration table according to the task processing number group to obtain the configuration information of the task to be scheduled, until all the tasks to be scheduled in the task scheduling request instruction are executed; Wherein, determining the execution mode of the task to be scheduled based on the configuration information includes: Based on the blocking waiting flag in the configuration information, determining whether the task to be scheduled needs to block and wait; If the task to be scheduled needs to be blocked and waited, the task to be scheduled is called up by the main calling service, and a task thread is created, and the task to be scheduled is executed by the task thread; If the task to be scheduled does not need to block and wait, a task thread is created, and the task to be scheduled is executed through the task thread.
2. The method according to claim 1, characterized in that Also includes: Determine the service cluster corresponding to the task to be scheduled based on the processing type of the task to be scheduled; Deploy the task to be scheduled on the service cluster.
3. The method according to claim 2, characterized in that The step of deploying the task to be scheduled on the service cluster includes: If the processing type of the task to be scheduled is local execution, the program information to be called is obtained through a preset task configuration table, and the task to be scheduled is deployed based on the program information, wherein the program information at least includes program type, pre-processing program information and post-processing program information; If the processing type of the task to be scheduled is non-local execution, the remote service domain name of the task to be scheduled and the corresponding program information of the task to be scheduled in the task configuration table are obtained, and the task to be scheduled is deployed based on the remote service domain name and the program information.
4. A task scheduling device, characterized in that: include: A receiving unit, used for receiving a task scheduling request instruction sent by a third-party system; A parsing unit, used for parsing the task scheduling request instruction to obtain a task processing number group of the task to be scheduled; A query unit, used to query a preset instant task scheduling configuration table according to the task processing number group, and obtain configuration information of the task to be scheduled; wherein the configuration information at least includes a processing number group, a task type, a processing sequence number, a blocking wait flag, a local execution flag, a task code, and a remote service domain name; A first determining unit, configured to determine, based on the configuration information, an execution mode and a processing type of the task to be scheduled; wherein the processing type includes local execution and non-local execution; An execution unit, configured to execute the task to be scheduled according to the execution mode; A second determination unit is used to determine the next task corresponding to the processing type according to the processing type after the execution of the task to be scheduled is completed, and return to execute according to the task processing number group, query the preset immediate task scheduling configuration table, and obtain the configuration information of the task to be scheduled, until all the tasks to be scheduled in the task scheduling request instruction are completed; Wherein, the first determining unit includes: A judging subunit, configured to judge whether the task to be scheduled needs to be blocked and waited based on the blocking and waiting flag in the configuration information; The first execution subunit is used for calling the task to be scheduled through the main calling service if the task to be scheduled needs to be blocked and waited, and creating a task thread, and executing the task to be scheduled through the task thread; The second execution sub-unit is used to create a task thread if the task to be scheduled does not need to block and wait, and execute the task to be scheduled through the task thread.
5. The device according to claim 4, characterized in that Also includes: A third determining unit, configured to determine a service cluster corresponding to the task to be scheduled based on a processing type of the task to be scheduled; A deployment unit is used to deploy the task to be scheduled on the service cluster.
6. The device according to claim 5, characterized in that The deployment unit includes: A first deployment subunit is used for, if the processing type of the task to be scheduled is local execution, obtaining program information that needs to be called through a preset task configuration table, and deploying the task to be scheduled based on the program information, wherein the program information at least includes program type, pre-processing program information, and post-processing program information; The second deployment sub-unit is used to obtain the remote service domain name of the task to be scheduled and the program information corresponding to the task to be scheduled in the task configuration table if the processing type of the task to be scheduled is non-local execution, and deploy the task to be scheduled based on the domain name of the remote service and the program information.
7. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 3.
8. A computer storage medium, characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Distributed parallel computing method, device and system
CN103034475A
Task scheduling method and device
CN108319499A