Task processing method and device, electronic equipment and storage medium

By performing dependency analysis on data units and optimizing the combination of operating parameters, subtasks that can be executed in parallel are generated, solving the problem of low data processing efficiency in domestic information technology application databases and achieving more efficient task processing and resource utilization.

CN123178019APending Publication Date: 2026-11-27HUISHANG BANK CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611623735.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-20
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

When migrating enterprise business data to the domestic information technology application innovation database, existing technologies suffer from low data processing efficiency.

Method used

By performing dependency analysis on data units, subtasks that can be executed in parallel are generated, and the optimal combination of global running parameters is determined based on the performance data of execution nodes, thereby optimizing the task processing flow.

Benefits of technology

It improves data processing efficiency during task execution, shortens processing time, increases throughput and resource utilization, and reduces the impact of single-node failures on tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178019A_ABST
    Figure CN123178019A_ABST
Patent Text Reader

Abstract

The present disclosure provides a task processing method and device, electronic equipment and storage medium. The task processing method comprises: obtaining a to-be-processed task, the to-be-processed task comprising a plurality of data units; performing dependency analysis on the data units to determine the calculation dependency of the data units; generating sub-tasks of the to-be-processed task based on the calculation dependency, the data units of the sub-tasks that can be executed in parallel being non-strongly dependent data units; performing trial operation on the sub-tasks based on the running parameter combinations corresponding to the sub-tasks to obtain execution node performance data; determining a global optimal running parameter combination based on the execution node performance data; and performing running processing on the sub-tasks based on the global optimal running parameter combination to obtain a task running processing result. The task processing method can improve the data processing efficiency in the task running process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure pertains to the field of data processing and relates to task processing methods, particularly to task processing methods, apparatus, electronic devices, and storage media. Background Technology

[0002] As enterprises deepen their digital transformation and the domestic full-stack information technology application innovation system is gradually implemented and promoted, enterprise business data is showing an exponential growth trend, and business system databases are gradually migrating and transforming to domestic information technology application innovation databases. Batch processing frameworks designed for traditional commercial centralized databases (such as Oracle and DB2) generally suffer from low data processing efficiency when directly migrated and adapted to the domestic information technology application innovation database environment. Summary of the Invention

[0003] The purpose of this disclosure is to provide a task processing method, apparatus, electronic device, and storage medium to address the problem of low data processing efficiency in current task processing methods.

[0004] In a first aspect, embodiments of this disclosure provide a task processing method, comprising: acquiring a task to be processed, the task to be processed comprising a plurality of data units; performing dependency analysis on the data units to determine the computational dependencies of the data units; generating subtasks of the task to be processed based on the computational dependencies, wherein the data units in the subtasks that can be executed in parallel are data units with non-strong dependencies; performing trial runs on the subtasks based on the combination of running parameters corresponding to the subtasks to obtain execution node performance data; determining the globally optimal combination of running parameters based on the execution node performance data; and performing running processing on the subtasks based on the globally optimal combination of running parameters to obtain task running processing results.

[0005] In one embodiment of this disclosure, performing dependency analysis on the data units to obtain their computational dependencies includes: parsing the data units to obtain their dependency constraints; constructing a directed acyclic graph (DAG) associated with the data units based on the dependency constraints, wherein the DAG is used to describe the dependency topology between the data units; and determining the computational dependencies of the data units based on the DAG.

[0006] In one embodiment of this disclosure, the process of performing a trial run on the subtask based on the combination of operating parameters corresponding to the subtask to obtain execution node performance data includes: extracting the subtask to obtain extracted subtasks; obtaining the combination of operating parameters corresponding to the extracted subtasks; and performing a trial run on the extracted subtask based on the combination of operating parameters corresponding to the extracted subtasks to obtain the execution node performance data.

[0007] In one embodiment of this disclosure, the subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing result, including: Step S1, writing the fragmented data of the subtask received by the execution node into a source table; Step S2, running the subtask based on the globally optimal combination of operating parameters to obtain the task processing result; Step S3, writing the task processing result into an intermediate table; Step S4, verifying the task processing result in the intermediate table to obtain a verification result, wherein the verification result is either verification passed or verification failed; Step S5, if the verification result is verification passed, writing the task processing result into a target table; otherwise, clearing the intermediate table and returning to step S2.

