Task processing method, device, electronic device and computer readable medium

By initializing task configuration information during task processing, including task start time and time increment parameters, the problem of dynamic adjustment of date parameters and task progress recording is solved, and efficient data access and system robustness are achieved.

CN113064704BActive Publication Date: 2024-10-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110289930.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-18
Publication Date
2024-10-18
Estimated Expiration
2041-03-18

AI Technical Summary

Technical Problem

The existing technology cannot realize dynamic adjustment of date parameters when processing tasks, resulting in cumbersome data access steps and reduced efficiency, and the task progress is not recorded, resulting in reduced system robustness.

Method used

By initializing the target task configuration information when receiving a task execution request, generating initial task configuration information, including task start time and time increment parameters, determining whether the preset conditions are met, and executing the task based on this information. Set up external table reading tasks, simplify data access steps, and record task execution progress for quick re-execution.

Benefits of technology

It realizes the dynamic adjustment of date parameters, simplifies the data access steps, improves the data access efficiency, and improves the robustness of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113064704B_ABST
    Figure CN113064704B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a task processing method, device, electronic device and computer-readable medium. A specific implementation of the method includes: in response to receiving a task execution request, initializing the target task configuration information to generate initialization task configuration information, wherein the initialization task configuration information includes the task start time; determining whether the initialization task configuration information meets the preset condition, wherein the preset condition is that the current time is greater than or equal to the task start time; in response to determining that the preset condition is met, determining whether the task corresponding to the current time has been persistently stored in a preset storage system; in response to the task having been persistently stored in the storage system, reading the task through an external table preset in the storage system; and executing the task according to the initialization task configuration information. This implementation realizes the dynamic adjustment of date parameters as the task execution time changes, simplifies the steps of data access, and improves the efficiency of data access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a task processing method, device, electronic device, and computer-readable medium. Background Art

[0002] With the application of artificial intelligence technology in all walks of life, the demand for artificial intelligence algorithms and models has also increased exponentially. At present, when processing tasks, the system usually adopts the following processing methods: data source connection configuration is performed according to different data sources to enable data sources to access different data computing engines; after completing data computing, different connection configuration information is required to achieve connection with the data storage system and write the data results.

[0003] However, the above method will have the following technical problems:

[0004] First, it is impossible to dynamically adjust the date parameters as the task execution time changes; different connection configuration information is required to achieve connection with the data storage system, which makes the data access steps more cumbersome and reduces the efficiency of data access;

[0005] Second, the execution progress of the task is not recorded, resulting in the inability to quickly re-execute the task when the task execution is interrupted, which reduces the robustness of the system. Summary of the invention

[0006] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0007] Some embodiments of the present disclosure propose a task processing method, an apparatus, an electronic device, and a computer-readable medium to solve one or more of the technical problems mentioned in the above background technology section.

[0008] In a first aspect, some embodiments of the present disclosure provide a task processing method, the method comprising: in response to receiving a task execution request, initializing the target task configuration information to generate initialization task configuration information, wherein the initialization task configuration information includes the task start time; determining whether the initialization task configuration information satisfies a preset condition, wherein the preset condition is that the current time is greater than or equal to the task start time; in response to determining that the preset condition is satisfied, determining whether the task corresponding to the current time has been persistently stored in a preset storage system; in response to determining that the task has been persistently stored in the preset storage system, reading the task through an external table preset in the storage system; and executing the task according to the initialization task configuration information.

[0009] Optionally, the method further includes: in response to determining that the preset condition is not satisfied, determining again after a first preset time period whether the initialization task configuration information satisfies the preset condition.

[0010] Optionally, the method further includes: in response to determining that the task is not persistently stored in a preset storage system, determining again whether the task has been persistently stored in the storage system after a second preset time period.

[0011] Optionally, the above initialization task configuration information includes task running mode and time increment parameters.

[0012] Optionally, executing the task according to the initialization task configuration information includes: in response to the task running mode being a cyclic running mode, determining a frequency of executing the task according to the time increment parameter, and cyclically executing the task according to the frequency.

