Task management method and device, equipment and medium
By acquiring scheduled tasks and determining the execution host on the task management platform, forming an associated database, generating and issuing execution instructions, the complexity of traditional scheduled task execution in a multi-node environment is solved, achieving efficient task management and execution.
Patent Information
- Application Number
- CN202511117719.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-21
AI Technical Summary
Traditional single-machine environment scheduled task technology cannot meet the needs of multi-node log cleaning and data processing, resulting in complex configuration, inconvenient maintenance, and difficulty in achieving efficient scheduled task execution in different network environments.
The task management platform obtains the scheduled task, determines the execution host, and associates the task with the host in an associated database. Execution instructions are generated based on preset conditions and sent to the connection port to complete the task.
It enables automated correlation analysis between scheduled tasks and execution hosts, ensuring that the execution host accurately receives instructions to complete tasks, thereby improving the efficiency of task scheduling and the maintainability of the system.
Smart Images

Figure CN120994341A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of microservices technology, and in particular to a task management method, apparatus, device and medium. Background Technology
[0002] With the popularity of microservice applications and distributed architectures, traditional timed task technology running in a single-machine environment can no longer meet the needs of current information systems for multi-node log cleaning, data processing, and other scenarios. It also has problems such as complex configuration operations, inconvenient maintenance, and difficulty in viewing execution results, which restricts the improvement of automated operation and maintenance.
[0003] Currently, most scheduled task management solutions employ distributed scheduled task scheduling systems, characterized by their distributed nature and visualization. These systems are typically designed for high-concurrency, large-scale batch processing tasks. Most solutions utilize a centralized scheduling architecture combined with distributed execution to manage task configuration and schedule execution. However, in automated operations and maintenance, this approach struggles to execute point-to-point scheduled tasks on target hosts in different network environments, leading to complex workflows and low efficiency.
[0004] Therefore, how to automatically perform correlation analysis between scheduled tasks and execution hosts, so as to accurately enable the execution hosts to receive execution instructions to complete the tasks, has become an urgent problem to be solved. Summary of the Invention
[0005] In view of this, embodiments of this application provide a task management method, apparatus, device, and medium to solve the problem of how to automatically perform correlation analysis between timed tasks and execution hosts, thereby accurately enabling the execution host to receive execution instructions to complete the task.
[0006] In a first aspect, embodiments of this application provide a task management method, including: Obtain several scheduled tasks created by the user on the task management platform, and determine the execution host to execute the scheduled tasks based on the scheduled tasks; Each of the scheduled tasks and the corresponding execution host of the scheduled task are stored as associated data to obtain an associated database; According to the preset execution conditions, the scheduled tasks in the associated database are traversed. If the scheduled task meets the execution conditions, the host identifier of the execution host is obtained. Based on the host identifier and the task command, the execution instruction corresponding to the execution host is formed. The execution instruction is sent to the connection port, and the execution instruction at the connection port is used to be obtained by the corresponding execution host to execute the corresponding execution instruction and complete the task.
[0007] Secondly, an embodiment of this application provides a task management device, comprising: The execution host determination module is used to obtain several scheduled tasks created by the user on the task management platform, and determine the execution host to execute the scheduled tasks based on the scheduled tasks. The associated data storage module is used to store any of the scheduled tasks and the corresponding execution host of the scheduled tasks as associated data to obtain an associated database; The execution instruction generation module is used to traverse the timed tasks in the associated database according to preset execution conditions. If the timed task meets the execution conditions, the host identifier of the execution host is obtained, and the execution instruction corresponding to the execution host is generated according to the host identifier and the task command. The instruction execution module is used to send the execution instruction to the connection port. The execution instruction at the connection port is used to be obtained by the corresponding execution host to execute the corresponding execution instruction and complete the task.
[0008] Thirdly, embodiments of this application provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the task management method as described in the first aspect.
[0009] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the task management method as described in the first aspect.
[0010] The beneficial effects of the embodiments in this application compared with the prior art are: This application acquires several scheduled tasks created by the user on a task management platform. Based on the scheduled tasks, it determines the execution host for each task. Each scheduled task and its corresponding execution host are stored as association data to form an association database. According to preset execution conditions, the system iterates through the scheduled tasks in the association database. If a scheduled task meets the execution conditions, it obtains the host identifier of the execution host. Based on the host identifier and the task command, it generates an execution instruction for the corresponding execution host and sends it to the connection port. The execution instruction at the connection port is then received by the corresponding execution host to execute the corresponding instruction and complete the task. By acquiring scheduled tasks from the task management platform, determining the execution host, and storing the association data to form an association database, and then iterating through the database according to preset execution conditions, if a scheduled task meets the preset execution conditions, an execution instruction for the corresponding execution host is generated and sent to the connection port for the execution host to execute, thus completing the task, the system automatically performs association analysis between scheduled tasks and execution hosts to accurately ensure that the execution host receives the execution instruction to complete the task. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram of an application environment for a task management method provided in Embodiment 1 of this application; Figure 2 This is a flowchart illustrating a task management method provided in Embodiment 2 of this application; Figure 3 This is a flowchart illustrating a task management method provided in Embodiment 3 of this application; Figure 4 This is a flowchart illustrating a task management method provided in Embodiment 4 of this application; Figure 5 This is a flowchart illustrating a task management method provided in Embodiment 5 of this application; Figure 6 This is a schematic diagram of the structure of a task management device provided in Embodiment Six of this application; Figure 7 This is a schematic diagram of the structure of a computer device provided in Embodiment 7 of this application. Detailed Implementation
[0013] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0014] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0015] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0016] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0017] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0018] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0019] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0020] To illustrate the technical solution of this application, specific embodiments are described below.
[0021] The task management method provided in Embodiment 1 of this application can be applied to, for example, Figure 1 In this application environment, the client and server communicate with each other. Users can provide task management conditions, requirements, and operation instructions through the client. The server generates control instructions for task management methods based on the content sent by the client. The client includes, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0022] See Figure 2 This is a flowchart illustrating a task management method provided in Embodiment 2 of this application. The above-described task management method can be applied to... Figure 1The server-side component.
[0023] like Figure 2 As shown, the task management method may include the following steps: Step S201: Obtain several scheduled tasks created by the user on the task management platform, and determine the execution host to execute the scheduled tasks based on the scheduled tasks. Optionally, determining the execution host for executing the scheduled task based on the scheduled task in step S201 may include the following steps: Based on the scheduled task, obtain the execution address for running the scheduled task; Based on the running address, determine the execution host for the scheduled task.
[0024] The task management platform is a system interface or service that provides users with the ability to create and manage scheduled tasks. Users can set various attributes for scheduled tasks on this platform, such as the task name, execution time (e.g., a specific time each day, a fixed date each week), execution frequency (e.g., every few minutes or hours), and the specific operations the task will perform (e.g., running scripts, calling APIs). All scheduled task information created by the user is retrieved from the task management platform's database or related storage location.
[0025] The runtime address refers to the specific location that needs to be accessed or operated upon to execute the scheduled task. It can take many forms, depending on the nature of the task. If the scheduled task is executing a local script, the runtime address might be the path to that script in the server's file system; if the scheduled task is calling a remote service interface, the runtime address might be the URL of that interface.
[0026] The execution address is determined based on the definition of the scheduled task. When the task is created, the user has explicitly specified the path of the script to be executed or the URL of the interface to be called, or the system generates the execution address according to certain rules based on the task type and configuration information.
[0027] Different execution addresses correspond to different hosts, and the execution address is directly associated with the host that executes the task. For the execution address of a local script, the execution host is usually the server itself that stores the script. Because the script is in the local server's file system, only that server can directly access and execute the script. For the execution address of a remote service interface, the execution host is the server that provides the service. You need to connect to this server via the network and send a request to execute the task.
[0028] When determining the execution host, in addition to the direct association with the running address, other factors are considered, such as the host's load, performance metrics, and permission settings. For example, if multiple servers can execute a certain task, the server with the lightest load is selected to ensure the task's execution efficiency.
[0029] Step S202: Store any of the scheduled tasks and the corresponding execution host of the scheduled tasks as associated data to obtain an associated database; Optionally, step S202 may include the following steps: Extract the task execution information of the scheduled task, and store the task execution information and the corresponding execution host of the scheduled task as associated data to obtain an associated database.
[0030] Optionally, after step S202, the following steps may also be included: Analyze the scheduled tasks in the associated database. If they meet the preset storage conditions, then organize the data in the associated database to obtain organized associated data. The organized and associated data is cached to obtain a cache database.
[0031] In the previous steps, the execution host corresponding to each scheduled task has been determined. Here, the scheduled task and its corresponding execution host are combined into associated data. For example, if the execution host corresponding to the scheduled task "Back up the database every day at 2 AM" is "Server001", then the associated data is the combination of these two.
[0032] These related data are stored in a dedicated database, known as the relational database. The purpose of the relational database is to facilitate subsequent management and querying of the relationship between scheduled tasks and execution hosts. When a scheduled task needs to be executed, the corresponding execution host can be quickly found through the relational database; similarly, information can be retrieved from the relational database to see which scheduled tasks a particular execution host is responsible for. This storage method helps improve system maintainability and task scheduling efficiency.
[0033] In addition to the task description and execution host, scheduled tasks also include execution-related information, such as the task execution time (down to the year, month, day, hour, minute, and second), execution frequency (e.g., daily, weekly, monthly), execution parameters (if the task requires specific parameters, such as the backup path and backup file name when backing up a database), and task priority.
[0034] The task execution information, along with the corresponding execution host, is stored as associated data in an associated database. This makes the data in the associated database more comprehensive, providing more information for subsequent task scheduling and management. For example, the execution order of tasks can be adjusted based on task priority, and task scheduling plans can be more precisely arranged based on execution time and frequency.
[0035] Preset storage conditions can be set according to system requirements and management strategies. For example, storage conditions can be based on task execution frequency, such as only processing tasks with high execution frequency (e.g., multiple times per day), or task importance, such as processing only high-priority tasks. The system iterates through all scheduled tasks in the associated database and filters out tasks that meet the preset storage conditions.
[0036] The process of organizing related data includes operations such as deduplication, merging, and sorting. For example, if multiple records of the same scheduled tasks and their associated execution hosts exist, deduplication is performed; related task information is merged to make the data more compact; and the data is sorted according to task execution time or priority to facilitate subsequent queries and scheduling. Through data organization, the quality and availability of related data can be improved, data redundancy can be reduced, the data structure can be made clearer, and the system can process data efficiently.
[0037] A cache database is a high-speed storage mechanism that allows for rapid data read and write. Storing organized relational data in a cache database can improve the system's access speed to this data. When a scheduled task needs to be executed, the system can first retrieve the relevant relational information from the cache database, instead of accessing the relational database every time, thereby reducing database access pressure and improving system response speed and overall performance.
[0038] Step S203: According to the preset execution conditions, traverse the scheduled tasks in the associated database. If the scheduled task meets the execution conditions, obtain the host identifier of the execution host. Based on the host identifier and the task command, form the execution instruction corresponding to the execution host. The preset execution conditions are pre-defined by the system based on business needs and are used to determine whether a scheduled task should be executed at the current time. Execution conditions can include time conditions, task status conditions, and other conditions.
[0039] The time condition can refer to setting the task to execute at 8:00 AM daily, or to execute every two hours. The system will compare the current time with the task's set execution time to see if the requirements are met.
[0040] Task status conditions can refer to different states of a task, such as "pending execution," "paused," and "completed." Only tasks in the "pending execution" state will be considered for execution.
[0041] Other conditions may refer to the task's priority, whether prerequisite tasks have been completed, etc. For example, some tasks can only be executed after other specific tasks have been completed.
[0042] The system checks each scheduled task in the associated database to see if it meets the preset execution conditions. The associated database stores the association information between scheduled tasks and the execution host, as well as possible task execution information (such as execution time, frequency, etc.), which provides a data foundation for filtering tasks that meet the conditions.
[0043] When a scheduled task passes the execution condition check, it is determined to be a task that needs to be executed. For scheduled tasks that meet the execution conditions, the system retrieves the host identifier of the corresponding execution host from the associated database. The host identifier is information that uniquely identifies the execution host, and common forms include IP address and hostname. For example, if the execution host of a scheduled task is a server with an IP address of 192.168.1.100, then the system will obtain this IP address as the host identifier.
[0044] A task command specifies the concrete operation that the host needs to perform. It can be a simple script command, such as executing a script, or a complex API call request, such as sending a request to a service to complete a specific business operation.
[0045] The system combines the acquired host identifier and task command to form a complete execution instruction. This execution instruction accurately tells the host where to perform what operation (via the task command).
[0046] Step S204: The execution instruction is sent to the connection port. The execution instruction at the connection port is used to be obtained by the corresponding execution host to execute the corresponding execution instruction and complete the task.
[0047] In computer network communication, a port is a logical channel through which a device interacts with the outside world. Each network application typically listens on a specific port to receive and send data. The connection port here is a pre-defined channel used by the system to receive and distribute execution instructions. It can be a network port (such as a TCP port) on a physical server or a logical port in a virtual environment.
[0048] The system will send the execution instructions previously generated based on the scheduled task to the designated connection port. This process involves network communication and data transmission. The system will encapsulate the execution instructions into data packets according to a certain network protocol (such as TCP / IP) and then send them to the connection port through the network interface. For example, the system may use Python's socket library to create a network connection and send instruction data.
[0049] The corresponding execution host needs to listen on the connection port to promptly receive execution instructions. The execution host typically runs a listening program that continuously monitors the specified connection port, capturing any new instruction data that arrives. After receiving the execution instructions, the execution host needs to parse the instruction data. Since the execution instructions are transmitted in the form of data packets, the execution host reconstructs the original execution instructions from the data packets according to the corresponding protocol and format. For example, if the instructions are encapsulated in JSON format, the execution host needs to use a JSON parser to parse them into recognizable instruction content.
[0050] After parsing the execution instructions, the execution host will perform the corresponding operations based on the instructions. If the execution instruction is a script command, the execution host will start the corresponding script interpreter to execute the script; if it is an API call request, the execution host will send a request to the specified service address. Once the execution host completes the corresponding operations according to the execution instructions, the task is considered complete. During task execution, the execution host may generate some execution results or log information, which can be fed back to the system for further processing and recording, facilitating subsequent monitoring and management.
[0051] This application acquires several scheduled tasks created by the user on a task management platform. Based on the scheduled tasks, it determines the execution host for each task. Each scheduled task and its corresponding execution host are stored as association data to form an association database. According to preset execution conditions, the system iterates through the scheduled tasks in the association database. If a scheduled task meets the execution conditions, it obtains the host identifier of the execution host. Based on the host identifier and the task command, it generates an execution instruction for the corresponding execution host and sends it to the connection port. The execution instruction at the connection port is then received by the corresponding execution host to execute the corresponding instruction and complete the task. By acquiring scheduled tasks from the task management platform, determining the execution host, and storing the association data to form an association database, and then iterating through the database according to preset execution conditions, if a scheduled task meets the preset execution conditions, an execution instruction for the corresponding execution host is generated and sent to the connection port for the execution host to execute, thus completing the task, the system automatically performs association analysis between scheduled tasks and execution hosts to accurately ensure that the execution host receives the execution instruction to complete the task.
[0052] See Figure 3 This is a flowchart illustrating a task management method provided in Embodiment 3 of this application. Figure 3 As shown, the preset execution conditions include the execution cycle and the task start time. The step S203 above, which involves traversing the scheduled tasks in the associated database according to the preset execution conditions, may include the following steps: Step S301: Determine the start order of the timed tasks based on the task start time; Step S302: Determine the execution interval of the timed task based on the execution cycle; Step S303: Traverse the scheduled tasks in the associated database and determine the execution order of the scheduled tasks according to the start order and the execution interval.
[0053] The start time of a scheduled task refers to the specific moment when the task is first executed. It can be a setting accurate to a specific date and time, or it can be a relative time, such as "1 hour after system startup".
[0054] The tasks are assigned in chronological order, with the earliest start date listed first. This process is repeated to determine the start order of each scheduled task. For example, if there are three scheduled tasks, with task A starting at 9:00 AM on August 10th, task B starting at 10:00 AM on August 10th, and task C starting at 11:00 AM on August 10th, then the start order would be task A first, task B second, and task C third.
[0055] The execution cycle describes the pattern of repeated execution of a scheduled task. The execution cycle can be daily, weekly, monthly, or a more flexible custom cycle, such as every 3 hours or every 5 minutes.
[0056] The execution cycle allows us to calculate the time interval between each task execution. For example, if a task is executed once a day, the execution interval is 24 hours; if it's executed every 2 hours, the interval is 2 hours. The execution interval is a crucial basis for determining the overall execution order of tasks.
[0057] The order of execution can only be determined by the start order. However, for scheduled tasks that require repeated execution, the execution interval must also be considered to determine the complete execution order. When traversing the scheduled tasks in the associated database, the system comprehensively considers the start order and execution interval of each task to construct a comprehensive task execution schedule.
[0058] In this embodiment, the system can comprehensively and accurately determine the execution order of scheduled tasks in the associated database. It not only considers the order in which tasks are first executed, but also takes into account the execution cycle of the tasks, providing a clear time plan for the scheduling and execution of subsequent tasks, and ensuring that scheduled tasks can be executed in an orderly manner as expected.
[0059] See Figure 4 This is a flowchart illustrating a task management method provided in Embodiment 4 of this application. Figure 4 As shown, step S203, which involves forming an execution instruction corresponding to the execution host based on the host identifier and the task command, may include the following steps: Step S401: Extract the host communication public key from the host identifier and determine whether the host communication public key conforms to the preset verification key; Step S402: If the host communication public key matches the preset verification key, then the task command is combined to form an execution instruction corresponding to the execution host.
[0060] In network communication and security authentication systems, the host communication public key is a public key that appears in pairs with the private key. It is used for encrypting and decrypting data and for authentication. The host communication public key is generated or assigned when the host registers or configures itself in the system, and is used for secure communication with other system components. It is contained in the host identification information and is a cryptographic representation of the host's identity.
[0061] The host identifier contains various information about the host, such as its IP address, hostname, and public key. The system needs to extract the host's communication public key from the host identifier for subsequent verification operations.
[0062] The preset verification key is a key pre-set by the system for verifying the host's communication public key. It can be a fixed key or a dynamically generated key according to certain rules. The verification key is stored in the system's security configuration, and only authorized host communication public keys can be matched with it.
[0063] Determining whether a host communication public key conforms to a preset verification key is achieved through specific encryption algorithms and verification logic. For example, a digital signature algorithm might be used, where the system uses a preset verification key to verify the host communication public key, checking whether it has been legally signed and authorized.
[0064] When the host communication public key passes the verification of the preset verification key, it indicates that the execution host is an authorized and legitimate host. At this point, the system can confidently associate task commands with this host to form execution instructions.
[0065] Successful verification indicates that the executing host has a legitimate identity and permissions, and is able to securely receive and execute task commands, avoiding the sending of instructions to illegal or unauthorized hosts, thereby reducing the risk of system attacks or data leaks.
[0066] Combining the task command and the verified host identifier, the system generates execution instructions according to a specific format and rules. These instructions contain relevant information about the executing host (such as the host identifier) and the specific task command, enabling the host to accurately identify the task it needs to perform.
[0067] For example, an execution instruction might be a string containing the host IP address, task command, and necessary parameters, sent to the execution host via a network protocol. Upon receiving the instruction, the execution host can perform the corresponding operation based on the information contained within it.
[0068] This application enhances the security of the execution instruction generation process by verifying the host communication public key. Only authorized execution hosts can receive valid execution instructions, ensuring that the execution of scheduled tasks takes place in a secure and reliable environment. This is crucial for protecting sensitive system data and critical business operations. See Figure 5 This is a flowchart illustrating a task management method provided in Embodiment 5 of this application. Figure 5 As shown, step S203, which involves forming an execution instruction corresponding to the execution host based on the host identifier and the task command, may include the following steps: Step S501: Determine the execution operation of the execution host according to the task command; Step S502: Based on the host identifier and the execution operation, an execution instruction corresponding to the execution host is formed.
[0069] In this context, a task command is an abstract description of the task to be performed. It expresses the core requirements of the task in concise language or code, without directly corresponding to specific execution actions. For example, a task command might be "backup the database," which is only a high-level task description and doesn't detail how to perform the backup.
[0070] The system needs to parse and refine the task commands, translating them into specific operations that the executing host can actually perform. For the task command "Back up the database," the operations may include connecting to the database server, selecting the database to be backed up, specifying the storage path for the backup files, and executing the backup command, among other specific steps. The system will determine the specific execution operation based on the type and requirements of the task command, combined with the environment and capabilities of the executing host. This may involve various methods such as calling system commands, running scripts, or calling APIs.
[0071] A host identifier is a unique identifier for the execution host, such as an IP address or hostname. It determines which specific execution host the execution command should be sent to. Different execution hosts may have different configurations and environments, therefore, the host identifier is needed to ensure that the execution command is delivered accurately and executed on the correct host.
[0072] The system combines the defined execution operations with the host identifier to form a complete execution instruction. This instruction not only includes the specific operation details but also specifies the host on which to perform these operations. Such an instruction accurately instructs the host to perform the corresponding operation within its own environment and complete the task.
[0073] In this embodiment of the application, by refining the task commands and combining them with the host identifier, the abstract task requirements are transformed into specific, executable instructions, providing clear operational guidance for the execution host and ensuring that the scheduled task can be executed accurately on the specified host.
[0074] Corresponding to the task management method in the above embodiments, Figure 6 This paper shows a structural block diagram of a task management device provided in Embodiment Six of this application. The task management device can be applied to... Figure 1 The server-side component is shown. For ease of explanation, only the parts relevant to the embodiments of this application are shown.
[0075] See Figure 6 The task management device includes: The execution host determination module 61 is used to obtain a number of scheduled tasks created by the user on the task management platform, and determine the execution host to execute the scheduled tasks based on the scheduled tasks. The associated data storage module 62 is used to store any of the scheduled tasks and the corresponding execution host of the scheduled tasks as associated data to obtain an associated database; The execution instruction generation module 63 is used to traverse the timed tasks in the associated database according to the preset execution conditions. If the timed task meets the execution conditions, the host identifier of the execution host is obtained, and the execution instruction corresponding to the execution host is generated according to the host identifier and the task command. The instruction execution module 64 is used to send the execution instruction to the connection port. The execution instruction at the connection port is used to be obtained by the corresponding execution host to execute the corresponding execution instruction and complete the task.
[0076] Optionally, the execution host determination module 61 includes: The runtime address acquisition unit is used to obtain the runtime address for running the scheduled task based on the scheduled task. An execution determination unit is used to determine the execution host for executing the timed task based on the running address.
[0077] Optionally, the associated data storage module 62 further includes: The data association unit is used to extract the task execution information of the scheduled task, store the task execution information and the corresponding execution host of the scheduled task as association data, and obtain an association database.
[0078] Optionally, the task management device further includes: The data processing module is used to analyze the timed tasks in the associated database after storing any of the timed tasks and the corresponding execution host of the timed tasks as associated data to obtain an associated database. If the data meets the preset storage conditions, the data in the associated database is processed to obtain processed associated data. The data caching module is used to cache the organized and related data to obtain a cache database.
[0079] Optionally, the execution instruction forming module 63 includes: The start order determination unit is used to determine the start order of the timed tasks based on the task start time. An execution interval determination unit is used to determine the execution interval time of the timed task based on the execution cycle. The execution order determination unit is used to traverse the scheduled tasks in the associated database and determine the execution order of the scheduled tasks according to the start order and the execution interval.
[0080] Optionally, the execution instruction forming module 63 includes: The judgment unit is used to extract the host communication public key from the host identifier and determine whether the host communication public key conforms to the preset verification key; An execution unit is configured to, if the host communication public key matches the preset verification key, combine the task command to form an execution instruction corresponding to the execution host.
[0081] Optionally, the execution instruction forming module 63 includes: An operation determination unit is used to determine the execution operation of the execution host based on the task command. The instruction forming unit is used to form an execution instruction corresponding to the execution host based on the host identifier and the execution operation.
[0082] It should be noted that the information interaction and execution process between the above modules, units, and sub-units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0083] Figure 7 This is a schematic diagram of the structure of a computer device provided in Embodiment Seven of this application. Figure 7 As shown, the computer device of this embodiment includes: at least one processor ( Figure 7 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, wherein the processor executes the computer program to implement the steps of any of the above-described task management methods or task management method embodiments.
[0084] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 7 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0085] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0086] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of the computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0087] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0088] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on a computer device, it enables the computer device to execute the steps in the above method embodiments.
[0089] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0090] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0091] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0092] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0093] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A task management method, characterized in that, include: Obtain several scheduled tasks created by the user on the task management platform, and determine the execution host to execute the scheduled tasks based on the scheduled tasks; Each of the scheduled tasks and the corresponding execution host of the scheduled task are stored as associated data to obtain an associated database; According to the preset execution conditions, the scheduled tasks in the associated database are traversed. If the scheduled task meets the execution conditions, the host identifier of the execution host is obtained. Based on the host identifier and the task command, the execution instruction corresponding to the execution host is formed. The execution instruction is sent to the connection port, and the execution instruction at the connection port is used to be obtained by the corresponding execution host to execute the corresponding execution instruction and complete the task.
2. The task management method according to claim 1, characterized in that, The step of determining the execution host for executing the scheduled task based on the scheduled task includes: Based on the scheduled task, obtain the execution address for running the scheduled task; Based on the running address, determine the execution host for the scheduled task.
3. The task management method according to claim 1, characterized in that, The step of storing any one of the scheduled tasks and the corresponding execution host of the scheduled task as associated data to obtain an associated database includes: Extract the task execution information of the scheduled task, and store the task execution information and the corresponding execution host of the scheduled task as associated data to obtain an associated database.
4. The task management method according to claim 1, characterized in that, After storing any of the scheduled tasks and the corresponding execution host of the scheduled task as associated data to obtain an associated database, the method further includes: Analyze the scheduled tasks in the associated database. If they meet the preset storage conditions, then organize the data in the associated database to obtain organized associated data. The organized and associated data is cached to obtain a cache database.
5. The task management method according to claim 1, characterized in that, The preset execution conditions include the execution cycle and the task start time; The step of traversing the scheduled tasks in the associated database according to preset execution conditions includes: The start order of the timed tasks is determined based on the task start time. The execution interval of the scheduled task is determined based on the execution cycle. The scheduled tasks in the associated database are traversed, and the execution order of the scheduled tasks is determined according to the start order and the execution interval.
6. The task management method according to claim 1, characterized in that, The step of forming an execution instruction corresponding to the execution host based on the host identifier and the task command includes: Extract the host communication public key from the host identifier and determine whether the host communication public key conforms to the preset verification key; If the host communication public key matches the preset verification key, then the task command is combined to form the execution instruction corresponding to the execution host.
7. The task management method according to any one of claims 1 to 6, characterized in that, The step of forming an execution instruction corresponding to the execution host based on the host identifier and the task command includes: Based on the task command, determine the execution operation of the execution host; Based on the host identifier and the execution operation, an execution instruction corresponding to the execution host is formed.
8. A task management device, characterized in that, include: The execution host determination module is used to obtain several scheduled tasks created by the user on the task management platform, and determine the execution host to execute the scheduled tasks based on the scheduled tasks. The associated data storage module is used to store any of the scheduled tasks and the corresponding execution host of the scheduled tasks as associated data to obtain an associated database; The execution instruction generation module is used to traverse the timed tasks in the associated database according to preset execution conditions. If the timed task meets the execution conditions, the host identifier of the execution host is obtained, and the execution instruction corresponding to the execution host is generated according to the host identifier and the task command. The instruction execution module is used to send the execution instruction to the connection port. The execution instruction at the connection port is used to be obtained by the corresponding execution host to execute the corresponding execution instruction and complete the task.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the task management method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the task management method as described in any one of claims 1 to 7.