[0008] In one embodiment of this disclosure, the subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing result, including: obtaining a timeout threshold corresponding to the subtask based on a preset basic timeout time, a preset adjustment coefficient, and the data volume of the subtask; processing the subtask based on the globally optimal combination of operating parameters and the timeout threshold to obtain the task processing result; and during the subtask processing, when the processing time of the subtask exceeds the timeout threshold, automatically retrying the subtask several times based on a preset waiting interval to obtain the retry processing result.

[0009] In one embodiment of this disclosure, determining the globally optimal combination of operating parameters based on the execution node performance data includes: the execution node performance data including throughput, response latency, and resource consumption data during node trial operation; determining the comprehensive efficiency value of the execution node based on the execution node performance data; and determining the globally optimal combination of operating parameters based on the comprehensive efficiency value.

[0010] In one embodiment of this disclosure, the overall efficiency value is expressed as:

[0011]

[0012] in This represents the overall efficiency value. Indicates the first weight. This indicates the throughput. Indicates the maximum throughput. Indicates the second weight. This indicates the response delay. Indicates the maximum response delay. Indicates the third weight. Indicates the number of CPU resources available. This indicates the total number of CPU resources.

[0013] Secondly, embodiments of this disclosure provide a task processing apparatus, comprising: a task acquisition module for acquiring a task to be processed, the task to be processed comprising a plurality of data units; a dependency analysis module for performing dependency analysis on the data units to determine the computational dependencies of the data units; a task generation module for generating subtasks of the task to be processed based on the computational dependencies, wherein the data units in the subtasks that can be executed in parallel are data units with non-strong dependencies; a task execution module for performing trial runs on the subtasks based on the combination of execution parameters corresponding to the subtasks to obtain execution node performance data; a parameter determination module for determining the globally optimal combination of execution parameters based on the execution node performance data; and a task processing module for performing execution processing on the subtasks based on the globally optimal combination of execution parameters to obtain task execution processing results.

[0014] Thirdly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the task processing method described in any of the first aspects.

[0015] Fourthly, embodiments of this disclosure provide an electronic device, including: a memory; and a processor coupled to the memory and configured to perform the task processing method according to any one of the first aspects.

[0016] As described above, the task processing method, apparatus, electronic device, and storage medium of this application have the following beneficial effects:

[0017] In the task processing method, subtasks of the task to be processed are generated based on the computational dependencies. The data units of the subtasks that can be executed in parallel are data units with non-strong dependencies. The subtasks are processed based on the globally optimal combination of running parameters to obtain the task processing results, which can improve the data processing efficiency during the task operation. Attached Figure Description

[0018] Figure 1 The diagram shown is a schematic representation of the hardware structure of the task processing method according to an embodiment of this disclosure.

[0019] Figure 2 The flowchart shown is a task processing method according to an embodiment of this disclosure.

[0020] Figure 3 The flowchart shown is an embodiment of this disclosure that performs dependency analysis on the data unit to obtain the computational dependency of the data unit.

[0021] Figure 4This is a flowchart illustrating how, according to an embodiment of this disclosure, a trial run of a subtask is performed based on the combination of running parameters corresponding to the subtask to obtain performance data of the execution node.

[0022] Figure 5 This is a flowchart illustrating how the subtask is processed based on the globally optimal combination of operating parameters in an embodiment of this disclosure to obtain the task processing results.

[0023] Figure 6 This is a flowchart illustrating how the subtask is processed based on the globally optimal combination of operating parameters in an embodiment of this disclosure to obtain the task processing results.

[0024] Figure 7 The diagram shown is a structural schematic of a task processing device according to an embodiment of this disclosure. Detailed Implementation

[0025] The following specific examples illustrate the implementation of this disclosure. Those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. This disclosure can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0026] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. Therefore, the illustrations only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0027] The following will describe in detail the principles and implementation methods of the task processing method of the present disclosure embodiments, so that those skilled in the art can understand the task processing method of the present disclosure embodiments without creative effort.