[0013] Optionally, the above-mentioned cyclic operation mode includes a cycle number threshold.

[0014] Optionally, executing the task in a loop according to the frequency includes: exiting the task in response to a situation in which the number of times the task is executed in a loop is equal to the loop number threshold.

[0015] Optionally, the above initialization task configuration information also includes a database name.

[0016] Optionally, the method further includes: in response to completion of the task execution, storing the generated task execution result in a database corresponding to the database name.

[0017] Optionally, the above method also includes: determining the time to execute the above task based on the above time increment parameters; adding the above time to the above task start time to generate a task record time; combining the task name corresponding to the above task, the above task record time, the above task start time, the above task operation mode and the above time increment parameters to generate a checkpoint record.

[0018] Optionally, before initializing the target task configuration information to generate the initialization task configuration information in response to receiving the task execution request, the method further includes: reading the task configuration information input by the user from a preset storage system as the target task configuration information.

[0019] In a second aspect, some embodiments of the present disclosure provide a task processing device, the device comprising: an initialization unit, configured to, in response to receiving a task execution request, initialize the target task configuration information to generate initialization task configuration information, wherein the initialization task configuration information includes the task start time; a first determination unit, configured to determine whether the initialization task configuration information satisfies a preset condition, wherein the preset condition is that the current time is greater than or equal to the task start time; a second determination unit, configured to, in response to determining that the preset condition is satisfied, determine whether the task corresponding to the current time has been persistently stored in a preset storage system; a reading unit, configured to, in response to determining that the task has been persistently stored in the preset storage system, read the task through an external table preset in the storage system; an execution unit, configured to execute the task according to the initialization task configuration information.

[0020] Optionally, the device further includes: a first re-determination unit configured to, in response to determining that the above-mentioned preset condition is not satisfied, re-determine whether the above-mentioned initialization task configuration information satisfies the above-mentioned preset condition after a first preset time period.

[0021] Optionally, the device further includes: a second re-determination unit configured to, in response to determining that the task is not persistently stored in the preset storage system, re-determine whether the task has been persistently stored in the storage system after a second preset time period.

[0022] Optionally, the above initialization task configuration information includes task running mode and time increment parameters.

[0023] In some optional implementations of some embodiments, the execution unit is further configured to: in response to the task running mode being a cyclic running mode, determine the frequency of executing the task according to the time increment parameter, and cyclically execute the task according to the frequency.

[0024] Optionally, the above-mentioned cyclic operation mode includes a cycle number threshold.

[0025] In some optional implementations of some embodiments, the execution unit is further configured to: exit the task in response to the number of times the task is executed in a loop being equal to the loop number threshold.

[0026] Optionally, the above initialization task configuration information also includes a database name.

[0027] Optionally, the device further includes: a storage unit configured to store the generated task execution result in a database corresponding to the above database name in response to the completion of the above task execution.

[0028] Optionally, the device also includes: a parameter determination unit, configured to determine the time for executing the above-mentioned task according to the above-mentioned time increment parameter; an addition unit, configured to add the above-mentioned time with the above-mentioned task start time to generate a task record time; and a combination unit, configured to combine the task name corresponding to the above-mentioned task, the above-mentioned task record time, the above-mentioned task start time, the above-mentioned task operation mode and the above-mentioned time increment parameter to generate a checkpoint record.

[0029] Optionally, the device further includes: an information reading unit configured to read the task configuration information input by the user from a preset storage system as the target task configuration information.

