A multi-task multi-thread scheduling method based on ORACLE timing task

By using Oracle's multi-task, multi-threaded scheduling method for scheduled tasks, the problem of excessively long task processing time and high system pressure caused by single-threaded processing in the banking system was solved, thereby shortening task processing time and improving system efficiency.

CN115617481BActive Publication Date: 2025-11-28WUHAN ZBANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211300439.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2025-11-28
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

In existing technologies, banking systems use a single-threaded approach when processing specific tasks at the end of each day, resulting in excessively long task processing times, high system pressure, low efficiency, impacting upstream and downstream systems, and potentially affecting real-time transactions.

Method used

A multi-task, multi-threaded scheduling method based on Oracle timed tasks is adopted. By configuring task segmentation and establishing dependencies between tasks, multi-threaded parallel processing of tasks is utilized, including detailed processing logic in steps 1-6 to achieve multi-threaded parallel processing.

Benefits of technology

This significantly shortened the overall task processing time, reduced system pressure, improved system operating efficiency, and avoided impacting real-time transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617481B_ABST
    Figure CN115617481B_ABST
Patent Text Reader

Abstract

The present application relates to the field of data processing, and provides a multi-task multi-thread scheduling method based on ORACLE timing task. The purpose is to solve the problem of long overall task processing time caused by the current single-thread processing mode, which also causes large system pressure, low efficiency, affects the settlement of upstream system and provides data for downstream system. The main scheme includes setting standard task configuration table, task segmentation parameter table and task dependency relationship configuration table; the business tables involved include batch thread registration table, running period task processing registration table, running period task processing segmentation registration table, task dependency relationship intermediate table and system table; the multi-task multi-thread scheduling method based on ORACLE timing task is adopted, the tasks are segmented according to the configuration rules, the dependency relationship between tasks is established, and the multi-thread parallel processing task mode is started, which not only greatly shortens the overall task processing time and reduces the system pressure, but also significantly improves the system running efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data processing, and provides a multi-task multi-thread scheduling method based on ORACLE timing task. BACKGROUND

[0002] Due to the bank-related business, a batch of specific tasks need to be automatically completed at the end of each day. Previously, the system has always adopted a single-thread task processing method, which processes tasks one by one according to the rules. The tasks must be completed in sequence, and the subsequent tasks will be executed only after the previous tasks are completed. Due to the need to start a new task after completing the previous task, the overall task processing time is too long, which also leads to high system pressure, low efficiency, affects the settlement of the upstream system and provides data for the downstream system, and may also affect real-time normal transactions in the process of task processing, which is not friendly to customers. In order to solve this problem, the multi-task multi-thread scheduling method based on ORACLE timing task is adopted, the tasks are segmented according to the configuration rules, the dependency relationship between tasks is established, and the multi-thread parallel processing mode is started. This not only greatly shortens the overall task processing time and reduces the system pressure, but also significantly improves the system efficiency. SUMMARY

[0003] The present application aims to solve the problem of long overall task processing time caused by the single-thread processing method, which also leads to high system pressure, low efficiency, affects the settlement of the upstream system and provides data for the downstream system.

[0004] In order to solve the above technical problems, the present application adopts the following technical means:

[0005] A multi-task multi-thread scheduling method based on ORACLE timing task, comprising the following steps:

[0006] Step 1, setting of the basic parameter configuration table, setting the standard task configuration table, the task segmentation parameter table, and the task dependency relationship configuration table, wherein,

[0007] The standard task configuration table sets the task number, task name, storage procedure containing specific business logic processing, and maximum concurrency;

[0008] The task segmentation parameter table sets the task number, task name, task segmentation number, task segmentation flag, task segmentation rule, and task segmentation interval;

[0009] The task dependency relationship configuration table sets the task number and the upper-level dependent task number;

[0010] Step 2, the business tables involved are:

[0011] Batch thread registration table, run-time task processing registration table, run-time task processing segment registration table, task dependency intermediate table, system table