[0028] The technical solutions of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The task processing method provided in the embodiments of this disclosure can run on a computer terminal or similar device. Taking running on the computer terminal as an example, Figure 1 This is a hardware structure block diagram of the computer terminal, such as... Figure 1 As shown, a computer terminal may include a processor and a memory, wherein the processor may be a central processing unit and the memory is used to store data. Figure 1 The computer terminal shown is for illustrative purposes only and is not intended to limit the specific structure of the computer terminal.

[0029] In some embodiments, the computer terminal may further include: communication transmission equipment and input / output equipment.

[0030] In some embodiments, the memory may be used to store computer programs, such as application software programs and modules. The memory may include high-speed random access memory (RAM) and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include memory remotely located relative to the processor, which can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks (LANs), mobile communication networks, and combinations thereof.

[0031] In some embodiments, the communication transmission device can be used to receive or send data via a network, which may include a wireless network provided by the communication provider of the computer terminal. The communication transmission device may include a NIC (Network Interface Controller), which can be connected to other network devices via a base station to communicate with the Internet.

[0032] Figure 2 This is a flowchart illustrating a task processing method according to an embodiment of the present disclosure. Figure 2 As shown, this embodiment provides a task processing method, including:

[0033] Step S11: Obtain the task to be processed, which contains several data units.

[0034] Optionally, the task to be processed can be a batch processing task, and the data unit can refer to an independent data set in the data processing process.

[0035] Step S12: Perform dependency analysis on the data unit to determine the computational dependency of the data unit.

[0036] Optionally, the dependencies may include: input-output association, state change order, and transaction boundary constraints. The input-output association may refer to the output of one data unit serving as the input of another, forming a data flow dependency. The state change order may refer to the data units following a preset state flow during processing. The transaction boundary constraint may refer to the operations of multiple data units being associated with the same transaction, possessing atomicity; when any operation fails, all executed operations are rolled back, restoring each data unit to its state before the transaction began.

[0037] Step S13: Generate subtasks of the task to be processed based on the computational dependency relationship. The data units that can be executed in parallel in the subtasks are data units with non-strong dependencies.

[0038] Optionally, the strong dependency relationship can refer to the existence of a dependency relationship between data units that cannot be decoupled, while the weak dependency relationship can include data units that do not have a dependency relationship and data units that have a dependency relationship but can be decoupled.

[0039] Step S14: Perform a trial run on the subtask based on the combination of running parameters corresponding to the subtask to obtain the performance data of the execution node.

[0040] Optionally, the trial run may refer to the test run before the formal run of the subtask, and the execution node performance data includes the throughput, response latency and resource consumption data during the node trial run. The execution node may refer to the node used to execute the subtask.

[0041] Optionally, the combination of operating parameters includes: number of concurrent threads, message queue length, batch submission size, and connection pool size.

[0042] Optionally, conducting a trial run of the subtask based on the combination of operating parameters corresponding to the subtask to obtain execution node performance data may refer to conducting a trial run of a subset of the subtasks based on the combination of operating parameters corresponding to a subset of the subtasks to obtain the execution node performance data. For example, the subtasks may include 100 tasks, and only 10 of them may be tested.

[0043] Step S15: Determine the globally optimal combination of operating parameters based on the performance data of the execution node.

[0044] Optionally, determining the globally optimal combination of operating parameters based on the execution node performance data includes: determining the comprehensive efficiency value of the execution node based on the execution node performance data; and determining the globally optimal combination of operating parameters based on the comprehensive efficiency value.

[0045] Optionally, the overall efficiency value is expressed as:

[0046]

[0047] in This represents the overall efficiency value. Indicates the first weight. This indicates the throughput. Indicates the maximum throughput. Indicates the second weight. This indicates the response delay. Indicates the maximum response delay. Indicates the third weight. Indicates the number of CPU resources available. Indicates the total number of CPU resources. This can represent CPU utilization. The first weight, the second weight, and the third weight can be flexibly set according to actual conditions. This embodiment will not elaborate on this further. You can set the corresponding The lower limit restricts the amplitude of this ratio.

[0048] Step S16: Perform the operation processing on the subtask based on the globally optimal combination of operating parameters to obtain the task operation processing results.

