Task processing method and device, computer equipment and storage medium

By parsing parallel conditions and decomposing SQL loop tasks into multiple blocks, the parallel execution engine improves the task processing efficiency of the database system, solving the problem of low processing efficiency of loop structure tasks in existing technologies.

CN121900910APending Publication Date: 2026-04-21JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JINZHUAN INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-01-09
Publication Date
2026-04-21

Smart Images

  • Figure CN121900910A_ABST
    Figure CN121900910A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a task processing method and device, computer equipment and a storage medium, and the method comprises the steps: receiving an SQL request for a target task sent by a client, carrying out the content analysis of the SQL request, and extracting an OR loop structure in the SQL request; analyzing SQL statements in the OR loop structure, and judging whether the SQL statements meet parallel conditions or not; when the SQL statement meets the parallel condition, decomposing a loop task in the OR loop structure into a plurality of task blocks, and distributing the task blocks to a working thread in a parallel execution engine for execution; task execution results of all the working threads are collected, all the task execution results are summarized, a task processing result of the target task is obtained, and the task processing result is returned to the client side; therefore, the processing efficiency of the target task can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and more specifically to a task processing method, apparatus, computer equipment, and computer-readable storage medium. Background Technology

[0002] Currently, in modern Database Management Systems (DBMS), SQL (Structured Query Language) is the standard language for managing and manipulating databases. SQL requests are typically sent by client applications to the database server to perform various database operations, such as querying, inserting, updating, and deleting data. With the continuous growth of data volume and the increasing complexity of business needs, the existing single-threaded approach to handling SQL requests is gradually failing to meet the demands for high performance and efficiency. Currently, most existing database systems use single-threaded or simple multi-threaded models to handle SQL requests. However, these methods are inefficient when processing complex SQL statements, especially tasks containing loop structures (such as FOR loops), and cannot meet user needs.

[0003] Therefore, how to provide a task processing method, apparatus, computer device, and computer-readable storage medium that can effectively improve the processing efficiency of the target task is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a task processing method, apparatus, computer device and computer-readable storage medium, which aims to solve the problem of how to effectively improve the processing efficiency of target tasks.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a task processing method, comprising: Receive the SQL request sent by the client for the target task, parse the content of the SQL request, and extract the FOR loop structure; Analyze the SQL statements within the FOR loop structure to determine whether the SQL statements satisfy the parallelism condition; When the SQL statement satisfies the parallel condition, the loop task within the FOR loop structure is decomposed into multiple task blocks, and the task blocks are distributed to worker threads in the parallel execution engine for execution. Collect the task execution results of each worker thread, summarize all the task execution results to obtain the task processing result of the target task, and return the task processing result to the client.

[0006] In a second aspect, the present invention provides a task processing apparatus, comprising: The receiving module is used to receive SQL requests sent by the client for the target task, parse the content of the SQL requests, and extract the FOR loop structure. The judgment module is used to analyze the SQL statement within the FOR loop structure and determine whether the SQL statement satisfies the parallel condition. The decomposition module is used to decompose the loop task within the FOR loop structure into multiple task blocks when the SQL statement satisfies the parallel condition, and distribute the task blocks to worker threads in the parallel execution engine for execution. The collection module is used to collect the task execution results of each of the worker threads, summarize all the task execution results to obtain the task processing result of the target task, and return the task processing result to the client.

[0007] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the task processing method described above.

[0008] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the task processing method described above.

[0009] Compared to existing technologies, this invention provides a task processing method, apparatus, computer device, and computer-readable storage medium. The method involves receiving an SQL request for a target task from a client, parsing the SQL request to extract the FOR loop structure, analyzing the SQL statements within the FOR loop structure to determine if they meet parallelism conditions, decomposing the loop task within the FOR loop structure into multiple task blocks when the SQL statements meet the parallelism conditions, distributing the task blocks to worker threads in a parallel execution engine for execution, collecting the task execution results from each worker thread, summarizing all the task execution results to obtain the task processing result for the target task, and returning the task processing result to the client. Therefore, this invention can effectively improve the processing efficiency of the target task. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of the application environment of a task processing method provided in an embodiment of the present invention.

[0012] Figure 2 This is a flowchart illustrating a task processing method according to an embodiment of the present invention.

[0013] Figure 3 This is a schematic diagram of a program module of a task processing device provided in an embodiment of the present invention.

[0014] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention.