[0012] Step 3, start processing batch tasks, start main thread timing task, after starting main thread timing task, asynchronously process main thread logic, segment tasks, and asynchronously process specific business logic;

[0013] Step 4, delete the record with task ID 99999999 (a fixed value, set to a large value 99999999 to avoid duplication with other IDs) in the batch thread registration table;

[0014] Step 5, insert a record with task ID 99999999 and thread ID as the main thread ID into the batch thread registration table and commit;

[0015] Step 6, asynchronous thread completes all task processing and ends.

[0016] In the above technical solution, step 3 includes the following steps:

[0017] Step 3-1, start asynchronous processing of main thread logic, first determine whether the oracle user lock with lock ID 999999999 exists, if it exists, prompt that the main thread is being processed and cannot be submitted repeatedly, otherwise apply for the oracle user lock with lock ID 999999999;

[0018] Step 3-2, update the current session information to support segmented parallel query and support segmented parallel insert, delete, update and query (session is a context from the beginning of communication to the end of communication between two parties, here it is oracle session.) ;

[0019] Step 3-3, prepare segmented tasks, update the current batch task segmentation state in the system table to "S-batch task segmentation start";

[0020] Step 3-3, backup the last batch task processing data to the run-time task processing segment registration history table;

[0021] Step 3-4, after backup, delete the last batch task processing data in the run-time task processing registration table and the run-time task processing segment registration table;

[0022] Step 3-5, poll tasks in the standard task configuration table, list tasks to be executed on the current day, and register them in the run-time task processing registration table;

[0023] Step 3-6, clean up and delete the data in the task dependency intermediate table, and re-insert the current dependency into the task dependency intermediate table according to the settings of the task dependency configuration table;

[0024] Step 3-7, poll the tasks that need to be executed in the current day in the processing state "N-unprocessed" in the running task processing registration table, and segmentally register the tasks that need to be executed in the current day in the running task processing segmented registration table;

[0025] Step 3-8, after the task segmentation is completed, update the current batch task segmentation state to "Y-batch task segmentation execution success";

[0026] Step 3-9, start a WHILE TRUE infinite loop mode, poll the tasks in the running task processing segmented registration table with the processing state "N-unprocessed" and the running state "N-unrun", and generate asynchronous multiple threads in the polling to execute the storage procedures corresponding to the tasks to complete the specific business logic processing;

[0027] Step 3-10, check whether all tasks have been executed, if all tasks have been executed, exit the infinite loop mode, otherwise continue polling;

[0028] Step 3-11, after all tasks are executed, release the oracle user lock with the main thread lock ID 999999999.

[0029] In the above technical solution, step 3-5 includes the following steps:

[0030] Step 3-5-1, start polling the tasks in the standard task configuration table, insert the tasks that need to be executed in the current day into the running task processing registration table, and set the processing state to "N-unprocessed";

[0031] Step 3-5-2, after polling all tasks in the standard task configuration table, end the polling.

[0032] In the above technical solution, step 3-7 includes the following steps:

[0033] Step 3-7-1, start polling the tasks that need to be executed in the current day in the processing state "N-unprocessed" in the running task processing registration table;

[0034] Step 3-7-2: Determine whether a task needs to be segmented based on the task segmentation flag configuration in the task segmentation parameter table. If segmentation is required, calculate the number of segments Q according to the segmentation configuration. If there are other parameter conditions, calculate the parameter value range of each segment's processing conditions. Simultaneously, insert the task information (currently participating in segmentation) with the number of segments Q into the runtime task processing segmentation registration table, and set the processing status to: N-not processed, and the running status to N-not running (e.g., if a task can be divided into 10 segments according to the configuration, register 10 entries of the same task information in the runtime task processing segmentation registration table for parallel processing. (This can be understood as follows: 10 balls take one minute to pick up each person once. Now, it takes one person 10 minutes to pick up the balls in the basket. Now, it takes 10 people 1 minute to pick up the balls).

