Task migration method and apparatus, electronic device, and computer readable medium

By detecting and migrating abnormal server information in the server information table, the problem of server errors causing tasks to fail to run in a timely manner was resolved, thereby reducing task processing time and improving server availability.

CN113760503BActive Publication Date: 2026-03-17BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-24
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In existing technologies, when a server encounters an error, tasks cannot run in a timely manner, resulting in a long processing time.

Method used

By checking whether there is server information in the server information table that meets the target conditions, a group of candidate server information is determined, and the corresponding tasks are migrated, including locking, running status judgment and task migration.

Benefits of technology

It enables task migration from servers experiencing errors, reducing task processing time and improving server availability and task processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760503B_ABST
    Figure CN113760503B_ABST
Patent Text Reader

Abstract

This disclosure provides embodiments of a task migration method, apparatus, electronic device, and computer-readable medium. One specific implementation of the method includes: detecting whether server information satisfying target conditions exists in a preset server information table; in response to the existence of such information, determining the server information satisfying the target conditions as candidate server information to obtain a candidate server information group; and performing migration processing on the tasks in the servers corresponding to each candidate server information in the candidate server information group. This implementation can complete the migration of tasks in servers where errors have occurred, reducing the task processing time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of this disclosure relate to the field of computer technology, and more particularly to task migration methods, apparatus, electronic devices, and computer-readable media. Background Technology

[0002] With the application of artificial intelligence technology in various industries, the demand for AI algorithms and tasks is growing exponentially. Currently, when servers encounter errors during task processing, they typically use alarms to notify maintenance personnel for repairs.

[0003] However, the above method usually has the following technical problems: tasks on the server that encounter errors cannot be run in a timely manner, resulting in a long processing time. Summary of the Invention

[0004] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.

[0005] Some embodiments of this disclosure provide task migration methods, apparatuses, electronic devices, and computer-readable media to address one or more of the technical problems mentioned in the background section above.

[0006] In a first aspect, some embodiments of this disclosure provide a task migration method, which includes: detecting whether there is server information that meets target conditions in a preset server information table; in response to the existence, determining the server information that meets the target conditions as candidate server information to obtain a candidate server information group; and performing migration processing on the tasks in the server corresponding to each candidate server information included in the candidate server information group.

[0007] Optionally, the above-mentioned migration processing of tasks in the server corresponding to each candidate server information included in the above-mentioned candidate server information group includes: locking the above-mentioned server information table and determining whether there is server information corresponding to the local server in the above-mentioned server information table; in response to determining that there is, migrating the tasks in the server corresponding to the above-mentioned candidate server information.

[0008] Optionally, the above-mentioned migration process for tasks in the server corresponding to the candidate server information includes: locking the candidate server information and determining the running status of the server corresponding to the candidate server information; in response to the running status being non-running, determining whether the time interval between the historical running time and the current time included in the candidate server information is greater than or equal to a preset interval; in response to the determination being yes, changing the information status included in the candidate server information to a downtime state, and migrating the tasks in the server corresponding to the candidate server information to the local server.

[0009] Optionally, the above-mentioned migration processing of tasks in the servers corresponding to the above-mentioned alternative server information further includes: in response to determining that there is no such server, adding the server information of the above-mentioned local server to the above-mentioned server information table to update the above-mentioned server information table.

[0010] Optionally, the above method further includes: in response to receiving an execution request for a task in the task table, selecting a task whose task status meets a preset condition from the task table as a task to be executed, thus obtaining a task group to be executed; according to the task identifier of the task to be executed in the task group to be executed, performing the following processing steps for each task to be executed in the task group to be executed: locking the task to be executed and executing the task to be executed; in response to execution failure, re-executing the task to be executed; in response to the execution count corresponding to the task to be executed being greater than or equal to a predetermined threshold, changing the task status of the task to be executed to an abnormal state.

[0011] Optionally, the above method further includes: deleting the pending task in response to the completion of execution.

[0012] Optionally, the above method also includes: providing early warning processing for tasks in abnormal states.