[0015] Figure 5 This is another structural schematic diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0018] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0019] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."

[0020] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.

[0021] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0022] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0023] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0024] An embodiment of the present invention provides a task processing method that can be applied to, for example... Figure 1In the application environment shown, the client and server communicate via a network. The client includes, but is not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0025] Please see Figure 2 An embodiment of the present invention provides a task processing method, wherein the method includes the following steps: S100: Receive an SQL request for the target task sent by the client, parse the content of the SQL request, and extract the FOR loop structure therein; S200. Analyze the SQL statement within the FOR loop structure and determine whether the SQL statement satisfies the parallel condition. S300. When the SQL statement satisfies the parallel condition, the loop task in the FOR loop structure is decomposed into multiple task blocks, and the task blocks are distributed to the worker threads in the parallel execution engine for execution. S400. Collect the task execution results of each of the worker threads, summarize all the task execution results to obtain the task processing result of the target task, and return the task processing result to the client.

[0026] In practical implementation, the task processing method of this embodiment achieves efficient processing of the target task through a series of innovative steps, significantly improving processing efficiency. First, in step S100, by receiving the SQL request sent by the client and parsing the FOR loop structure within it, this method can accurately identify the parallelizable task portion. Next, in step S200, parallel condition judgment is performed on the SQL statements within the loop. This crucial step ensures that parallel processing only occurs when conditions such as data independence and transaction consistency are met, thereby avoiding data conflicts and inconsistencies. When the parallel conditions are met, step S300 decomposes the loop task into multiple task blocks and assigns them to multiple worker threads in the parallel execution engine, fully utilizing the computing power of multi-core processors to achieve parallel execution of the task and significantly reduce the total execution time. Finally, in step S400, by efficiently collecting and summarizing the execution results of each worker thread and returning the final task processing result to the client, the integrity and accuracy of the entire processing process are ensured. This end-to-end optimization, from task decomposition to parallel execution and result aggregation, enables the method to significantly improve the processing efficiency of the target task while ensuring data consistency and transaction integrity. It is particularly suitable for handling complex SQL tasks containing a large number of loop operations, providing an effective solution for high-performance task processing in modern database systems.

[0027] Furthermore, in one embodiment, the task processing method, wherein receiving an SQL request for a target task sent by a client, parsing the SQL request, and extracting the FOR loop structure therein, specifically includes: Obtain the SQL request for the target task input by the target user through the client, and perform format validation and integrity checks on the SQL request; If both format validation and integrity checks pass, the content of the SQL request is parsed, and the FOR loop structure in the SQL request is obtained based on the parsing results. If the format validation and / or integrity check fails, a prompt message will be returned.

[0028] Furthermore, in the aforementioned task processing method, the step of obtaining the SQL request for the target task input by the target user through the client, and performing format validation and integrity checks on the SQL request, specifically includes: The client responds to the interface opening command initiated by the target user and enters the task processing interface; On the task processing interface, at least one authentication method selected from biometrics, dynamic verification code, or digital certificate is used to verify the identity information of the target user. When the identity information of the target user is verified, the SQL request for the target task input by the target user is received through the task processing interface, and the SQL request is validated for format and integrity.

[0029] In practice, the specific implementation process of this embodiment is roughly as follows: 1. Enable interface responsiveness: The client application receives a command from the target user to open the interface, such as when the user clicks the "Task Processing" button.

[0030] The client responds to the instruction, loads and displays the task processing interface, and provides the user with a text box or editor to enter SQL requests.

[0031] 2. User authentication: The task processing interface provides users with at least one authentication method, such as biometrics, dynamic verification code, or digital certificate.

[0032] Users select and complete the corresponding identity verification operation, such as entering a fingerprint, entering a verification code, or uploading a digital certificate.

[0033] The system verifies the identity information provided by the user and determines whether the verification is successful.

[0034] 3. Receiving SQL requests: Once the user's identity information is verified, the task processing interface receives the SQL request entered by the user for the target task.

[0035] 4. Format validation and integrity check: Perform format validation on received SQL requests, checking whether the SQL statements conform to syntax rules, such as whether there are spelling errors or missing keywords.

[0036] Perform an integrity check on the SQL request to ensure that it contains necessary information, such as whether the loop structure is complete and whether the loop variable is defined.

[0037] If both the format validation and integrity check pass, proceed to the next step; otherwise, return a message to the user explaining the reason for the validation failure.