[0030] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0031] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0032] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the task processing method of some embodiments of the present disclosure, the date parameter is dynamically adjusted as the task execution time changes; the data access step is simplified and the data access efficiency is improved. Specifically, the reason for the low efficiency of data access is that: the date parameter cannot be dynamically adjusted as the task execution time changes; different connection configuration information is required to achieve connection with the data storage system, resulting in cumbersome data access steps. Based on this, the task processing method of some embodiments of the present disclosure, first, in response to receiving a task execution request, initializes the target task configuration information to generate the initialization task configuration information. Thus, it can be realized that when the task execution request is received, the time parameter in the target task configuration information is dynamically adjusted. Secondly, it is determined whether the above-mentioned initialization task configuration information meets the preset conditions. Thus, it can be determined whether the start time of the execution task is reached. Then, in response to determining that the above-mentioned preset conditions are met, it is determined whether the task corresponding to the above-mentioned current time has been persistently stored in the preset storage system. Thus, data support is provided for subsequent execution of tasks. Then, in response to determining that the above-mentioned task has been persistently stored in the preset storage system, the above-mentioned task is read through the external table in the above-mentioned storage system. Thus, the task (stream data) can be read through the pre-set external table, avoiding the problem of needing to use different connection configuration information to achieve connection with the data storage system, and simplifying the data access steps. Finally, according to the above initialization task configuration information, the above task is executed. Thus, the task processing can be completed. Thus, the date parameter is dynamically adjusted as the task execution time changes; and the data access steps are simplified, improving the efficiency of data access. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0034] Figure 1 is a schematic diagram of an application scenario of the task processing method of some embodiments of the present disclosure;

[0035] Figure 2 is a flow chart of some embodiments of the task processing method according to the present disclosure;

[0036] Figure 3 are flow charts of other embodiments of the task processing method according to the present disclosure;

[0037] Figure 4 are flow charts of some further embodiments of the task processing method according to the present disclosure;

[0038] Figure 5 is a schematic diagram of the structure of some embodiments of the task processing device according to the present disclosure;

[0039] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0040] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0041] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0042] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0043] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0044] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0045] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0046] Figure 1 It is a schematic diagram of an application scenario of the task processing method according to some embodiments of the present disclosure.

[0047] exist Figure 1In the application scenario, first, the computing device 101 can initialize the target task configuration information 103 in response to receiving the task execution request 102 to generate the initialization task configuration information 104. Among them, the above-mentioned initialization task configuration information 104 includes the task start time 1041. Here, the task execution request 102 can refer to the instruction to execute the task. Here, the target task configuration information 103 can be the configuration information of the task pre-stored in the storage system, which can include but is not limited to at least one of the following: stream data configuration information, SQL configuration information, Spark task configuration information, Sink configuration information, task operation parameter configuration information. Here, the storage system can refer to HDFS (Hadoop Distributed FileSystem). Here, the stream data configuration information is used to access the stream data and store the stream data persistently in HDFS. Here, the stream data refers to the task. Here, the SQL configuration information is used to generate the SQL content when submitting the task for execution. Here, the Spark task configuration information is used to configure the operation mode of the task. For example, the operation mode can be an infinite loop execution or repeated execution n times and exit. Here, the Sink configuration information is used to filter the data storage system to be written. Here, the task running parameter configuration information is used to configure the necessary running parameters of the task. Here, the initialization process may refer to replacing the time parameter in the target task configuration information 103 with the current running time. Secondly, the computing device 101 may determine whether the above-mentioned initialization task configuration information 103 meets the preset conditions. Among them, the above-mentioned preset conditions are that the current time is greater than or equal to the above-mentioned task start time. Then, in response to determining that the above-mentioned preset conditions are met, the computing device 101 may determine whether the task corresponding to the above-mentioned current time has been persistently stored in the preset storage system 105. Then, in response to determining that the above-mentioned task has been persistently stored in the preset storage system 105, the computing device 101 may read the task 107 through the preset external table 106 in the above-mentioned storage system 105. Here, the external table 106 may be a Hive external table, which can be used to map a structured data file into a database table and provide a complete SQL query function. Finally, the computing device 101 may execute the above-mentioned task 107 according to the above-mentioned initialization task configuration information 103.

[0048] It should be noted that the computing device 101 can be hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitation is made here.

[0049] It should be understood that Figure 1 The number of computing devices in the embodiment is only illustrative. Any number of computing devices may be provided according to implementation requirements.