[0049] As described above, the task processing method includes: acquiring a task to be processed, the task containing several data units; performing dependency analysis on the data units to determine their computational dependencies; generating subtasks of the task to be processed based on the computational dependencies, wherein the data units in the subtasks that can be executed in parallel are data units with non-strong dependencies; conducting trial runs of the subtasks based on the combination of running parameters corresponding to each subtask to obtain execution node performance data; determining the globally optimal combination of running parameters based on the execution node performance data; and processing the subtasks based on the globally optimal combination of running parameters to obtain task processing results.

[0050] In the task processing method, subtasks of the task to be processed are generated based on the computational dependencies. The data units of the subtasks that can be executed in parallel are data units with non-strong dependencies. The subtasks are processed based on the globally optimal combination of running parameters to obtain the task processing results, which can improve the data processing efficiency during the task operation.

[0051] Figure 3 This is a flowchart illustrating a method for performing dependency analysis on the data units according to an embodiment of this disclosure to obtain the computational dependencies of the data units. For example... Figure 3 As shown, performing dependency analysis on the data unit to obtain its computational dependencies includes:

[0052] Step S21: Parse the data unit to obtain the dependency constraints of the data unit.

[0053] Step S22: Construct a directed acyclic graph associated with the data unit based on the dependency constraints. The directed acyclic graph is used to describe the dependency topology between data units.

[0054] Optionally, the directed acyclic graph can be a graph structure composed of nodes and directed edges, and there are no loops in the entire graph. The nodes can be the data units, and the directed edges can be established according to the dependency constraints between the data units. This embodiment will not elaborate further on this.

[0055] Optionally, the method for constructing a directed acyclic graph associated with the data unit based on the dependency constraints includes: for input-output dependency constraints, if the output of the first data unit is the input of the second data unit, then a directed edge is established from the first data unit to the second data unit; for state change order dependency constraints, if the state change of the first data unit precedes that of the second data unit, then a directed edge is established from the first data unit to the second data unit; for transaction boundary dependency constraints, if the first data unit and the second data unit are located in the same transaction, and the execution order of the first data unit in the transaction precedes that of the second data unit, then a directed edge is established from the first data unit to the second data unit; and the directed acyclic graph is generated based on the established directed edges.

[0056] Step S23: Determine the computational dependencies of the data units based on the directed acyclic graph.

[0057] Optionally, the computational dependencies include strong dependencies and weak dependencies, and the dependencies between data units at the same level in the directed acyclic graph that have no cross dependencies are weak dependencies.

[0058] Figure 4 This is a flowchart illustrating an embodiment of the present disclosure whereby a trial run is performed on the subtask based on the combination of running parameters corresponding to the subtask to obtain performance data of the execution node. For example... Figure 4 As shown, the subtask is tested based on the combination of running parameters corresponding to the subtask to obtain the performance data of the execution node, including:

[0059] Step S31: Extract the subtasks to obtain the extracted subtasks.

[0060] Step S32: Obtain the combination of running parameters corresponding to the extracted subtasks.

[0061] Step S33: Based on the combination of running parameters corresponding to the extracted subtasks, perform a trial run on the extracted subtasks to obtain the performance data of the execution node.

[0062] Figure 5 This is a flowchart illustrating how, according to an embodiment of this disclosure, the subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing results. Figure 5As shown, the subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing results, including:

[0063] Step S1: Write the fragmented data of the subtask received by the execution node into the source table.

[0064] Step S2: Run the subtask based on the globally optimal combination of running parameters to obtain the task running results.

[0065] Optionally, the task execution result may include processing result data, which may refer to the final data output after the task is completed.

[0066] Step S3: Write the task execution results into an intermediate table.

[0067] Step S4: Verify the task execution results in the intermediate table to obtain a verification result, which is either verification passed or verification failed.

[0068] Optionally, the method for verifying the task execution results in the intermediate table to obtain the verification results includes: performing distributed verification on the task execution results in the intermediate table to obtain the verification results. The distributed verification may include verification of the number of records, hash value verification, association integrity verification, etc. The verification passing may mean that all verifications pass, and the verification failing may mean that there are verifications that fail.