[0038] 5. Parse the SQL request content: If both format validation and integrity checks pass, the SQL request content is parsed, and the FOR loop structure is extracted.

[0039] Using techniques such as SQL parsers or regular expressions, the key parts of the FOR loop can be identified, including the loop variable, the start value, the end value, the step size, and the SQL statements within the loop body.

[0040] 6. Return a prompt message (if the verification fails). If a problem is found in the SQL request during format validation and / or integrity checks, a corresponding message is generated and returned to the user through the task processing interface.

[0041] The error message should clearly indicate the problem and help users modify and resubmit the SQL request.

[0042] The above steps complete the entire process of receiving SQL requests from the client, authenticating the user, validating and checking the format and integrity of the SQL request, parsing the SQL request, and extracting the FOR loop structure. If any problems are found during the process, a prompt message can be promptly returned to the user to ensure that the user can correctly submit a valid SQL request.

[0043] Furthermore, in one embodiment, the task processing method, wherein analyzing the SQL statement within the FOR loop structure and determining whether the SQL statement satisfies the parallel condition, specifically includes: Extract all SQL statements from the FOR loop structure and use graph algorithms to construct a data dependency graph between the SQL statements; Based on the data dependency graph, the dependency relationships between the SQL statements are evaluated, and data dependency evaluation results are generated. Based on the data dependency evaluation results, determine whether each of the SQL statements meets the parallelism condition.

[0044] Furthermore, in the aforementioned task processing method, the step of decomposing the loop task within the FOR loop structure into multiple task blocks when the SQL statement satisfies the parallel condition, and distributing the task blocks to worker threads in the parallel execution engine for execution, specifically includes: When the SQL statement satisfies the parallel condition, the parallelism information of the loop tasks within the FOR loop structure is determined; wherein, the parallelism information includes the number of threads and the task block size; Based on the parallelism information, the loop task is decomposed into multiple task blocks; Each task block is distributed to the corresponding worker thread in the parallel execution engine for independent execution.

[0045] In practice, the specific implementation process of this embodiment is roughly as follows: 1. Extract the SQL statement: Extract all SQL statements from the FOR loop structure, including INSERT, UPDATE, and DELETE operations within the loop body.

[0046] Use techniques such as SQL parsers or regular expressions to identify and extract each SQL statement within a loop.

[0047] 2. Construct a data dependency graph: We use graph algorithms to construct a data dependency graph between the SQL statements. The data dependency graph is a directed graph where nodes represent SQL statements and edges represent the dependencies between statements.

[0048] Analyze the data tables and fields involved in each SQL statement to determine their dependencies.

[0049] 3. Assess dependencies: Based on the data dependency graph, evaluate the dependencies between SQL statements and check for data conflicts or dependencies, such as whether multiple SQL statements operate on the same data record or whether there are sequential dependencies.

[0050] Generate data dependency assessment results and record the dependency status of each SQL statement.

[0051] 4. Determine the parallel conditions: Based on the data dependency assessment results, determine whether each SQL statement meets the parallelism conditions. Parallelism conditions include data independence, transaction consistency, and the feasibility of resource allocation.

[0052] If there are no data dependencies between SQL statements and the requirements of transaction consistency and resource allocation are met, then these statements are considered to be able to be executed in parallel.

[0053] 5. Determine parallelism information: When the SQL statement meets the parallelism condition, determine the parallelism information of the loop tasks within the FOR loop structure, including the number of threads and the task block size.

[0054] The parallelism information is dynamically determined based on the system's resources (such as the number of CPU cores and memory capacity) and the number of loop iterations.

[0055] 6. Task breakdown and distribution: Based on parallelism information, the recurring task is decomposed into multiple task blocks, each containing a certain number of loop iterations.

[0056] Each task block is distributed to the corresponding worker thread (which is a parallel thread) in the parallel execution engine for independent execution.

[0057] The above steps complete the entire process from extracting SQL statements, constructing a data dependency graph, evaluating dependencies, determining parallelism conditions, to task decomposition and distribution. These steps ensure that, under the condition of meeting parallelism requirements, the recurring tasks can be executed efficiently in parallel, thereby significantly improving the processing efficiency of the target task.

[0058] Further, in one embodiment, the task processing method, wherein collecting the task execution results of each of the worker threads, summarizing all the task execution results to obtain the task processing result of the target task, and returning the task processing result to the client, specifically includes: Collect the task execution results generated when each of the worker threads executes its corresponding task block; The collected task execution results are merged, deduplicated, and sorted to generate the task processing result of the target task. Based on the client's configuration information, the task processing result is formatted, and the formatted task processing result is returned to the client.