[0050] Continue to refer Figure 2 , shows a process 200 of some embodiments of the task processing method according to the present disclosure. The task processing method comprises the following steps:

[0051] Step 201 , in response to receiving a task execution request, initializing target task configuration information to generate initialization task configuration information.

[0052] In some embodiments, first, the execution subject of the task processing method (for example Figure 1 The computing device 101 shown in the figure can perform initialization processing on the target task configuration information in response to receiving the task execution request to generate the initialization task configuration information. Among them, the above-mentioned initialization task configuration information includes the task start time. Here, the task execution request can refer to the instruction to execute the task. Here, the target task configuration information can be the configuration information of the task pre-stored in the storage system, which can include but is not limited to at least one of the following: stream data configuration information, SQL configuration information, Spark task configuration information, Sink configuration information, task operation parameter configuration information. Here, the storage system can refer to HDFS (Hadoop Distributed File System, distributed file system). Here, the stream data configuration information is used to access the stream data and store the stream data persistently in HDFS. Here, the stream data refers to the task. Here, the SQL configuration information is used to generate the SQL content when submitting the task for execution. Here, the Spark task configuration information is used to configure the operation mode of the task. For example, the operation mode can be an infinite loop execution or repeated execution n times to exit. Here, the Sink configuration information is used to filter the data storage system that needs to be written. Here, the task operation parameter configuration information is used to configure the necessary operation parameters of the task. Here, the initialization processing can refer to replacing the time parameter in the target task configuration information with the current operation time. Here, when the initialization processing executes the task for the first time, the time parameters in the target task configuration information are replaced with the current running time; when the initialization processing executes the task in a loop (not the first time), the time parameters in the target task configuration information are updated by the time parameters of the last task execution and the time increment parameters.

[0053] Step 202: Determine whether the initialization task configuration information satisfies a preset condition.

[0054] In some embodiments, the execution entity may determine whether the initialization task configuration information satisfies a preset condition. The preset condition is that the current time is greater than or equal to the task start time. For example, the current time may be "2021-3-15-15:00". The task start time may be "2021-3-15-14:59". Thus, the execution entity may determine that the initialization task configuration information satisfies the preset condition.

[0055] Step 203, in response to determining that the preset condition is met, determining whether the task corresponding to the current time has been persistently stored in a preset storage system.

[0056] In some embodiments, the execution subject may determine whether the task corresponding to the current time has been persistently stored in a preset storage system in response to determining that the preset conditions are met. Here, the execution subject may determine whether the task corresponding to the initialization task configuration information at the current time has been persistently stored in a preset storage system. In practice, the execution subject may search the preset storage system (HDFS) for a task with the same task name as that included in the initialization task configuration information. Here, the task may refer to streaming data persistently stored in HDFS.

[0057] Step 204 , in response to determining that the task has been persistently stored in the preset storage system, the task is read through an external table preset in the storage system.

[0058] In some embodiments, the execution subject may read the task through an external table preset in the storage system in response to determining that the task has been persistently stored in the preset storage system. Here, the external table may be a Hive external table, which may be used to map a structured data file to a database table and provide complete SQL query functions.

[0059] Step 205: Execute the above task according to the above initialization task configuration information.

[0060] In some embodiments, first, the execution subject may obtain the parameter information necessary for executing the task from the initialization task configuration information in response to the current time being greater than or equal to the task start time. Here, the parameter information may include but is not limited to at least one of the following: operation mode, dynamic partition information (including support for dynamic partitioning and support for dynamic partitioning). Then, when the operation mode included in the parameter information is cyclic operation, the execution subject may cyclically execute (process) the task.

[0061] Optionally, in response to determining that the preset condition is not met, after a first preset time period, it is determined again whether the initialization task configuration information meets the preset condition.

[0062] In some embodiments, the execution subject may, in response to determining that the preset condition is not satisfied, determine again whether the initialization task configuration information satisfies the preset condition after a first preset time period. Here, the first preset time period may be a time period randomly set according to demand, without limitation. For example, the first preset time period may be 1 minute.

[0063] Optionally, in response to determining that the task is not persistently stored in the preset storage system, after a second preset time period, it is determined again whether the task has been persistently stored in the storage system.

[0064] In some embodiments, the execution subject may, in response to determining that the task is not persistently stored in the preset storage system, determine again whether the task has been persistently stored in the storage system after a second preset time period. Here, the second preset time period may be a time period randomly set according to demand, without limitation. For example, the second preset time period may be 1 minute.

[0065] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the task processing method of some embodiments of the present disclosure, the date parameter is dynamically adjusted as the task execution time changes; the data access step is simplified and the data access efficiency is improved. Specifically, the reason for the low efficiency of data access is that: the date parameter cannot be dynamically adjusted as the task execution time changes; different connection configuration information is required to achieve connection with the data storage system, resulting in cumbersome data access steps. Based on this, the task processing method of some embodiments of the present disclosure, first, in response to receiving a task execution request, initializes the target task configuration information to generate the initialization task configuration information. Thus, it can be realized that when the task execution request is received, the time parameter in the target task configuration information is dynamically adjusted. Secondly, it is determined whether the above-mentioned initialization task configuration information meets the preset conditions. Thus, it can be determined whether the start time of the execution task is reached. Then, in response to determining that the above-mentioned preset conditions are met, it is determined whether the task corresponding to the above-mentioned current time has been persistently stored in the preset storage system. Thus, data support is provided for subsequent execution of tasks. Then, in response to determining that the above-mentioned task has been persistently stored in the preset storage system, the above-mentioned task is read through the external table in the above-mentioned storage system. Thus, the task (stream data) can be read through the pre-set external table, avoiding the problem of needing to use different connection configuration information to achieve connection with the data storage system, and simplifying the data access steps. Finally, according to the above initialization task configuration information, the above task is executed. Thus, the task processing can be completed. Thus, the date parameter is dynamically adjusted as the task execution time changes; and the data access steps are simplified, improving the efficiency of data access.

[0066] Further references Figure 3 , shows a flowchart of some other embodiments of the task processing method according to the present disclosure. The task processing method comprises the following steps:

[0067] Step 301 , in response to receiving a task execution request, initializing target task configuration information to generate initialization task configuration information.

[0068] Step 302: Determine whether the initialization task configuration information meets a preset condition.

[0069] Step 303: In response to determining that the preset condition is met, determine whether the task corresponding to the current time has been persistently stored in a preset storage system.

[0070] Step 304: in response to determining that the task has been persistently stored in the preset storage system, the task is read through an external table preset in the storage system.

[0071] In some embodiments, the specific implementation of steps 301-304 and the technical effects brought about can be referred to Figure 2 The corresponding steps 201-204 in the embodiments are not described in detail here.

[0072] Step 305 , in response to the task running mode being a cyclic running mode, determining a frequency for executing the task according to the time increment parameter, and cyclically executing the task according to the frequency.

[0073] In some embodiments, the initialization task configuration information includes the task operation mode and the time increment parameter. Figure 1 The computing device 101 shown in the figure can determine the frequency of executing the above-mentioned task according to the above-mentioned time increment parameter in response to the above-mentioned task operation mode being the cyclic operation mode, and cyclically execute the above-mentioned task according to the above-mentioned frequency. For example, the time increment parameter is 2, which can indicate that the task is executed twice in one hour, and the frequency of executing the above-mentioned task can be determined to be once every half an hour. In practice, in response to the task operation mode being the cyclic operation mode, the time increment parameter is 2. The above-mentioned execution subject can cyclically execute the task once every half an hour.

[0074] Step 306, in response to the number of times the task is executed in a loop being equal to the loop number threshold, exiting the task.

[0075] In some embodiments, the cyclic operation mode includes a cycle number threshold. The execution subject may exit the task in response to the number of times the task is executed in a cycle being equal to the cycle number threshold. For example, the cycle number threshold may be 5, and the execution subject may execute the task once every half an hour and exit after executing the task 5 times in a cycle.

[0076] Step 307, in response to the completion of the above task execution, the generated task execution result is stored in the database corresponding to the database name.

[0077] In some embodiments, the initialization task configuration information further includes a database name. Here, the database name may be a name representing different types of databases. In response to the completion of the task execution, the execution subject may store the generated task execution result in a database corresponding to the database name. For example, in response to the completion of the task execution, the generated task execution result "Task A is executed successfully" may be stored in a database "A" corresponding to the database name "A". Thus, the task execution result can be output according to a storage system specified by the user.

[0078] Step 308: Determine the time for executing the above task according to the above time increment parameter.

[0079] In some embodiments, the execution subject may determine the time required to execute a task by using a time increment parameter after storing each generated task execution result in a database corresponding to the database name. For example, the time increment parameter may be 2, which means that the time required to execute a task is half an hour (30 minutes).

[0080] Step 309: Add the above time to the above task start time to generate the task recording time.

[0081] In some embodiments, the execution entity may add the time to the task start time to generate the task record time. For example, the task start time may be "2021-3-15-14:59". That is, the task record time of this task is "2021-3-15-15:29".

[0082] Step 310, combining the task name corresponding to the task, the task recording time, the task start time, the task running mode and the time increment parameter to generate a checkpoint record.

[0083] In some embodiments, the execution entity may combine the task name corresponding to the task, the task recording time, the task start time, the task running mode and the time increment parameter to generate a checkpoint record.

[0084] As an example, the task name "A", the task recording time "2021-3-15-15:29", the task start time "2021-3-15-14:59", the above-mentioned task running mode "Repeat 5 times to exit mode" and the above-mentioned time increment parameter "2" can be combined to generate a checkpoint record "{[task name: A]; [task recording time: 2021-3-15-15:29]; [task start time: 2021-3-15-14:59]; [task running mode: Repeat 5 times to exit mode]; [time increment parameter: 2]}".

[0085] The relevant content in steps 308-310, as an inventive point of the present disclosure, solves the second technical problem mentioned in the background technology, "the execution progress of the task is not recorded, resulting in the inability to quickly re-execute the task when the task execution is interrupted, thereby reducing the robustness of the system". The factors that cause the robustness of the system to be reduced are often as follows: the execution progress of the task is not recorded, resulting in the inability to quickly re-execute the task when the task execution is interrupted. If the above factors are solved, the effect of improving the robustness of the system can be achieved. In order to achieve this effect, the present disclosure can quickly calculate the task start time and execution order of the next task when the task execution is interrupted by recording the time when the last task execution is completed, as well as the task start time, task operation mode and time increment parameters of the last task after each task execution. Therefore, by recording the execution progress of the task, it is possible to quickly re-execute the task when the task execution is interrupted, thereby improving the robustness of the system.

[0086] from Figure 3 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 3 The process 300 in some corresponding embodiments can achieve rapid re-execution of the task when the task execution is interrupted by recording the execution progress of the task, so as to improve the robustness of the system.

[0087] Further references Figure 4 , showing some further embodiments of the task processing method according to the present disclosure. The task processing method comprises the following steps:

[0088] Step 401: Read task configuration information input by a user from a preset storage system as target task configuration information.

[0089] In some embodiments, the execution body of the task processing method (eg Figure 1 The computing device 101 shown can read the task configuration information input by the user from the preset storage system as the target task configuration information. Here, the task configuration information input by the user can be input by inputting the data source to be specified and the connection configuration information of the data source. Here, the multi-source heterogeneous stream data (task) can be accessed and persistently stored in HDFS through the specified data source and the connection configuration information of the data source, reducing the tedious data access work.

[0090] Step 402: in response to receiving the task execution request, initializing the target task configuration information to generate initialization task configuration information.

[0091] Step 403: Determine whether the initialization task configuration information meets a preset condition.

[0092] Step 404: In response to determining that the preset condition is met, determine whether the task corresponding to the current time has been persistently stored in a preset storage system.

[0093] Step 405 , in response to determining that the task has been persistently stored in the preset storage system, the task is read through an external table preset in the storage system.

[0094] Step 406: Execute the above task according to the above initialization task configuration information.

[0095] In some embodiments, the specific implementation of steps 402-406 and the technical effects brought about can be referred to Figure 2 The corresponding steps 201-205 in the embodiments are not described in detail here.

[0096] from Figure 4 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 4 The process 400 in some corresponding embodiments can realize the access and persistent storage of multi-source heterogeneous streaming data (tasks) to HDFS, reducing the tedious data access work.

[0097] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a task processing device, and these device embodiments are Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0098] like Figure 5 As shown, the task processing device 500 of some embodiments includes: an initialization unit 501, a first determination unit 502, a second determination unit 503, a reading unit 504 and an execution unit 505. The initialization unit 501 is configured to, in response to receiving a task execution request, perform initialization processing on the target task configuration information to generate initialization task configuration information, wherein the initialization task configuration information includes the task start time; the first determination unit 502 is configured to determine whether the initialization task configuration information meets a preset condition, wherein the preset condition is that the current time is greater than or equal to the task start time; the second determination unit 503 is configured to, in response to determining that the preset condition is met, determine whether the task corresponding to the current time has been persistently stored in a preset storage system; the reading unit 504 is configured to, in response to determining that the task has been persistently stored in a preset storage system, read the task through an external table preset in the storage system; and the execution unit 505 is configured to execute the task according to the initialization task configuration information.

[0099] Optionally, the apparatus 500 further includes: a first re-determination unit configured to, in response to determining that the preset condition is not satisfied, re-determine whether the initialization task configuration information satisfies the preset condition after a first preset time period.

[0100] Optionally, the device 500 further includes: a second re-determination unit configured to, in response to determining that the task is not persistently stored in the preset storage system, re-determine whether the task has been persistently stored in the storage system after a second preset time period.

[0101] Optionally, the above initialization task configuration information includes task running mode and time increment parameters.

[0102] In some optional implementations of some embodiments, the execution unit 505 is further configured to: in response to the task running mode being a cyclic running mode, determine the frequency of executing the task according to the time increment parameter, and cyclically execute the task according to the frequency.

[0103] Optionally, the above-mentioned cyclic operation mode includes a cycle number threshold.

[0104] In some optional implementations of some embodiments, the execution unit 505 is further configured to: exit the task in response to the number of times the task is executed in a loop being equal to the loop number threshold.

[0105] Optionally, the above initialization task configuration information also includes a database name.

[0106] Optionally, the apparatus 500 further includes: a storage unit configured to store the generated task execution result in a database corresponding to the above database name in response to completion of the above task execution.

[0107] Optionally, the device 500 also includes: a parameter determination unit, configured to determine the time for executing the above-mentioned task according to the above-mentioned time increment parameter; an addition unit, configured to add the above-mentioned time with the above-mentioned task start time to generate a task record time; and a combination unit, configured to combine the task name corresponding to the above-mentioned task, the above-mentioned task record time, the above-mentioned task start time, the above-mentioned task operation mode and the above-mentioned time increment parameter to generate a checkpoint record.

[0108] Optionally, the apparatus 500 further includes: an information reading unit configured to read the task configuration information input by the user from a preset storage system as the target task configuration information.

[0109] It is understood that the units described in the device 500 are similar to those described in the reference Figure 2Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0110] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 The electronic devices in some embodiments of the present disclosure may include but are not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0111] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0112] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0113] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0114] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0115] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0116] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to receiving a task execution request, initializes the target task configuration information to generate initialization task configuration information, wherein the initialization task configuration information includes the task start time; determines whether the initialization task configuration information satisfies a preset condition, wherein the preset condition is that the current time is greater than or equal to the task start time; in response to determining that the preset condition is satisfied, determines whether the task corresponding to the current time has been persistently stored in a preset storage system; in response to determining that the task has been persistently stored in a preset storage system, reads the task through an external table preset in the storage system; and executes the task according to the initialization task configuration information.