[0069] Optionally, the source table can store the upstream pushed data 1:1 as is, without any processing, modification, or cleaning of the original data. Its core function is to completely retain the original source data for end-to-end business traceability, problem location, and original data reconciliation. The intermediate table carries all data cleaning, transformation, calculation, summarization, and logical processing work. All business operations are completed in this table. Its core function is to allow rollback based on the intermediate table when processing logic verification fails or data is abnormal, without polluting production. It also facilitates the individual verification of the correctness of each step of the processing logic. The target table can only write the final compliant result after verification and processing, serving as the official production data table for external use. Its core function is to physically isolate the data processing process from the final result, preventing processing errors and dirty data from directly polluting the official target table and ensuring the stability of production data.

[0070] Optionally, the record count verification can refer to the process of verifying whether the total number of records in the intermediate table is consistent with the number of users after deduplication in the source table. The hash value verification can refer to the process of calculating the hash value of the key field in the intermediate table and comparing it with the baseline hash value of the key field. The association integrity verification can refer to the process of whether all the key fields in the intermediate table can be found in the source table to ensure data integrity. The key fields can be fields such as user identifiers, and the baseline hash value can be a preset value or come from the source table.

[0071] Step S5: If the verification result is that the verification is passed, write the task execution processing result into the target table; otherwise, clear the intermediate table and return to step S2.

[0072] Optionally, steps S1 to S5 can be executed and returned through transactions, which will not be elaborated further in this embodiment.

[0073] Figure 6 This is a flowchart illustrating how, according to an embodiment of this disclosure, the subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing results. Figure 6 As shown, the subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing results, including:

[0074] Step S41: Based on the preset basic timeout time, the preset adjustment coefficient, and the data volume of the subtask, obtain the timeout threshold corresponding to the subtask.

[0075] Optionally, the preset basic timeout time and preset adjustment coefficient can be flexibly set according to the actual situation, and this embodiment does not explicitly limit this.

[0076] Optionally, the timeout threshold can be expressed as:

[0077] in, The timeout threshold is... The preset base timeout period, The preset adjustment coefficient is... This indicates the amount of data in the subtask. This represents the historical average amount of data per shard.

[0078] Step S42: Perform the operation processing on the subtask based on the globally optimal combination of running parameters and the timeout threshold to obtain the task operation processing result.

[0079] Step S43: During the subtask operation process, when the processing time of the subtask exceeds the timeout threshold, the subtask is automatically retried several times based on a preset waiting interval to obtain the retry processing result.

[0080] Optionally, the preset waiting interval can be the waiting interval for the first automatic retry, and the waiting interval for the nth retry can be expressed as:

[0081]

[0082] in, This represents the waiting interval for the nth retry. This indicates the preset waiting interval.

[0083] In one embodiment of this disclosure, a distributed batch processing cluster consisting of one management node and ten execution nodes is deployed, along with a distributed database, to process 10 million pieces of structured data in a batch processing task. The structured data is naturally partitioned according to associated serial numbers and has no dependencies. The task processing method includes:

[0084] S1) Task splitting and dependency decoupling steps: After receiving batch processing tasks, the management node performs dependency analysis on the data units contained in the task; identifies the computational dependencies between data units, and divides data units without dependencies or whose dependencies can be decoupled into the same subtask fragment, generating several subtasks that can be executed in parallel. Detailed implementation of the steps:

[0085] The management node parses the business transaction data processing logic and identifies the following dependency constraints: sequential dependency within the same related transaction, where multiple transactions within the same related transaction on the same day need to be summarized in timestamp order; no dependency across related transactions, where calculations between different transactions are independent of each other.

[0086] Based on the above constraints, a DAG (Directed Acyclic Graph) topology is constructed. A node is a data processing unit for a single pipeline; a directed edge represents the temporal dependency of transactions within the same pipeline; the topology hierarchy is marked as a serial execution group according to the associated pipeline number (within the same group, execution is carried out in the order of the DAG hierarchy); fragments without cross dependencies are marked as parallel execution groups (fragments within the group are simultaneously distributed to different execution nodes).