[0059] Furthermore, in the aforementioned task processing method, the step of formatting the task processing result according to the client's configuration information and returning the formatted task processing result to the client specifically includes: Obtain the configuration information for the task processing result from the client; The task processing results are formatted according to the configuration information. The formatted task processing result is returned to the client and displayed to the target user on the client according to a preset result display strategy.

[0060] In practice, the specific implementation process of this embodiment is roughly as follows: 1. Initialize the result collector: A thread-safe result collector can be initialized to receive the task execution results of each worker thread (i.e., parallel thread). The result collector can be a queue or a buffer.

[0061] 2. Asynchronous collection of results: After each worker thread completes the execution of its task block, it asynchronously sends the execution results to the result collector. The result collector is responsible for receiving and temporarily storing these results.

[0062] 3. Summary of Results: After all worker threads have completed their tasks, the results of all tasks are retrieved from the result collector and summarized to generate the task processing result for the target task. The summarization process includes data merging, deduplication, and sorting.

[0063] 4. Obtain client configuration information: Extract configuration information from client requests. This information may include data format (such as JSON, XML, CSV, etc.), data encoding (such as UTF8, ASCII, etc.), compression options (such as GZIP, Brotli, etc.), and other specific client requirements.

[0064] 5. Formatting process: Based on the client configuration information, the task processing results are formatted. For example, if the client requests JSON format, the result is converted to JSON; if it requests XML format, it is converted to XML.

[0065] 6. Return and display the results: The formatted task processing results are returned to the client and displayed to the target user on the client according to a preset result display strategy. The display strategy may include pagination, sorting, filtering, etc.

[0066] The above steps complete the entire process from collecting task execution results, summarizing results, obtaining client configuration information, formatting task processing results, to returning and displaying the results. These steps ensure that task processing results are efficiently collected, processed, and returned to the client, and are appropriately formatted and displayed according to the client's configuration information.

[0067] As can be seen from the above method embodiments, the task processing method provided by the present invention includes: receiving an SQL request for a target task sent by a client; parsing the content of the SQL request and extracting the FOR loop structure therein; analyzing the SQL statement within the FOR loop structure and determining whether the SQL statement satisfies the parallel condition; when the SQL statement satisfies the parallel condition, decomposing the loop task within the FOR loop structure into multiple task blocks and distributing the task blocks to worker threads in the parallel execution engine for execution; collecting the task execution results of each worker thread, summarizing all the task execution results to obtain the task processing result of the target task, and returning the task processing result to the client. Thus, the method of the present invention can effectively improve the processing efficiency of the target task.

[0068] It should be understood that although this application provides the method operation steps as described in the embodiments or flowcharts, conventional or non-inventive labor may include more or fewer operation steps, and these operation steps are not necessarily executed sequentially according to the order of the embodiments or flowcharts. The order of steps listed in the embodiments or flowcharts is merely one way of executing many steps and does not represent the only execution order. It should be noted that there is no necessary sequential order between the above steps. Those skilled in the art can understand from the description of the embodiments of the present invention that the above steps may have different execution orders in different embodiments, that is, they may be executed in parallel or in exchange, etc. Moreover, at least some steps in the embodiments or flowcharts may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be executed in turn, alternately, or synchronously with other steps or at least a part of the sub-steps or stages of other steps.

[0069] Based on the above method embodiments, please refer to Figure 3 Another embodiment of the present invention also provides a task processing apparatus, wherein the apparatus includes: The receiving module 11 is used to receive SQL requests sent by the client for the target task, parse the content of the SQL requests, and extract the FOR loop structure therein. The judgment module 12 is used to analyze the SQL statement in the FOR loop structure and determine whether the SQL statement satisfies the parallel condition. The decomposition module 13 is used to decompose the loop task in the FOR loop structure into multiple task blocks when the SQL statement satisfies the parallel condition, and distribute the task blocks to the worker threads in the parallel execution engine for execution. The collection module 14 is used to collect the task execution results of each of the worker threads, summarize all the task execution results to obtain the task processing result of the target task, and return the task processing result to the client.