[0013] Secondly, some embodiments of this disclosure provide a task migration apparatus, the apparatus comprising: a detection unit configured to detect whether server information satisfying target conditions exists in a preset server information table; a determination unit configured to, in response to the existence of such information, determine the server information satisfying the target conditions as candidate server information, thereby obtaining a candidate server information group; and a migration unit configured to perform migration processing on the tasks in the server corresponding to each candidate server information included in the candidate server information group.

[0014] In some optional implementations of some embodiments, the migration unit is further configured to: lock the server information table and determine whether server information corresponding to the local server exists in the server information table; in response to determining that it exists, perform migration processing on the tasks in the server corresponding to the candidate server information.

[0015] In some optional implementations of certain embodiments, the migration unit is further configured to: lock the candidate server information and determine the running status of the server corresponding to the candidate server information; in response to the running status being non-running, determine whether the time interval between the historical running time included in the candidate server information and the current time is greater than or equal to a preset interval; in response to the determination being yes, modify the information status included in the candidate server information to a downtime state, and migrate the tasks in the server corresponding to the candidate server information to the local server.

[0016] Optionally, the migration unit is further configured to: in response to determining that the local server does not exist, add the server information of the local server to the server information table to update the server information table.

[0017] Optionally, the apparatus further includes a selection unit, a processing unit, and a modification unit. The selection unit is configured to, in response to receiving an execution request for a task in a task table, select tasks whose task status meets preset conditions from the task table as tasks to be executed, thus obtaining a group of tasks to be executed. The processing unit is configured to, based on the task identifier of each task in the group of tasks to be executed, perform the following processing steps for each task in the group of tasks to be executed: locking the task to be executed and executing the task; in response to execution failure, re-executing the task to be executed; the modification unit is configured to, in response to the number of executions corresponding to the task to be executed being greater than or equal to a predetermined threshold, change the task status of the task to be executed to an abnormal state.

[0018] Optionally, the apparatus further includes a deletion unit configured to delete the task to be executed in response to completion of execution.

[0019] Optionally, the device further includes an early warning unit configured to provide early warning processing for tasks to be executed in abnormal states.

[0020] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein 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 of the first aspect above.

[0021] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.

[0022] The above embodiments of this disclosure have the following beneficial effects: The task migration method of some embodiments of this disclosure can complete the migration of tasks from servers experiencing errors, reducing task processing time. Specifically, the reason for the long processing time is that tasks from servers experiencing errors cannot run in a timely manner, resulting in a long processing time. Based on this, the task migration method of some embodiments of this disclosure first checks whether there is server information that meets the target conditions in a preset server information table. This allows it to determine whether there is abnormal server information. Then, in response to the existence of abnormal server information, the server information that meets the target conditions is determined as candidate server information, resulting in a candidate server information group. This allows abnormal server information to be filtered out, providing data support for subsequent task migration. Finally, the tasks in the servers corresponding to each candidate server information in the candidate server information group are migrated. Thus, the migration of tasks from servers experiencing errors can be completed, reducing task processing time. Attached Figure Description

[0023] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.

[0024] Figure 1 This is a schematic diagram illustrating an application scenario of the task migration method according to some embodiments of this disclosure;

[0025] Figure 2 This is a flowchart of some embodiments of the task migration method according to this disclosure;

[0026] Figure 3 This is a flowchart of some other embodiments of the task migration method according to this disclosure;

[0027] Figure 4 This is a flowchart of yet another embodiment of the task migration method according to the present disclosure;

[0028] Figure 5 These are schematic diagrams illustrating the structure of some embodiments of the task migration apparatus according to this disclosure;

[0029] Figure 6 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation

[0030] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0031] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.

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

[0033] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0034] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0035] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0036] Figure 1 This is a schematic diagram of an application scenario of a task migration method according to some embodiments of the present disclosure.