[0087] The 10 million data entries are divided into 100 subtask shards, St1 to St100, based on the primary key range. The data volume of each shard is as follows: St1[1-100,000], St2[100,001-200,000], ..., St100[9,900,001-10,000,000]. The hash algorithm NodeID=Hash(Sti)mod10 is used to distribute the shards to 10 execution nodes.

[0088] S2) Dynamic Resource Optimization and Load Balancing Steps: The management node collects performance data from the execution nodes during trial operation, dynamically calculates the optimal resource configuration, and distributes it uniformly to achieve balanced scheduling of resources and load. Implementation details:

[0089] Each execution node extracts a single subtask fragment (e.g., St1, St11, St21, ..., St91) as sample data; eight sets of differentiated parameter combinations Pa1 to Pa8 are configured, corresponding to different thread concurrency, message queue length, and batch submission size, respectively. The differentiated settings of the eight sets of differentiated parameter combinations Pa1 to Pa8 are shown in Table 1 below: Table 1

[0090] The management node calculates a comprehensive efficiency score based on throughput (records / s), average response latency (ms), and CPU utilization (%), and selects the parameter combination with the highest score as the globally optimal template; the management node collects trial operation data and calculates the score according to the following formula:

[0091]

[0092] The trial operation results are shown in Table 2 below: Table 2

[0093] Pa3 (32 concurrent threads, 2000 message queue length, 5000 batch submissions, 64 connection pools) received the highest overall score and was marked as the globally optimal runtime parameter template. During actual runtime, all nodes uniformly applied the Pa3 parameters and dynamically adjusted task allocation weights based on real-time load.

[0094] S3) High-availability parallel processing step: Each execution node combines data redundancy, distributed verification, and replica recovery mechanisms to build a high-availability architecture and process subtasks in parallel. Step implementation details:

[0095] After receiving the sharded data, the execution node writes it to the source table (table name: source_batch_001) as is; after processing by business logic, the result is written to the intermediate table (table name: mid_batch_001), and the database log is recorded synchronously; after passing distributed verification (record count verification, hash value verification, and association integrity verification), it is loaded into the target table (table name: target_batch_001) through a two-phase commit; if an intermediate processing exception occurs, the `truncate table mid_batch_001` is executed for a quick rollback, and the source table data is reloaded.

[0096] S4) Anomaly isolation and automatic recovery steps: Each subtask shard is configured with a dynamic timeout threshold and an automatic retry mechanism. For each task shard, the system configures a timeout threshold that is dynamically adjusted based on the task type. For shards that fail to complete within the timeout period, multiple retries are automatically performed. If a retry fails, the shard is marked as abnormal and an operation and maintenance notification is triggered. This process does not interfere with the normal execution flow of other shards. Implementation details:

[0097] The subtask shard configuration base timeout T_base=300 seconds, adjustment coefficient σ=0.2; for a shard with 150,000 data points (exceeding the average by 50%), the dynamic timeout threshold is adjusted to: T_timeout=300*(1+0.2*1.5)=390 seconds; automatic retry after timeout, using exponential backoff: 30-second interval for the first retry, 60-second interval for the second retry, and 120-second interval for the third retry; after 3 failed retries, the shard status is marked as "abnormal", and an operation and maintenance alarm is triggered through the message queue, while the remaining 99 shards continue to execute normally.

[0098] The dynamic timeout thresholds and automatic retry mechanisms for each subtask segment are configured as shown in Table 3 below: Table 3

[0099] Technical effectiveness verification:

[0100] Tests showed that, compared to the original centralized batch processing method, the batch processing time for 10 million data entries was reduced from 2 hours to 30 minutes, improving efficiency by 75%; system throughput increased from 1389 records / s to 5556 records / s, an improvement of approximately 4 times; the average CPU utilization of the execution node increased from 35% to 72%, and resource utilization increased by 37%; and in the simulated single-node failure scenario, the task failure recovery time was shortened from full rollback (>2 hours) to shard-level retry (<5 minutes).

[0101] The task processing method has the following effects:

[0102] This embodiment employs a multi-algorithm fusion scheduling strategy to achieve balanced multi-node allocation and parallel processing of the decomposed tasks. Targeting the multi-node architecture characteristics of domestic distributed databases, it dynamically adapts to the resource requirements of different tasks. Parallel processing collaboration avoids overload or idleness of a single node, improving hardware resource (CPU, memory, I / O bandwidth) utilization by over 50%. Simultaneously, the task parallel processing mechanism reduces the processing time for massive amounts of data by 40%-60%. In single-node failure scenarios, task failure recovery time is shortened from full rollback to shard-level retry, significantly outperforming traditional single-node serial or simple sharding processing modes.

[0103] During task execution, transaction management is implemented through a consensus protocol, and a full-link traceable transaction execution system is constructed by combining the three-layer table structure design of "source-intermediate-target". The source table stores original data, the intermediate table is used for logical processing and verification, and the target table serves as the final production data carrier. When anomalies such as logical exceptions or node failures occur during data processing, the problematic link can be quickly identified based on the state of the intermediate table, and the processing flow can be restored through transaction rollback or rerun mechanisms, which greatly reduces the difficulty of problem handling and avoids dirty writes to the target table data.

[0104] The execution nodes support horizontal elastic scaling. After a new node is registered, it is automatically included in the scheduling scope, and the overall throughput of the system can increase linearly with the number of nodes. Task states are recorded through distributed shared storage, and failed subtasks can be automatically retried or transferred to healthy nodes, eliminating the impact of single-point failures on the overall progress of batch processing.

[0105] The protection scope of the task processing method according to the embodiments of the present disclosure is not limited to the step execution order listed in this embodiment. Any solution implemented by adding, deleting, or replacing steps of the prior art based on the principles of the present disclosure shall fall within the protection scope of the present disclosure.

[0106] Figure 7 is a structural schematic diagram illustrating a task processing apparatus according to an embodiment of the present disclosure. As Figure 7 shown, the task processing apparatus 700 includes:

[0107] a task acquisition module 710, configured to acquire a task to be processed, where the task to be processed includes a plurality of data units.

[0108] a dependency analysis module 720, configured to perform dependency relationship analysis on the data units to determine computational dependency relationships of the data units.

[0109] a task generation module 730, configured to generate subtasks of the task to be processed based on the computational dependency relationships, where data units of subtasks that can be executed in parallel in the subtasks have a non-strong dependency relationship.

[0110] a task operation module 740, configured to perform trial operation on the subtasks based on operation parameter combinations corresponding to the subtasks, so as to acquire performance data of execution nodes.

[0111] a parameter determination module 750, configured to determine a globally optimal operation parameter combination based on the performance data of the execution nodes.

[0112] a task processing module 760, configured to perform operation processing on the subtasks based on the globally optimal operation parameter combination, so as to acquire a task processing result.

[0113] In the task processing apparatus 700, the task acquisition module 710 and Figure 2 The steps S11, S12, S13, S14, S15, and S16 are all corresponding to each other. The dependency analysis module 720 corresponds to step S12, S13 corresponds to step S13, S14 corresponds to step S14, S15 corresponds to step S15, and S16 corresponds to step S16.

[0114] In the several embodiments provided in this disclosure, it should be understood that the disclosed apparatus or method can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules / units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or modules or units may be electrical, mechanical, or other forms.

[0115] The modules / units described as separate components may or may not be physically separate. The components shown as modules / units may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules / units can be selected to achieve the objectives of the embodiments of this disclosure, depending on actual needs. For example, the functional modules / units in the various embodiments of this disclosure may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.

[0116] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0117] This embodiment provides an electronic device, which includes a memory and a processor coupled to the memory and configured to execute... Figure 2 The task processing method shown.

[0118] This disclosure also provides a computer-readable storage medium. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof. The storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state drive (SSD)).

[0119] This disclosure also provides a computer program product comprising one or more computer instructions. When the computer instructions are loaded and executed on a computing device, all or part of the processes or functions described in this disclosure are generated. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0120] When the computer program product is executed by a computer, the computer performs the method described in the foregoing method embodiments. The computer program product can be a software installation package; when the foregoing method is required, the computer program product can be downloaded and executed on the computer.

[0121] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.