[0070] Furthermore, in one embodiment, the task processing apparatus, wherein receiving the SQL request for the target task sent by the client, parsing the SQL request, and extracting the FOR loop structure therein, specifically includes: Obtain the SQL request for the target task input by the target user through the client, and perform format validation and integrity checks on the SQL request; If both format validation and integrity checks pass, the content of the SQL request is parsed, and the FOR loop structure in the SQL request is obtained based on the parsing results. If the format validation and / or integrity check fails, a prompt message will be returned.

[0071] Furthermore, in the task processing device, the step of acquiring the SQL request for the target task input by the target user through the client, and performing format validation and integrity checks on the SQL request, specifically includes: The client responds to the interface opening command initiated by the target user and enters the task processing interface; On the task processing interface, at least one authentication method selected from biometrics, dynamic verification code, or digital certificate is used to verify the identity information of the target user. When the identity information of the target user is verified, the SQL request for the target task input by the target user is received through the task processing interface, and the SQL request is validated for format and integrity.

[0072] Furthermore, in one embodiment, the task processing apparatus, wherein analyzing the SQL statement within the FOR loop structure and determining whether the SQL statement satisfies the parallel condition, specifically includes: Extract all SQL statements from the FOR loop structure and use graph algorithms to construct a data dependency graph between the SQL statements; Based on the data dependency graph, the dependency relationships between the SQL statements are evaluated, and data dependency evaluation results are generated. Based on the data dependency evaluation results, determine whether each of the SQL statements meets the parallelism condition.

[0073] Furthermore, in the aforementioned task processing device, the step of decomposing the loop task within the FOR loop structure into multiple task blocks when the SQL statement satisfies the parallel condition, and distributing the task blocks to worker threads in the parallel execution engine for execution, specifically includes: When the SQL statement satisfies the parallel condition, the parallelism information of the loop tasks within the FOR loop structure is determined; wherein, the parallelism information includes the number of threads and the task block size; Based on the parallelism information, the loop task is decomposed into multiple task blocks; Each task block is distributed to the corresponding worker thread in the parallel execution engine for independent execution.

[0074] Further, in one embodiment, the task processing device, wherein collecting the task execution results of each of the worker threads, summarizing all the task execution results to obtain the task processing result of the target task, and returning the task processing result to the client, specifically includes: Collect the task execution results generated when each of the worker threads executes its corresponding task block; The collected task execution results are merged, deduplicated, and sorted to generate the task processing result of the target task. Based on the client's configuration information, the task processing result is formatted, and the formatted task processing result is returned to the client.

[0075] Furthermore, in the task processing device, the step of formatting the task processing result according to the client's configuration information and returning the formatted task processing result to the client specifically includes: Obtain the configuration information for the task processing result from the client; The task processing results are formatted according to the configuration information. The formatted task processing result is returned to the client and displayed to the target user on the client according to a preset result display strategy.

[0076] It should be noted that, in the device embodiments of the present invention, the information interaction and execution process between the above modules are based on the same concept as in the method embodiments of the present invention. For details on their specific functions and the resulting technical effects, please refer to the aforementioned method embodiments section, which will not be repeated here.

[0077] Based on the above method embodiments, another embodiment of the present invention also provides a computer device, which can be a server, and its internal structure diagram can be as follows. Figure 4 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the functions or steps of the task processing method server-side as described in any of the above method embodiments.

[0078] Based on the above method embodiments, another embodiment of the present invention also provides a computer device, which can be a client, and its internal structure diagram can be as follows. Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements the functions or steps of the task processing method on the client side as described in any of the above method embodiments.

[0079] Those skilled in the art will understand that Figure 4 and Figure 5 The structural schematic diagram shown is only a schematic diagram of a part of the structure related to the present invention and does not constitute a limitation on the computer device on which the present invention is applied. The specific computer device may include more components than shown in the figure, or combine certain components, or have different component arrangements.

[0080] The processor referred to herein can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0081] The memory includes readable storage media, internal memory, etc., where internal memory can be the RAM of a computer device. Internal memory provides an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of the computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory can include both internal storage units and external storage devices of the computer device. The memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. The memory can also be used to temporarily store data that has been output or will be output.

[0082] Based on the above method embodiments, another embodiment of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the task processing method as described in any of the above method embodiments. The computer-readable storage medium may be non-volatile or volatile.