[0035] If no segmentation is required, directly insert one entry for the task information in the runtime task processing segmentation registration table, and set the processing status to: N-unprocessed, and the running status to N-not running;

[0036] Step 3-7-3: After polling all tasks in the runtime task processing register with a processing status of N-unprocessed, end the polling.

[0037] In the above technical solution, steps 3-9 include the following steps:

[0038] Step 3-9-1: Start polling the task processing segment registration table for the current running period. Tasks with a processing status of "N-Unprocessed" and tasks with a running status of "N-Not Running" are sorted by sequence number.

[0039] Step 3-9-2: Based on the current task ID, query the maximum concurrency set in the standard task configuration table for the task, and determine whether the current task exceeds the maximum concurrency of the same task. If it exceeds the maximum concurrency, do not process the task; otherwise, prepare to execute the task and update the running status of the current segment task in the runtime task processing segment registration table to "Y-Running".

[0040] Step 3-9-3: Start the child thread timed task to asynchronously process the current segment task, and enable multi-threaded asynchronous processing of multiple tasks;

[0041] Step 3-9-4: Delete the record in the batch thread registration table whose task ID is the current segment task sequence number;

[0042] Step 3-9-5: Insert a record into the batch thread registration table with the task ID being the current segment task sequence number and the thread ID being the current child thread ID, and then submit it;

[0043] Step 3-9-8, check whether there is a current running period task processing segment registration table processing state N-unprocessed task, if there is an unprocessed task, continue to process, otherwise end the polling.

[0044] In the above technical solution, step 3-9-3 includes the following steps:

[0045] Step 3-9-3-1, start the segment task logic of the asynchronous processing sub-thread, first lock the record of the current segment task in the running period task processing segment registration table according to the current segment task sequence number using row-level lock;

[0046] Step 3-9-3-2, then judge whether the oracle user lock with the lock ID of the current segment task sequence number exists, if it exists, prompt that the current segment task sub-thread is being processed and cannot be submitted repeatedly, otherwise apply for the oracle user lock with the lock ID of the current segment task sequence number;

[0047] Step 3-9-3-3, update the current session information to support segment parallel query and support segment parallel insert, delete, modify and query;

[0048] Step 3-9-3-4, start executing the storage procedure corresponding to the current segment task configured to complete the business logic processing, if the storage procedure is executed successfully, commit the current transaction, and update the processing state of the current segment task in the running period task processing segment registration table to S-processing success, the running state to N-unrunning, and register the time cost of the task, the start date of the task, the end date of the task and other information, otherwise roll back the transaction, and update the processing state of the current segment task in the running period task processing segment registration table to F-processing failure, the running state to N-unrunning, and register the start date of the task, the failure date of the task, the error information of the task and other information;

[0049] Step 3-9-3-5, finally release the memory not used in the current session.

[0050] Because the present application adopts the above calculation scheme, the following beneficial effects are achieved:

[0051] Now a multi-task multi-thread scheduling method based on ORACLE timing task is adopted, the tasks are segmented according to the configuration rules, the dependency relationship between the tasks is established, and the multi-thread parallel processing task mode is started, which not only greatly shortens the overall task processing time and reduces the system pressure, but also significantly improves the system running efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0052] Figure 1 The task flow chart for starting the main thread timing task;

[0053] Figure 2Flow chart for main thread timing task to start asynchronous processing of main thread logic;

[0054] Figure 3 Flow chart for task registration into running period task processing registration table;

[0055] Figure 4 Flow chart for registration of tasks to be executed on the day into running period task processing segment registration table;

[0056] Figure 5 Flow chart for infinite loop mode;

[0057] Figure 6 Flow chart for starting multi-thread asynchronous processing of multi-task. DETAILED DESCRIPTION