[0122] The above embodiments are merely illustrative of the principles and effects of this disclosure and are not intended to limit this disclosure. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this disclosure. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this disclosure should still be covered by the claims of this disclosure.

Claims

1. A task processing method, characterized in that, include: Obtain the task to be processed, which contains several data units; Dependency analysis is performed on the data units to determine their computational dependencies; Subtasks of the task to be processed are generated based on the computational dependencies, and the data units that can be executed in parallel in the subtasks are data units with non-strong dependencies. The subtask is tested based on the combination of running parameters corresponding to the subtask in order to obtain the performance data of the execution node. Determine the globally optimal combination of operating parameters based on the performance data of the execution nodes; The subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing results.

2. The task processing method according to claim 1, characterized in that, Dependency analysis is performed on the data units to determine their computational dependencies, including: Parse the data unit to obtain its dependency constraints; Based on the dependency constraints, a directed acyclic graph is constructed that is associated with the data unit. The directed acyclic graph is used to describe the dependency topology between the data units. The computational dependencies of the data units are determined based on the directed acyclic graph.

3. The task processing method according to claim 1, characterized in that, The subtask is tested based on the combination of running parameters corresponding to the subtask to obtain execution node performance data, including: The subtasks are extracted to obtain the extracted subtasks. Obtain the combination of running parameters corresponding to the extracted subtasks; The extracted subtasks are tested based on the combination of running parameters corresponding to the extracted subtasks in order to obtain the performance data of the execution nodes.

4. The task processing method according to claim 1, characterized in that, The subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing results, including: Step S1: Write the fragmented data of the subtask received by the execution node into the source table; Step S2: Run the subtask based on the globally optimal combination of running parameters to obtain the task running results; Step S3: Write the task execution results into an intermediate table; Step S4: Verify the task execution results in the intermediate table to obtain a verification result, which is either verification passed or verification failed. Step S5: If the verification result is that the verification is passed, write the task execution processing result into the target table; otherwise, clear the intermediate table and return to step S2.

5. The task processing method according to claim 1, characterized in that, The subtask is processed based on the globally optimal combination of operating parameters to obtain the task processing results, including: Based on the preset base timeout time, the preset adjustment coefficient, and the data volume of the subtask, obtain the timeout threshold corresponding to the subtask; The subtask is processed based on the globally optimal combination of running parameters and the timeout threshold to obtain the task processing result. During the subtask execution process, when the processing time of the subtask exceeds the timeout threshold, the subtask is automatically retried several times based on a preset waiting interval to obtain the retry result.

6. The task processing method according to claim 1, characterized in that, Determining the globally optimal combination of operating parameters based on the execution node performance data includes: The performance data of the execution node includes throughput, response latency, and resource consumption data during the node trial operation. The overall efficiency value of the execution node is determined based on the execution node performance data; The optimal combination of operating parameters is determined based on the comprehensive efficiency value.

7. The task processing method according to claim 6, characterized in that, The overall efficiency value is expressed as: in This represents the overall efficiency value. Indicates the first weight. This indicates the throughput. Indicates the maximum throughput. Indicates the second weight. This indicates the response delay. Indicates the maximum response delay. Indicates the third weight. Indicates the number of CPU resources available. This indicates the total number of CPU resources.

8. A task processing device, characterized in that, include: The task acquisition module is used to acquire tasks to be processed, wherein the tasks to be processed contain several data units; The dependency analysis module is used to perform dependency analysis on the data units to determine the computational dependencies of the data units; The task generation module is used to generate subtasks of the task to be processed based on the computational dependency relationship, wherein the data units that can be executed in parallel in the subtasks are data units with non-strong dependencies. The task execution module is used to run the subtasks on a trial basis based on the combination of running parameters corresponding to the subtasks, so as to obtain the performance data of the execution nodes; The parameter determination module is used to determine the globally optimal combination of operating parameters based on the performance data of the execution node; The task processing module is used to process the subtasks based on the globally optimal combination of running parameters in order to obtain the task processing results.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the task processing method according to any one of claims 1-7.

10. An electronic device, characterized in that, include: Memory; A processor, coupled to the memory, is configured to perform the task processing method according to any one of claims 1-7.