[0037] exist Figure 1In the application scenario, firstly, the computing device 101 can detect whether there is server information in the preset server information table 102 that meets the target condition 103. Here, the server information table 102 can refer to a list containing information about various servers. Here, server information can refer to server information, including but not limited to at least one of the following: server name, creation time, historical running time, information status, etc. Here, information status can represent the state of the server. For example, server information can be "Server name: Server A; Creation time: 2020-12-29-12:00; Historical running time: 2021-1-28-14:55; Information status: Normal state". Here, the target condition 103 can be: the time interval between the historical running time and the current time included in the server information is greater than or equal to a preset interval. Then, in response to the existence, the computing device 101 can determine the server information that meets the above target condition 103 as candidate server information, obtaining a candidate server information group 104. Finally, the computing device 101 can perform migration processing on the tasks in the server corresponding to each candidate server information included in the above candidate server information group 104.

[0038] It should be noted that the aforementioned computing device 101 can be either 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 software, it can be installed within the hardware devices listed above. It can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here.

[0039] It should be understood that Figure 1 The number of computing devices shown is merely illustrative. Any number of computing devices can be used depending on implementation needs.

[0040] Continue to refer to Figure 2 The flowchart 200 illustrates some embodiments of a task migration method according to the present disclosure. The task migration method includes the following steps:

[0041] Step 201: Check if there is server information in the preset server information table that meets the target conditions.