[0117] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0118] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0119] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor comprising an initialization unit, a first determination unit, a second determination unit, a reading unit, and an execution unit. Among them, the names of these units do not constitute a limitation on the unit itself in certain circumstances, for example, the second determination unit may also be described as "a unit that determines, in response to determining that the above-mentioned preset conditions are met, whether the task corresponding to the above-mentioned current time has been persistently stored in a preset storage system".

[0120] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0121] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A task processing method, comprising: In response to receiving a task execution request, initializing the target task configuration information to generate initialization task configuration information, wherein the initialization task configuration information includes the task start time, and when the initialization process executes the task for the first time, the time parameter in the target task configuration information is replaced with the current running time; when the initialization process executes the task for the non-first time, the time parameter in the target task configuration information is updated by the time parameter of the last task execution and the time increment parameter; Determine whether the initialization task configuration information meets a preset condition, wherein the preset condition is that the current time is greater than or equal to the task start time; In response to determining that the preset condition is met, determining whether the task corresponding to the current time has been persistently stored in a preset storage system; In response to determining that the task has been persistently stored in a preset storage system, reading the task through an external table preset in the storage system; Execute the task according to the initialization task configuration information.

2. The method according to claim 1, wherein: The method further comprises: In response to determining that the preset condition is not satisfied, after a first preset time period, it is determined again whether the initialization task configuration information satisfies the preset condition.