[0083] It should be noted that the functions or steps that can be achieved by the computer-readable storage medium or computer device, and the technical effects brought about by the functions / steps, can be referred to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0084] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc. The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0085] Those skilled in the art will understand that, for the sake of convenience and brevity, the embodiments of the device of the present invention are only illustrated by the division of the above-mentioned functional units and modules. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of the present invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0086] Those skilled in the art will 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, or a combination of computer software and electronic hardware. 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 implementations should not be considered beyond the scope of this invention.

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

[0088] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0089] It should be noted that if any software tools or components not belonging to this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use. The above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A task processing method, characterized in that, include: Receive the SQL request sent by the client for the target task, parse the content of the SQL request, and extract the FOR loop structure; Analyze the SQL statements within the FOR loop structure to determine whether the SQL statements satisfy the parallelism condition; When the SQL statement satisfies the parallel condition, the loop task within the FOR loop structure is decomposed into multiple task blocks, and the task blocks are distributed to worker threads in the parallel execution engine for execution. Collect the task execution results of each worker thread, summarize all the task execution results to obtain the task processing result of the target task, and return the task processing result to the client.

2. The task processing method according to claim 1, characterized in that, The receiving client sends an SQL request for the target task, and the SQL request is parsed to extract the FOR loop structure, including: Obtain the SQL request for the target task input by the target user through the client, and perform format validation and integrity checks on the SQL request; If both format validation and integrity checks pass, the content of the SQL request is parsed, and the FOR loop structure in the SQL request is obtained based on the parsing results. If the format validation and / or integrity check fails, a prompt message will be returned.

3. The task processing method according to claim 2, characterized in that, The step of obtaining the SQL request for the target task input by the target user through the client, and performing format validation and integrity checks on the SQL request, includes: The client responds to the interface opening command initiated by the target user and enters the task processing interface; On the task processing interface, at least one authentication method selected from biometrics, dynamic verification code, or digital certificate is used to verify the identity information of the target user. When the identity information of the target user is verified, the SQL request for the target task input by the target user is received through the task processing interface, and the SQL request is validated for format and integrity.

4. The task processing method according to claim 1, characterized in that, The analysis of the SQL statements within the FOR loop structure, and the determination of whether the SQL statements satisfy the parallelism condition, includes: Extract all SQL statements from the FOR loop structure and use graph algorithms to construct a data dependency graph between the SQL statements; Based on the data dependency graph, the dependency relationships between the SQL statements are evaluated, and data dependency evaluation results are generated. Based on the data dependency evaluation results, determine whether each of the SQL statements meets the parallelism condition.

5. The task processing method according to claim 1, characterized in that, When the SQL statement satisfies the parallel condition, the loop task within the FOR loop structure is decomposed into multiple task blocks, and the task blocks are distributed to worker threads in the parallel execution engine for execution, including: When the SQL statement satisfies the parallel condition, the parallelism information of the loop tasks within the FOR loop structure is determined; wherein, the parallelism information includes the number of threads and the task block size; Based on the parallelism information, the loop task is decomposed into multiple task blocks; Each task block is distributed to the corresponding worker thread in the parallel execution engine for independent execution.

6. The task processing method according to claim 1, characterized in that, The process of collecting the task execution results of each of the worker threads, summarizing all the task execution results to obtain the task processing result of the target task, and returning the task processing result to the client includes: Collect the task execution results generated when each of the worker threads executes its corresponding task block; The collected task execution results are merged, deduplicated, and sorted to generate the task processing result of the target task. Based on the client's configuration information, the task processing result is formatted, and the formatted task processing result is returned to the client.

7. The task processing method according to claim 6, characterized in that, The step of formatting the task processing result according to the client's configuration information and returning the formatted task processing result to the client includes: Obtain the configuration information for the task processing result from the client; The task processing results are formatted according to the configuration information. The formatted task processing result is returned to the client and displayed to the target user on the client according to a preset result display strategy.

8. A task processing device, characterized in that, include: The receiving module is used to receive SQL requests sent by the client for the target task, parse the content of the SQL requests, and extract the FOR loop structure. The judgment module is used to analyze the SQL statement within the FOR loop structure and determine whether the SQL statement satisfies the parallel condition. The decomposition module is used to decompose the loop task within the FOR loop structure into multiple task blocks when the SQL statement satisfies the parallel condition, and distribute the task blocks to worker threads in the parallel execution engine for execution. The collection module is used to collect the task execution results of each of the worker threads, summarize all the task execution results to obtain the task processing result of the target task, and return the task processing result to the client.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the task processing method as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the task processing method as described in any one of claims 1-7.