[0042] In some embodiments, firstly, the execution body of the task migration method (e.g. Figure 1The computing device 101 shown can detect whether there is server information that meets the target conditions in a preset server information table. Here, the server information table can refer to a list containing information about various servers. For example, the server information table may include "[Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Running Time: 2021-1-28-14:55; Information Status: Normal]"; [Server Name: Server B; Creation Time: 2020-12-29-12:00; Historical Running Time: 2021-1-28-14:58; Information Status: Normal]"; [Server Name: Server C; Creation Time: 2020-12-29-12:00; Historical Running Time: 2021-1-28-14:56; Information Status: Normal]". Here, server information can refer to server information, including but not limited to at least one of the following: server name, creation time, historical running time, information status, etc. Here, information status can represent the state of the server. For example, server information could be "Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal". Here, target condition 103 could be: the time interval between the historical run time and the current time included in the server information is greater than or equal to a preset interval. For example, the historical run time included in the server information "Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal" could be "2021-1-28-14:55". The current time could be "2021-1-28-14:59". The preset interval could be "3 minutes". The server information "Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal" includes a historical run time "2021-1-28-14:55" and a current time "2021-1-28-14:59" with a time interval of "4 minutes", which is greater than the preset interval "3 minutes". Therefore, it can be detected that the server information "Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal" meets the target condition.

[0043] Step 202: In response to the existence, server information that meets the above target conditions is identified as candidate server information, thus obtaining a candidate server information group.

[0044] In some embodiments, in response to the existence of such information, the execution entity may determine server information that satisfies the target conditions as candidate server information, thereby obtaining a candidate server information group.

[0045] As an example, the server information table can include "[Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal]"; [Server Name: Server B; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:58; Information Status: Normal]"; [Server Name: Server C; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:58; Information Status: Normal] ...; [Server Name: Server C; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:58; Information Status: Normal]; [Server Name: Server C; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:58; Information Status: Normal]; [Server Name: Server C; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:58 Server information that meets the above target conditions in "[Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal Status]" is determined as candidate server information, resulting in the candidate server information group "[Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal Status]"; [Server Name: Server C; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:56; Information Status: Normal Status]".

[0046] Step 203: Perform migration processing on the tasks in the servers corresponding to each candidate server information included in the above candidate server information group.

[0047] In some embodiments, the execution entity may perform migration processing on the tasks in the servers corresponding to each candidate server information included in the candidate server information group. Here, migration processing may refer to migrating the tasks in the server to other servers. For example, the tasks in server "A" corresponding to the candidate server information "[Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal Status]" in the candidate server information group "[Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:56; Information Status: Normal Status]" may be migrated to server "B".

[0048] The above embodiments of this disclosure have the following beneficial effects: The task migration method of some embodiments of this disclosure can complete the migration of tasks from servers experiencing errors, reducing task processing time. Specifically, the reason for the long processing time is that tasks from servers experiencing errors cannot run in a timely manner, resulting in a long processing time. Based on this, the task migration method of some embodiments of this disclosure first checks whether there is server information that meets the target conditions in a preset server information table. This allows it to determine whether there is abnormal server information. Then, in response to the existence of abnormal server information, the server information that meets the target conditions is determined as candidate server information, resulting in a candidate server information group. This allows abnormal server information to be filtered out, providing data support for subsequent task migration. Finally, the tasks in the servers corresponding to each candidate server information in the candidate server information group are migrated. Thus, the migration of tasks from servers experiencing errors can be completed, reducing task processing time.

[0049] Further reference Figure 3 The diagram illustrates flowcharts of some other embodiments of the task migration method according to this disclosure. The task migration method includes the following steps:

[0050] Step 301: Check if there is server information in the preset server information table that meets the target conditions.

[0051] Step 302: In response to the existence, server information that meets the above target conditions is identified as candidate server information, and a candidate server information group is obtained.

[0052] In some embodiments, the specific implementation of steps 301-302 and the resulting technical effects can be found in [reference needed]. Figure 2 Steps 201-202 in the corresponding embodiments will not be repeated here.

[0053] Step 303: Lock the above server information table and determine whether the server information table contains server information corresponding to the local server.

[0054] In some embodiments, the execution body of the task migration method (e.g. Figure 1 The computing device 101 shown can lock the aforementioned server information table and determine whether server information corresponding to the local server exists in the aforementioned server information table. Here, locking can refer to locking processing, used to prevent other servers from tampering with the information. In practice, it can be determined whether server information including the server name corresponding to the local server exists in the server information table. Here, the local server can refer to the aforementioned execution entity.

[0055] Step 304: In response to the confirmation of existence, the tasks in the servers corresponding to the above-mentioned alternative server information are migrated.

[0056] In some embodiments, in response to determining that an alternative server exists, the aforementioned execution entity can perform migration processing on the tasks in the server corresponding to the aforementioned alternative server information through the following steps:

[0057] The first step involves locking the aforementioned candidate server information and determining the running status of the servers corresponding to that candidate server information. Determining the running status of the servers corresponding to the candidate server information is to determine whether the tasks on those servers have been migrated by other servers. Here, running status can represent whether the server is running or not.

[0058] The second step, in response to the aforementioned "not running" status, determines whether the time interval between the historical running time and the current time included in the candidate server information is greater than or equal to a preset interval. In practice, the candidate server information can be "[Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Running Time: 2021-1-28-14:55; Information Status: Normal]". The candidate server information includes the historical running time "2021-1-28-14:55", the current time "2021-1-28-15:00", and the preset interval can be "4 minutes". Therefore, it can be determined that the time interval "5 minutes" between the historical running time and the current time included in the candidate server information is greater than the preset interval "4 minutes".

[0059] The third step, in response to the determination, is to modify the information status of the aforementioned candidate server information to an "downtime" state, and to migrate the tasks in the servers corresponding to the aforementioned candidate server information to the aforementioned local server. Here, the information status can be a state that indicates whether the server is functioning normally.

[0060] In practice, in response to the determination, firstly, the information status [Normal Status] of the above alternative server information [Server Name: Server A; Creation Time: 2020-12-29-12:00; Historical Run Time: 2021-1-28-14:55; Information Status: Normal Status] can be changed to [Downtime Status]. Then, the tasks in the servers corresponding to the above alternative server information can be migrated to the above local server.

[0061] Step 305: In response to the determination that the server does not exist, the server information of the local server is added to the server information table to update the server information table.

[0062] In some embodiments, in response to determining that the server does not exist, the executing entity may add the server information of the local server to the server information table to update the server information table. For example, the server information of the local server may be [Server Name: Server D; Creation Time: 2021-01-25 12:00; Historical Running Time: 2021-01-28 16:55; Information Status: Normal]. The server information of the local server [Server Name: Server D; Creation Time: 2021-01-25 12:00; Historical Running Time: 2021-01-28 16:55; Information Status: Normal] may be added to the server information table to update the server information table.

[0063] from Figure 3 It can be seen that, with Figure 2 Compared to the description of some corresponding embodiments, Figure 3 In some corresponding embodiments, process 300 can determine whether the server has recovered and whether the tasks on the server have been migrated to other servers when handling a downtime server. This demonstrates flexibility in handling downtime servers and improves server availability.

[0064] Further reference Figure 4 The diagram illustrates flowcharts of further embodiments of a task migration method according to the present disclosure. This task migration method includes the following steps:

[0065] Step 401: Check if there is server information in the preset server information table that meets the target conditions.

[0066] Step 402: In response to the existence, server information that meets the above target conditions is identified as candidate server information, and a candidate server information group is obtained.

[0067] Step 403: Perform migration processing on the tasks in the servers corresponding to each candidate server information included in the above candidate server information group.

[0068] In some embodiments, the specific implementation of steps 401-403 and the resulting technical effects can be found in [reference needed]. Figure 2 Steps 201-203 in the corresponding embodiments will not be repeated here.

[0069] Step 404: In response to receiving an execution request for a task in the task table, select a task whose status meets the preset conditions from the task table as a task to be executed, and obtain a task group to be executed.

[0070] In some embodiments, the execution body of the task migration method (e.g. Figure 1The computing device 101 shown can, in response to receiving an execution request for a task in the task table, select tasks whose task status meets preset conditions from the task table as tasks to be executed, thus obtaining a group of tasks to be executed. Here, the task table can be a list containing various tasks. Here, the task table can be a list of tasks and their related information stored on a local server. Here, a task can refer to thread information. Here, the preset condition can be "task status is normal". Here, a task in the task table can include, but is not limited to, at least one of the following: task identifier, task parameters, server name, task status, etc. Here, task parameters are parameters necessary for executing the task. Here, task status can characterize whether a task can be executed normally. For example, a task could be: [Task identifier: abcde; Task parameters: XX, YY; Server name: Server D; Task status: normal].

[0071] As an example, the task table can include {[Task ID: abcde; Task Parameters: XX, YY; Server Name: Server D; Task Status: Normal]; [Task ID: cde; Task Parameters: XX, KK; Server Name: Server D; Task Status: Normal]; [Task ID: abc; Task Parameters: XX, MM; Server Name: Server D; Task Status: Abnormal]}. Tasks whose status meets the preset condition "task status is normal" can be selected from the task table {[task ID: abcde; task parameters: XX, YY; server name: server D; task status: normal]; [task ID: cde; task parameters: XX, KK; server name: server D; task status: normal]; [task ID: abc; task parameters: XX, MM; server name: server D; task status: abnormal]} as tasks to be executed, resulting in the task group to be executed: "{[task ID: abcde; task parameters: XX, YY; server name: server D; task status: normal]; [task ID: cde; task parameters: XX, KK; server name: server D; task status: normal]}".

[0072] Step 405: Based on the task identifier of the task to be executed in the above task to be executed group, perform processing steps for each task to be executed in the above task to be executed group.

[0073] In some embodiments, firstly, the executing entity may identify tasks with the same task identifier in the task group as abnormal tasks. Then, it removes the abnormal tasks from the task group. For each task in the task group after the abnormal tasks have been removed, the following processing steps are performed:

[0074] The first step is to lock and execute the tasks to be executed. In practice, the executing entity can first lock the tasks to be executed. Then, the tasks can be executed. For example, a task to be executed could be [Task ID: abcde; Task Parameters: XX, YY; Server Name: Server D; Task Status: Normal].

[0075] The second step is to re-execute the aforementioned task in response to execution failure. In practice, the executing entity can re-execute the aforementioned task in response to execution failure.

[0076] Step 406: In response to the execution count of the above-mentioned task being greater than or equal to a predetermined threshold, the task status of the above-mentioned task being executed is changed to an abnormal status.

[0077] In some embodiments, the executing entity may change the task status of the task to be executed to an abnormal state in response to the execution count corresponding to the task being executed being greater than or equal to a predetermined threshold. Here, the setting of the predetermined threshold is not limited. In practice, the task status of the task to be executed [task ID: abcde; task parameters: XX, YY; server name: server D; task status: normal state] may be changed from [normal state] to [abnormal state] in response to the execution count corresponding to the task being executed being greater than or equal to the predetermined threshold "3 times".

[0078] Step 407: Issue an early warning for tasks in abnormal states.

[0079] In some embodiments, the aforementioned execution entity may generate abnormal alarm information for tasks in an abnormal state and send it to the task alarm platform for prompt processing.

[0080] Optionally, in response to completion of execution, the aforementioned pending tasks are deleted. In practice, the aforementioned executing entity may delete the aforementioned pending tasks from the task table in response to completion of execution.

[0081] from Figure 4 It can be seen that, with Figure 2 Compared to the description of some corresponding embodiments, Figure 4 In some corresponding embodiments, process 400 can provide an alarm for tasks in abnormal states. This prevents subsequent tasks from being blocked due to task abnormalities, ensuring smooth task processing.

[0082] Further reference Figure 5 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a task migration apparatus, which are similar to... Figure 2Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0083] like Figure 5 As shown, a task migration apparatus 500 in some embodiments includes: a detection unit 501 configured to detect whether there is server information that meets the target conditions in a preset server information table; a determination unit 502 configured to, in response to the existence, determine the server information that meets the target conditions as candidate server information to obtain a candidate server information group; and a migration unit 503 configured to perform migration processing on the tasks in the server corresponding to each candidate server information included in the candidate server information group.

[0084] In some optional implementations of some embodiments, the migration unit 503 is further configured to: lock the server information table and determine whether server information corresponding to the local server exists in the server information table; in response to determining that it exists, perform migration processing on the tasks in the server corresponding to the candidate server information.

[0085] In some optional implementations of certain embodiments, the migration unit 503 is further configured to: lock the candidate server information and determine the running status of the server corresponding to the candidate server information; in response to the running status being non-running, determine whether the time interval between the historical running time and the current time included in the candidate server information is greater than or equal to a preset interval; in response to the determination being yes, modify the information status included in the candidate server information to a downtime state, and migrate the tasks in the server corresponding to the candidate server information to the local server.

[0086] Optionally, migration unit 503 is further configured to: in response to determining that the local server does not exist, add the server information of the local server to the server information table to update the server information table.

[0087] Optionally, the device 500 further includes a selection unit, a processing unit, and a modification unit. The selection unit is configured to, in response to receiving an execution request for a task in a task table, select tasks whose task status meets preset conditions from the task table as tasks to be executed, thus obtaining a group of tasks to be executed. The processing unit is configured to, based on the task identifier of each task in the group of tasks to be executed, perform the following processing steps for each task in the group of tasks to be executed: locking the task to be executed and executing the task; in response to execution failure, re-executing the task to be executed; the modification unit is configured to, in response to the number of executions corresponding to the task to be executed being greater than or equal to a predetermined threshold, change the task status of the task to be executed to an abnormal state.

[0088] Optionally, the device 500 further includes a deletion unit configured to delete the aforementioned task to be executed in response to completion of execution.

[0089] Optionally, the device 500 further includes an early warning unit configured to provide early warning processing for tasks to be executed in abnormal states.

[0090] It is understandable that the units described in the device 500 are related to the reference. Figure 2 The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method also apply to the device 500 and the units contained therein, and will not be repeated here.

[0091] The following is for reference. Figure 6 It illustrates electronic devices suitable for implementing some embodiments of this disclosure (e.g., Figure 1 The diagram shows the structure of the computing device 101) 600. Electronic devices in some embodiments of this disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.

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

[0093] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 6 Each box shown can represent a device or multiple devices as needed.

[0094] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined above in the methods of some embodiments of this disclosure.

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

[0096] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0097] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: detect whether there is server information that meets the target conditions in a preset server information table; in response to the existence, determine the server information that meets the target conditions as candidate server information, thereby obtaining a candidate server information group; and perform migration processing on the tasks in the server corresponding to each candidate server information included in the candidate server information group.

[0098] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 remote computers, the remote computer can 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 can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0099] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0100] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a detection unit, a determination unit, and a migration unit. The names of these units do not necessarily limit the specific unit; for example, a migration unit may also be described as "a unit that performs migration processing on tasks in the server corresponding to each candidate server information included in the aforementioned candidate server information group."