3. The method according to claim 1, wherein: The method further comprises: In response to determining that the task is not persistently stored in the preset storage system, after a second preset time period, it is determined again whether the task has been persistently stored in the storage system.

4. The method according to claim 1, wherein: The initialization task configuration information includes task operation mode and time increment parameters; as well as The performing of the task according to the initialization task configuration information includes: In response to the task running mode being the cyclic running mode, the frequency of executing the task is determined according to the time increment parameter, and the task is cyclically executed according to the frequency.

5. The method according to claim 4, wherein: The cyclic operation mode includes a cycle number threshold; as well as The step of executing the task according to the frequency cycle includes: In response to the task being executed repeatedly for a number of times equal to the loop number threshold, the task is exited.

6. The method according to claim 5, wherein: The initialization task configuration information also includes a database name; as well as The method further comprises: In response to the task execution being completed, the generated task execution result is stored in a database corresponding to the database name.

7. The method according to claim 6, wherein: The method further comprises: Determine the time required to execute a task according to the time increment parameter; Adding the time required to execute the task once to the task start time to generate the task record time; The task name corresponding to the task, the task recording time, the task start time, the task running mode and the time increment parameter are combined to generate a checkpoint record.

8. The method according to claim 1, wherein: Before the step of initializing the target task configuration information to generate the initialization task configuration information in response to receiving the task execution request, the method further includes: The task configuration information input by the user is read from a preset storage system as target task configuration information.

9. A task processing device, comprising: The initialization unit is configured to, in response to receiving a task execution request, perform initialization processing on the target task configuration information to generate initialization task configuration information, wherein the initialization task configuration information includes the task start time, and when the initialization processing is performed for the first time, the time parameter in the target task configuration information is replaced with the current running time; when the initialization processing is performed for the non-initial task, the time parameter in the target task configuration information is updated by the time parameter of the last task execution and the time increment parameter; A first determining unit is configured to determine whether the initialization task configuration information meets a preset condition, wherein the preset condition is that the current time is greater than or equal to the task start time; A second determining unit is configured to determine, in response to determining that the preset condition is met, whether the task corresponding to the current time has been persistently stored in a preset storage system; a reading unit, configured to, in response to determining that the task has been persistently stored in a preset storage system, read the task through an external table preset in the storage system; The execution unit is configured to execute the task according to the initialization task configuration information.

10. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

11. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Data platform system based on real-time streaming computing

    CN110209646A

  • Task processing method and device

    CN111400003A