[0058] The embodiments of the present application will be described in detail below. Although the present application will be described and illustrated with reference to some specific embodiments, it is noted that the present application is not limited to only these embodiments. Rather, modifications and equivalents of the present application are to be included within the scope of the present application.

[0059] In addition, in order to better illustrate the present application, numerous specific details are given in the following detailed description. Those skilled in the art will understand that the present application can be practiced without these specific details.

[0060] Step 1, setting of basic parameter configuration table, setting standard task configuration table, task segment parameter table, and task dependency configuration table. In the standard task configuration table, task number, task name, executed stored procedure (specific business logic processing), and maximum concurrency are set. In the task segment parameter table, task number, task name, task segment number, task segment flag, task segment rule, and task segment interval are set. In the task dependency configuration table, task number and superior dependent task number are set.

[0061] Step 2, business tables involved include batch thread registration table, running period task processing registration table, running period task processing segment registration table, task dependency intermediate table, and system table.

[0062] Step 3, starting to process batch task Figure 1 ), starting main thread timing task, main thread timing task starting asynchronous processing of main thread logic, and performing step 3-1 Figure 2 ).

[0063] For example, DBMS_JOB.submit (v_job, 'BATCH.exec_batch(″);′);--starting timing task

[0064] Step 3-1, start asynchronous processing main thread logic, first determine whether the oracle user lock (exclusive mode lock) with lock ID 999999999 exists, if it exists, prompt the main thread that it is being processed and cannot be submitted repeatedly, otherwise apply for the oracle user lock (exclusive mode lock) with lock ID 999999999;

[0065] For example: DBMS_LOCK.request(999999999, 6, 1); --Apply for a lock

[0066] Step 3-2, update the current session information to support segmented parallel query and support segmented parallel insert, delete, update and query;

[0067] For example: EXECUTE IMMEDIATE('ALTER SESSION ENABLE PARALLEL QUERY'); --Support segmented parallel query;

[0068] EXECUTE IMMEDIATE('ALTER SESSION ENABLE PARALLEL DML'); --Support segmented parallel insert, delete, update and query;

[0069] Step 3-3, prepare the segmented task, update the current batch task segmentation state in the system table to: S-batch task segmentation start;

[0070] Step 3-3, backup the last batch task processing data to the running period task processing segmentation registration history table;

[0071] Step 3-4, after backup, delete the last batch task processing data in the running period task processing registration table and the running period task processing segmentation registration table;

[0072] Step 3-5, poll the tasks in the standard task configuration table, list the tasks to be executed on the current day and register them in the running period task processing registration table, and perform step 3-5-1( Figure 3 );

[0073] For example: FOR i_pro IN C_PRO

[0074] LOOP

[0075] / / Logical processing

[0076] END LOOP; --Polling

[0077] Step 3-5-1, start polling the tasks in the standard task configuration table, insert the tasks to be executed on the current day into the running period task processing registration table, and set the processing state to: N-unprocessed;

[0078] Step 3-5-2, after polling all tasks in the standard task configuration table, end the polling;

[0079] Step 3-6, clean up and delete the data in the task dependency intermediate table, and re-insert the current dependency into the task dependency intermediate table according to the settings of the task dependency configuration table;

[0080] Step 3-7, poll the tasks that need to be executed in the current day in the running task processing registration table with the processing state N-unprocessed, and register the tasks that need to be executed in the current day in the running task processing segmented registration table, and proceed to step 3-7-1( Figure 4 );

[0081] Step 3-7-1, start polling the tasks that need to be executed in the current day in the running task processing registration table with the state N-unprocessed;

[0082] Step 3-7-2, according to the task segmentation flag configuration in the task segmentation parameter table, determine whether the task needs to be segmented, if it needs to be segmented, calculate the number of segments that need to be segmented according to the segmentation configuration, if there are other parameter conditions, also calculate the parameter value range that needs to be processed in each segment, at the same time insert the same number of task information in the running task processing segmented registration table, and set the processing state to N-unprocessed and the running state to N-unrun. Otherwise, do not segment, directly insert 1 piece of task information in the running task processing segmented registration table, and set the processing state to N-unprocessed and the running state to N-unrun;

[0083] Step 3-7-3, after polling all tasks in the running task processing registration table with the processing state N-unprocessed, end the polling;

[0084] Step 3-8, after the task segmentation is completed, update the current batch task segmentation state to Y-batch task segmentation execution success;

[0085] Step 3-9, start the WHILE TRUE infinite loop mode, poll the tasks in the running task processing segmented registration table with the processing state N-unprocessed and the running state N-unrun. In this polling, multiple asynchronous threads will be generated to execute the stored procedures corresponding to the tasks to complete the specific business logic processing, and proceed to step 3-9-1( Figure 5 );

[0086] For example: WHILE TRUE

[0087] LOOP

[0088] / / Business logic processing

[0089] END LOOP; -- Start infinite loop

[0090] Step 3-9-1, start polling the tasks with the processing status of N-unprocessed and the running status of N-unrun in the running period task processing segment registration table, and sort them in sequence number order;

[0091] Step 3-9-2, according to the current task ID, query the maximum concurrency set in the standard task configuration table, and judge whether the current task exceeds the maximum concurrency. If it exceeds the maximum concurrency, the task is not processed, otherwise the task is prepared to be executed, and the running status of the current segment task in the running period task processing segment registration table is updated to Y-running;

[0092] Step 3-9-3, start a sub-thread timing task to asynchronously process the current segment task, start multi-thread asynchronous processing of multiple tasks, and perform step 3-9-3-1( Figure 6 );

[0093] For example: DBMS_JOB.submit(v_job, 'BATCH.exec_sub_batch(″);′);--start sub-timing task

[0094] Step 3-9-3-1, start asynchronous processing of the segment task logic of the sub-thread, first lock the record of the current segment task in the running period task processing segment registration table according to the current segment task sequence number using row-level lock;

[0095] For example: select*from batch_split_task where seq_no=‘sequence number’for update--increase row-level lock

[0096] Step 3-9-3-2, judge whether the oracle user lock (exclusive mode lock) with the current segment task sequence number exists, if it exists, prompt that the current segment task sub-thread is being processed and cannot be submitted repeatedly, otherwise apply for the oracle user lock (exclusive mode lock) with the current segment task sequence number;

[0097] For example: DBMS_LOCK.request(current segment task sequence number, 6, 1);--apply lock

[0098] Step 3-9-3-3, update the current session information to support segment parallel query and support segment parallel insert, delete, update and query;

[0099] Step 3-9-3-4, start to execute the storage procedure configured according to the current segment task to complete the business logic processing. If the storage procedure is executed successfully, commit the current transaction, update the processing state of the current segment task in the running task processing segment registration table to S- processing success, update the running state to N- not running, register the time cost of the task, the start date of the task, the end date of the task and other information. If not, roll back the transaction, update the processing state of the current segment task in the running task processing segment registration table to F- processing failure, update the running state to N- not running, register the start date of the task, the failure date of the task, the error information of the task and other information.

[0100] For example: v_cursor := DBMS_SQL.open_cursor; -- open a cursor and return the cursor ID

[0101] DBMS_SQL.parse (v_cursor, p_cmd, DBMS_SQL.native); -- parse the cursor

[0102] DBMS_APPLICATION_INFO.set_action ('Parsed');

[0103] v_rowcount := DBMS_SQL.EXECUTE (v_cursor); -- execute the cursor statement and return the total row count

[0104] DBMS_APPLICATION_INFO.set_action ('Executed');

[0105] DBMS_SQL.close_cursor (v_cursor); -- close the specified cursor

[0106] Step 3-9-3-5, finally release the memory not used or unused in the current session;

[0107] For example: DBMS_SESSION.free_unused_user_memory; -- release memory

[0108] Step 3-9-4, delete the record with task ID as the sequence number of the current segment task in the batch thread registration table;

[0109] Step 3-9-5, insert a record with task ID as the sequence number of the current segment task and thread ID as the current sub-thread ID into the batch thread registration table and commit;

[0110] Step 3-9-8, check if there are any unprocessed current runtime task processing segments, register the processing status as N-unprocessed task, if there are unprocessed tasks, continue processing, otherwise end the polling;

[0111] Step 3-10, check if all tasks have been executed, if all tasks have been executed, exit the infinite loop (EXIT), otherwise continue polling;

[0112] For example: EXIT; -- exit the loop

[0113] Step 3-10, after all tasks have been executed, release the main thread lock ID 999999999 oracle user lock;

[0114] For example: DBMS_LOCK.release(999999999); -- release the lock

[0115] Step 4, delete the record with task ID 99999999 in the batch thread registration table;

[0116] Step 5, insert a record with task ID 99999999 and thread ID as the main thread ID into the batch thread registration table and commit;

[0117] Step 6, end, the asynchronous thread will complete all task processing.

Claims

1. A multi-task multi-thread scheduling method based on ORACLE timing task, characterized in that: Step 1, setting of a basic parameter configuration table, setting a standard task configuration table, a task segmentation parameter table, and a task dependency relationship configuration table, wherein, the standard task configuration table sets task number, task name, a stored procedure containing specific business logic processing, and maximum concurrency; the task segmentation parameter table sets task number, task name, task segmentation number, task segmentation flag, task segmentation rule, and task segmentation interval; the task dependency relationship configuration table sets task number and superior dependent task number; Step 2, business tables involved include: a batch thread registration table, a running task processing registration table, a running task processing segmentation registration table, a task dependency relationship intermediate table, and a system table; Step 3, starting to process batch tasks, starting a main thread timing task, after the main thread timing task is started, asynchronously processing main thread logic, segmenting tasks, and asynchronously processing specific business logic; Step 4, deleting a record with task ID 99999999 in the batch thread registration table; Step 5, inserting a record with task ID 99999999 and thread ID as the main thread ID into the batch thread registration table and committing; Step 6, asynchronously processing all tasks and ending; Step 3 includes the following steps: Step 3-1, starting asynchronous processing of main thread logic, first judging whether an oracle user lock with lock ID 99999999 exists, if it exists, prompting that the main thread is being processed and cannot be repeatedly submitted, otherwise, applying for an oracle user lock with lock ID 99999999; Step 3-2, updating current session information to support segmented parallel query and support segmented parallel insert, delete, update, and query; Step 3-3, preparing segmented tasks, and updating the current batch task segmentation state in the system table to "S-batch task segmentation start"; Step 3-3, backing up the last batch task processing data in the running task processing segmentation registration history table; Step 3-4, after the backup is completed, deleting the last batch task processing data in the running task processing registration table and the running task processing segmentation registration table; Step 3-5, polling tasks in the standard task configuration table, listing tasks to be executed on the current day and registering them in the running task processing registration table; Step 3-6, cleaning and deleting data in the task dependency relationship intermediate table, according to the setting of the task dependency relationship configuration table, re-inserting the current dependency relationship into the task dependency relationship intermediate table; Step 3-7, polling tasks to be executed on the current day with processing state "N-unprocessed" in the running task processing registration table, segmenting tasks to be executed on the current day and registering them in the running task processing segmentation registration table; Step 3-8, after the task segmentation is completed, updating the current batch task segmentation state to "Y-batch task segmentation execution success"; Step 3-9, start the WHILE TRUE infinite loop mode, poll the tasks with the processing state "N-unprocessed" and the running state "N-unrun" in the running task processing segment registration table, and generate asynchronous multiple threads to execute the corresponding stored procedures of the tasks in the polling to complete the specific business logic processing; Step 3-10, check whether all the tasks have been executed, if yes, exit the infinite loop mode, otherwise continue the polling; Step 3-11, release the oracle user lock with the main thread lock ID 99999999 after all the tasks are executed.

2. The multi-task and multi-thread scheduling method based on ORACLE timing task according to claim 1, characterized in that, Step 3-5 includes the following steps: Step 3-5-1, start polling the tasks in the standard task configuration table, insert the tasks to be executed on the current day into the running task processing registration table, and set the processing state as "N-unprocessed"; Step 3-5-2, end the polling after polling all the tasks in the standard task configuration table.

3. The method of claim 1, wherein the method further comprises: Step 3-7 includes the following steps: Step 3-7-1, start polling the tasks to be executed on the current day with the state "N-unprocessed" in the running task processing registration table; Step 3-7-2, if the tasks need to be segmented according to the task segment parameter table, calculate the number of segments Q according to the segment configuration, and calculate the parameter value range of the parameter conditions to be processed in each segment if there are other parameter conditions, insert Q task information in the running task processing segment registration table, and set the processing state as "N-unprocessed" and the running state as "N-unrun"; if no segmentation is needed, directly insert one task information in the running task processing segment registration table, and set the processing state as "N-unprocessed" and the running state as "N-unrun"; Step 3-7-3, end the polling after polling all the tasks with the processing state "N-unprocessed" in the running task processing registration table.

4. The multi-task and multi-thread scheduling method based on ORACLE timing task according to claim 1, characterized in that, Step 3-9 includes the following steps: Step 3-9-1, start polling the tasks with the processing state "N-unprocessed" and the running state "N-unrun" in the current running task processing segment registration table, and sort them according to the sequence number; Step 3-9-2, query the maximum concurrency set in the standard task configuration table according to the current task ID, and determine whether the current task exceeds the maximum concurrency, if yes, do not process the task, otherwise, prepare to execute the task, and update the running state of the current segment task in the running task processing segment registration table as "Y-running"; Step 3-9-3, start the sub-thread timing task, asynchronously process the current segment task, and start multiple thread asynchronous processing of multiple tasks; Step 3-9-4, delete the record with the task ID as the sequence number of the current segment task in the batch thread registration table; Step 3-9-5, insert the record with the task ID as the sequence number of the current segment task and the thread ID as the current sub-thread ID into the batch thread registration table and commit. Step 3-9-8, check if there is any unprocessed current running task processing segment registration table processing state for N-unprocessed tasks, if there is unprocessed task, then continue processing, otherwise end polling.

5. The method of claim 1, wherein the method is based on an ORACLE timing task. Step 3-9-3 includes the following steps: Step 3-9-3-1, start the segment task logic of the asynchronous processing sub-thread, first lock the record of the current segment task in the running task processing segment registration table according to the current segment task sequence number using row-level lock; Step 3-9-3-2, then judge whether the oracle user lock with the current segment task sequence number exists, if it exists, prompt that the current segment task sub-thread is being processed and cannot be submitted repeatedly, otherwise apply for the oracle user lock with the current segment task sequence number; Step 3-9-3-3, update the current session information to support segment parallel query and support segment parallel insert, delete, modify and query; Step 3-9-3-4, start executing the stored procedure corresponding to the current segment task to complete the business logic processing, if the stored procedure is executed successfully, commit the current transaction, and update the processing state of the current segment task in the running task processing segment registration table to S-processing success, the running state to N-unrun, and register the time cost, the start date, and the end date information of the task, otherwise roll back the transaction, and update the processing state of the current segment task in the running task processing segment registration table to F-processing failure, the running state to N-unrun, register the start date, the failure date, and the error information of the task; Step 3-9-3-5, finally release the memory not used in the current session.

Citation Information

Patent Citations

  • System batch task segmented parallel and dynamic scheduling method and storage medium

    CN113807710A

  • A system, method and article of manufacture for maintaining data in an e-commerce based technical architecture

    WO2001009751A2