[0101] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0102] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A task migration method, comprising: detecting whether there is server information satisfying a target condition in a preset server information table, wherein the target condition is that a time interval between a historical running time and a current time included in the server information is greater than or equal to a preset interval; in response to the existence, determining the server information satisfying the target condition as candidate server information to obtain a candidate server information group; migrating a task in a server corresponding to each candidate server information included in the candidate server information group, wherein the migrating the task in the server corresponding to each candidate server information included in the candidate server information group comprises: locking the server information table and determining whether there is server information corresponding to a local server in the server information table; in response to the existence being determined, migrating the task in the server corresponding to the candidate server information, wherein the migrating the task in the server corresponding to the candidate server information comprises: locking the candidate server information and determining a running state of the server corresponding to the candidate server information; in response to the running state being an unrunning state, determining whether the time interval between the historical running time and the current time included in the candidate server information is greater than or equal to the preset interval; in response to the determination being positive, modifying an information state included in the candidate server information to a down state, and migrating the task in the server corresponding to the candidate server information to the local server.

2. The method of claim 1, wherein, The migrating the task in the server corresponding to each candidate server information included in the candidate server information group further comprises: in response to the non-existence being determined, adding the server information of the local server to the server information table to update the server information table.

3. The method of claim 1, wherein, The method further comprises: in response to receiving an execution request for a task in a task table, selecting a task whose task state satisfies a preset condition from the task table as a to-be-executed task to obtain a to-be-executed task group; according to a task identifier of a to-be-executed task in the to-be-executed task group, performing the following processing steps on each to-be-executed task in the to-be-executed task group: locking the to-be-executed task and executing the to-be-executed task; in response to the execution failing, executing the to-be-executed task again; in response to a number of execution times corresponding to the to-be-executed task being greater than or equal to a predetermined threshold, changing a task state of the to-be-executed task to an abnormal state.

4. The method of claim 3, wherein, The method further comprises: in response to the execution being completed, deleting the to-be-executed task.

5. The method of claim 3, wherein, The method further comprises: performing a warning process on the to-be-executed task in the abnormal state. 6.A task migration apparatus, comprising: a detection unit configured to detect whether there is server information satisfying a target condition in a preset server information table, wherein the target condition is that a time interval between a historical running time and a current time included in the server information is greater than or equal to a preset interval; a determination unit configured to, in response to the existence, determine the server information satisfying the target condition as candidate server information to obtain a candidate server information group; The migration unit is configured to perform migration processing on a task in a server corresponding to each of the pieces of alternative server information included in the group of alternative server information, wherein the migration processing on the task in the server corresponding to each of the pieces of alternative server information included in the group of alternative server information comprises: locking the server information table and determining whether there is server information corresponding to the local server in the server information table; in response to a determination that there is, performing migration processing on a task in a server corresponding to the alternative server information, wherein the migration processing on the task in the server corresponding to the alternative server information comprises: locking the alternative server information and determining a running state of a server corresponding to the alternative server information; in response to the running state being an unrunning state, determining whether a time interval between a historical running time included in the alternative server information and a current time is greater than or equal to a preset interval; in response to a determination that it is, modifying an information state included in the alternative server information to a down state, and migrating a task in the server corresponding to the alternative server information to the local server. 7.An electronic device, comprising: one or more processors; a memory device having stored thereon one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any of claims 1-5.

8. A computer readable medium having stored thereon a computer program, wherein, the program, when executed by a processor, implements the method of any of claims 1-5. the program, when executed by a processor, implements the method of any of claims 1-5.

Citation Information

Patent Citations

  • Automatic operation and maintenance method and device based on Ignite and computer equipment

    CN112367386A