Task scheduling method, device and equipment

By identifying and processing the master node status in the task scheduling system and assigning tasks to multiple execution nodes, the problems of instability and low efficiency of the centralized scheduling system are solved, and high reliability and flexibility are achieved.

CN115391018BActive Publication Date: 2024-12-20CHINA CONSTRUCTION BANK +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202211206090.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2024-12-20
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

The centralized distributed task scheduling system has problems such as instability and low task scheduling efficiency, mainly because it depends on the master node, and the master node failure or performance bottleneck will affect the efficiency of task scheduling.

Method used

In the task scheduling system, the master node status information is determined by reading the master node record table. If the master node does not exist or is inactive, information entry is performed, and the pending tasks are allocated to multiple task execution nodes for execution, using sharding Process and load balancing to allocate subtasks to avoid relying on a single node.

Benefits of technology

It improves the success rate and efficiency of task scheduling, reduces resource waste, enhances the reliability and flexibility of the system, and supports combination execution of multiple task types and custom expansion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115391018B_ABST
    Figure CN115391018B_ABST
Patent Text Reader

Abstract

This application provides a task scheduling method, apparatus, and device, relating to the field of computer technology. The method includes: responding to a start command, reading a master node record table and determining the master node status information in the task scheduling system; if the master node status information indicates that there is currently no master node or the master node is inactive in the task scheduling system, then performing information entry processing on the master node record table; if it is determined that the information entry in the master node record table is successful, then obtaining the tasks to be processed and assigning the tasks to be processed to various task execution nodes in the system for execution. Furthermore, the above process can be implemented by any node in the task scheduling system, without relying on any single node for task scheduling, which can improve the success rate and efficiency of task scheduling and save resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a task scheduling method, device and equipment. Background Art

[0002] With the development of the financial industry, the number of various tasks is increasing, and the tasks are becoming more and more complex. Therefore, the reliability, throughput and operating efficiency of the task scheduling system are becoming higher and higher.

[0003] In the prior art, task scheduling is usually performed based on a centralized distributed task scheduling system. When a task execution instruction is received, a pre-set master node uniformly issues the task and schedules other nodes to execute the task.

[0004] However, in the prior art, a centralized distributed task scheduling system must deploy a certain master node, which has application limitations and relies on the scheduling of tasks performed by the master node, which is unstable. If the master node fails or encounters a performance bottleneck, the efficiency of task scheduling will be affected. Summary of the invention

[0005] The present application provides a task scheduling method, apparatus and device to solve the problems of instability and low task scheduling efficiency of centralized task scheduling methods.

[0006] In a first aspect, the present application provides a task scheduling method, the method being applied to a node in a task scheduling system, the system comprising at least two nodes, the method comprising:

[0007] In response to a start instruction, a master node record table is read, and master node status information in the task scheduling system is determined, wherein the master node record table is used to record address information of the master node in the task scheduling system and activity information of the master node, and the start instruction is used to indicate a task to be processed;

[0008] If it is determined that the master node status information indicates that there is no master node or the master node is inactive in the task scheduling system, information entry processing is performed on the master node record table;

[0009] If it is determined that the information entry into the master node record table is successful, the pending tasks are obtained, and the pending tasks are distributed to each task execution node in the system to execute the pending tasks.

[0010] In an optional implementation manner, if it is determined that the master node status information indicates that there is currently no master node in the task scheduling system or the master node is inactive, information entry processing is performed on the master node record table, including:

[0011] If it is determined that the address information of the master node does not exist in the master node record table, then information entry processing is performed on the master node record table;

[0012] Alternatively, if it is determined that the update time interval of the address information of the master node in the master node record table is greater than a preset threshold, information entry processing is performed on the master node record table.

[0013] In an optional implementation manner, performing information entry processing on the master node record table includes:

[0014] The address information corresponding to this node is entered into the master node record table.

[0015] In an optional implementation manner, allocating the to-be-processed tasks to each task execution node in the system to execute the to-be-processed tasks includes:

[0016] The task to be processed is divided into pieces to generate N subtasks, where N is a positive integer greater than or equal to 1;

[0017] The node load information of each task execution node in the system is read, and according to the node load information of each task execution node, each subtask is allocated to each task execution node to execute the task to be processed.

[0018] In an optional implementation, allocating each subtask to each task execution node to execute the task to be processed according to the node load information of each task execution node includes:

[0019] Determine the load difference between each task execution node according to the node load information of each task execution node;

[0020] According to the load difference between each task execution node, each subtask is evenly distributed to the corresponding task execution node to execute the task to be processed.

[0021] In an optional embodiment, the method further includes:

[0022] If it is determined that the address information of the master node exists in the master node record table, and the update time interval of the address information of the master node in the master node record table is less than or equal to the preset threshold, then the information entry into the master node record table is abandoned, and the task to be processed is received and executed.

[0023] In an optional embodiment, the method further includes:

[0024] If it is determined that the entry of the master node record table information fails, wait for receiving and executing the pending task.

[0025] In an optional implementation manner, the to-be-processed tasks may be a set of to-be-processed tasks that are customized and inserted by a user, and the set of to-be-processed tasks includes to-be-processed tasks of at least one task type.

[0026] In a second aspect, the present application provides a task scheduling device, the device is applied to a node in a task scheduling system, the system includes at least two nodes, and the device includes:

[0027] a determination unit, configured to read a master node record table in response to a start instruction, and determine master node status information in the task scheduling system, wherein the master node record table is used to record address information of the master node in the task scheduling system and activity information of the master node, and the start instruction is used to indicate a task to be processed;

[0028] A first processing unit is configured to perform information entry processing on the master node record table if it is determined that the master node status information indicates that there is currently no master node in the task scheduling system or the master node is inactive;

[0029] The second processing unit is used to obtain the pending tasks if it is determined that the information of the master node record table is successfully entered, and distribute the pending tasks to each task execution node in the system to execute the pending tasks.

[0030] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and a processor;

[0031] The memory is used to store computer programs;

[0032] The processor is used to read the computer program stored in the memory and execute the task scheduling method as described in the first aspect according to the computer program in the memory.

[0033] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the task scheduling method described in the first aspect is implemented.

[0034] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the task scheduling method described in the first aspect.

[0035] The task scheduling method, device and equipment provided by the present application are implemented through the following steps: in response to the startup instruction, the master node record table is read, and the master node status information in the task scheduling system is determined; if it is determined that the master node status information indicates that there is no master node or the master node is not active in the task scheduling system, the master node record table is processed for information entry; if it is determined that the master node record table information entry is successful, the pending tasks are obtained, and the pending tasks are assigned to each task execution node in the system to execute the pending tasks. And the above process can be implemented by any node in the task scheduling system, and does not rely on a certain node for task scheduling, which can improve the success rate and efficiency of task scheduling and save resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0037] Figure 1 A flowchart of a task scheduling method provided in an embodiment of the present application;

[0038] Figure 2 A flowchart of another task scheduling method provided in an embodiment of the present application;

[0039] Figure 3 A schematic diagram of the structure of a task scheduling device provided in an embodiment of the present application;

[0040] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0041] Figure 5 A block diagram of a terminal device provided in an embodiment of the present application.

[0042] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0043] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0044] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0045] Distributed task scheduling refers to a task scheduling method that assigns multiple tasks from an application or business to multiple servers for processing. Distributed task scheduling can solve problems such as insufficient resources on a single server and achieve the purpose of large-scale data computing. With the development of financial services, the number of tasks is increasing, and the tasks are becoming more and more complex, which places higher and higher requirements on the reliability, throughput, and operating efficiency of the task scheduling system.

[0046] In one example, the current mainstream distributed task scheduling systems are all centralized in design. When a task execution instruction is received, the pre-set master node will uniformly issue the task and schedule other nodes to execute the task.

[0047] However, the centralized distributed task scheduling system 1) is difficult to deploy and relies on the registration center. It requires additional deployment of the registration center service, which increases the deployment complexity; 2) The task throughput is not high. In the centralized task scheduling system, tasks are uniformly scheduled by the master node. The execution performance of the master node becomes a bottleneck, which affects the efficiency of task scheduling; 3) The cluster needs to deploy at least 3 nodes to achieve high availability, and has high requirements for resources; 4) It does not support the execution of multiple task types in combination, does not support custom extension of tasks, requires a lot of customized modifications, and has poor task extension capabilities.

[0048] Therefore, this application proposes a task scheduling method based on a decentralized distributed task scheduling system design concept, aiming to solve the above technical problems of the prior art.

[0049] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0050] Figure 1 A flowchart of a task scheduling method provided in an embodiment of the present application, the method is applied to a node in a task scheduling system, the system includes at least two nodes, such as Figure 1 As shown, the method includes:

[0051] 101. In response to a start instruction, read a master node record table and determine master node status information in a task scheduling system, wherein the master node record table is used to record address information and activity information of the master node in the task scheduling system, and the start instruction is used to indicate tasks to be processed.

[0052] Exemplarily, when receiving a startup instruction from a user, a node in the distributed task scheduling system responds to the startup instruction, reads a master node record table, and determines the master node status information in the current task scheduling system, wherein the master node record table is configured in the system and is a file used to record the address information and activity information of the master node in the task scheduling system, and the startup instruction is used to indicate tasks to be processed.

[0053] 102. If it is determined that the master node status information indicates that there is no master node or the master node is not active in the task scheduling system, information entry processing is performed on the master node record table.

[0054] Exemplarily, if it is determined through the master node status information in the current task scheduling system that there is no master node in the task scheduling system, or that the master node is in an inactive state in the task scheduling system, then the master node record table is processed for information entry. Wherein, when the master node is in an inactive state, it can be that the master node record table has no information update for more than a preset time, or it can be that the information representing the activity of the master node in the master node record table is less than a preset threshold.

[0055] 103. If it is determined that the information entry into the master node record table is successful, the pending tasks are obtained and the pending tasks are distributed to each task execution node in the system to execute the pending tasks.

[0056] Exemplarily, if it is determined that the information in the master node record table is successfully entered, for example, its own coding identification information or its own address information is successfully inserted into the master node record table, then the pending tasks indicated in the start instruction can be loaded and obtained, and the pending tasks can be distributed to each task execution node in the system to execute the pending tasks.

[0057] In summary, the task scheduling method provided in this embodiment includes the following steps: in response to the start instruction, the master node record table is read, and the master node status information in the task scheduling system is determined; if it is determined that the master node status information indicates that there is no master node or the master node is not active in the task scheduling system, the master node record table is processed for information entry; if it is determined that the information entry of the master node record table is successful, the pending tasks are obtained, and the pending tasks are assigned to each task execution node in the system to execute the pending tasks. In addition, the above process can be implemented by any node in the task scheduling system, and does not rely on a certain node for task scheduling, which can improve the success rate and efficiency of task scheduling and save resources.

[0058] Figure 2 A flowchart of another task scheduling method provided in an embodiment of the present application, the method is applied to a node in a task scheduling system, the system includes at least two nodes, such as Figure 2 As shown, the method includes:

[0059] 201. In response to a start instruction, read a master node record table and determine master node status information in a task scheduling system, wherein the master node record table is used to record address information and activity information of the master node in the task scheduling system, and the start instruction is used to indicate tasks to be processed.

[0060] Exemplarily, this step refers to step 101 and will not be described in detail.

[0061] 202. If it is determined that the master node status information indicates that there is no master node or the master node is not active in the task scheduling system, information entry processing is performed on the master node record table.

[0062] In one example, step 202 includes the following steps:

[0063] If it is determined that the address information of the master node does not exist in the master node record table, the address information corresponding to the current node is entered into the master node record table.

[0064] Alternatively, if it is determined that the update time interval of the address information of the master node in the master node record table is greater than a preset threshold, the address information corresponding to the node is entered into the master node record table.

[0065] Exemplarily, if it is determined that there is no master node in the task scheduling system or that the master node is in an inactive state in the task scheduling system by reading the master node status information in the master node record table, information entry processing is performed on the master node record table. Among them, when the address information of the master node does not exist in the master node record table, it can be considered that there is no master node in the task scheduling system, and when the update time interval of the address information of the master node in the master node record table is greater than a preset threshold, it can be considered that the master node is in an inactive state in the task scheduling system. The information entry processing on the master node record table can be to enter the address information corresponding to the node itself into the master node record table, or to enter its own coding identification information into the master node record table to update the master node record table.

[0066] 203. If it is determined that the information of the master node record table is successfully entered, the pending task is obtained, and the pending task is processed in pieces to generate N subtasks, where N is a positive integer greater than or equal to 1.

[0067] Exemplarily, if there is permission to enter information into the main node record table, and no other node has modified or updated the main node record table before, then information can be entered into the main node record table. If it is determined that the information entry into the main node record table is successful, it means that this node now acts as the main node in this task scheduling, and then can read the pending tasks indicated in the start instruction, load the pending tasks into the memory, and slice the pending tasks to generate N subtasks, where N is a positive integer greater than or equal to 1.

[0068] 204. Read the node load information of each task execution node in the system, and according to the node load information of each task execution node, distribute each subtask to each task execution node to execute the task to be processed.

[0069] In one example, step 204 includes the following steps:

[0070] Determine the load difference between each task execution node according to the node load information of each task execution node;

[0071] According to the load difference between each task execution node, each subtask is evenly distributed to the corresponding task execution node to execute the pending task.

[0072] Exemplarily, when this node is determined as the main node in this task scheduling, other nodes in the task scheduling system are automatically determined as task execution nodes. At this time, this main node reads the task execution nodes currently active in the task scheduling system and the node load information of each task execution node, and according to the node load information of each task execution node, allocates each subtask to each task execution node to execute the tasks to be processed.

[0073] In one example, the load difference between each task execution node can be calculated and determined based on the node load information of each task execution node; then, based on the load difference between each task execution node and the total task volume, each subtask is first pre-allocated to make up for the load difference of each task execution node, and then the remaining subtasks are evenly distributed to the corresponding task execution nodes.

[0074] In one example, when each task execution node receives the corresponding subtask, it can start the task execution service thread, which can load the corresponding subtask into memory, and the scheduled task thread delegates the subtask to the business thread pool for execution; the business thread will analyze the scheduling relationship of the subtasks, and if the subtask has a dependent parent task, it will first determine whether the parent task has been executed. If the parent task has not been executed, the parent task will be executed first; in this process, the business thread will find the corresponding task execution engine from the memory according to the type of subtask, pass the subtask parameters to the execution engine, and after the execution engine is completed, the business thread will update the execution status of the task. The node acting as the master node will also update the execution information of each subtask, and modify the status of each task to be executed.

[0075] In an example, in this task scheduling system, each node is equal. Any node can obtain the master node status information in the current system and enter information into the master node record table based on the current master node status information to compete for the master node of this task scheduling. When a node successfully enters its own information into the master node record table, it becomes the master node for task scheduling, and other nodes automatically become task execution nodes.

[0076] In summary, in this embodiment, if it is determined that the address information of the master node does not exist in the master node record table, or if it is determined that the update time interval of the address information of the master node in the master node record table is greater than the preset threshold, the address information corresponding to the node is entered into the master node record table. The current state of the master node in the system can be confirmed more accurately, and then subsequent information can be effectively entered according to the state information to compete for the master node, thereby improving the efficiency of the pre-preparation step of task scheduling and thus improving the efficiency of task scheduling. By slicing the task and balancing the subtasks to be processed according to the load information of each task execution node, the task execution efficiency can be improved.

[0077] One or more embodiments of the present application may also include: if it is determined that the address information of the master node exists in the master node record table, and the update time interval of the address information of the master node in the master node record table is less than or equal to a preset threshold, then abandoning the entry of information into the master node record table, and waiting to receive and execute the pending tasks.

[0078] Exemplarily, if it is determined that the address information of the master node exists in the master node record table, and the update time interval of the address information of the master node in the master node record table is less than or equal to the preset threshold, it is determined that there is a valid master node in the task scheduling system that can perform this task scheduling. Then this node abandons the information entry into the master node record table, automatically becomes a task execution node, and waits to receive and execute pending tasks.

[0079] To sum up, in this embodiment, if it is determined that there is a valid master node in the task scheduling system that can perform this task scheduling, the information entry into the master node record table is abandoned, and it automatically becomes the task execution node in this task scheduling. This process can effectively ensure the normal operation of the task scheduling system.

[0080] One or more embodiments of the present application may also include: if it is determined that the entry of information into the master node record table fails, waiting to receive and execute pending tasks.

[0081] For example, before this node enters information into the main node record table, other nodes have successfully entered information into the main node information table. At this time, this node does not have the authority to enter information into the main node record table, or cannot successfully enter information into the main node record table. At this time, this node automatically becomes the task execution node in this task scheduling, and waits to receive and execute pending tasks.

[0082] In summary, in this embodiment, the master node record table is set in an optimistic locking manner so that only one node can enter information into the master node record table. This process can effectively ensure the normal operation of the task scheduling system.

[0083] One or more embodiments of the present application may further include: the to-be-processed task may be a to-be-processed task set customized by a user, and the to-be-processed task set includes to-be-processed tasks of at least one task type.

[0084] Exemplarily, the pending tasks may be a set of customized pending tasks that are run by the user through a serial peripheral interface, and may include pending tasks of at least one task type, such as Hyper Text Transfer Protocol (HTTP) tasks, script tasks, and the like.

[0085] In summary, this embodiment supports the combined execution of multiple task types and supports customized extension of tasks, which can improve the versatility and flexibility of the task scheduling method.

[0086] Figure 3 A schematic diagram of the structure of a task scheduling device provided in an embodiment of the present application, the device is applied to a node in a task scheduling system, the system includes at least two nodes, such as Figure 3 As shown, the device comprises:

[0087] The determination unit 31 is used to respond to the start instruction, read the master node record table, and determine the master node status information in the task scheduling system, wherein the master node record table is used to record the address information and activity information of the master node in the task scheduling system, and the start instruction is used to indicate the task to be processed.

[0088] The first processing unit 32 is configured to perform information entry processing on the master node record table if it is determined that the master node status information indicates that there is no master node or the master node is inactive in the task scheduling system.

[0089] The second processing unit 33 is used to obtain the pending tasks if it is determined that the information in the master node record table is successfully entered, and distribute the pending tasks to each task execution node in the system to execute the pending tasks.

[0090] In one example, the first processing unit 32 includes:

[0091] The first determining subunit is used to perform information entry processing on the main node record table if it is determined that the address information of the main node does not exist in the main node record table.

[0092] The second determining subunit is used to perform information entry processing on the master node record table if it is determined that the update time interval of the address information of the master node in the master node record table is greater than a preset threshold.

[0093] In one example, the first processing unit 32 further includes:

[0094] The first processing subunit is used to enter the address information corresponding to the node into the main node record table.

[0095] In one example, the second processing unit 33 includes:

[0096] The second processing sub-unit is used to process the task to be processed in pieces to generate N sub-tasks, where N is a positive integer greater than or equal to 1.

[0097] The third processing sub-unit is used to read the node load information of each task execution node in the system, and according to the node load information of each task execution node, allocate each sub-task to each task execution node to execute the task to be processed.

[0098] In one example, the third processing subunit includes:

[0099] The determination module is used to determine the load difference between each task execution node according to the node load information of each task execution node.

[0100] The processing module is used to evenly distribute each subtask to the corresponding task execution node according to the load difference between each task execution node to execute the task to be processed.

[0101] In one example, the device further includes:

[0102] The third processing unit is used to abandon the entry of information into the main node record table and wait for receiving and executing tasks to be processed if it is determined that the address information of the main node exists in the main node record table and the update time interval of the address information of the main node in the main node record table is less than or equal to a preset threshold.

[0103] In one example, the device further includes:

[0104] The fourth processing unit is used to wait for receiving and executing pending tasks if it is determined that the entry of information into the master node record table fails.

[0105] In one example, the to-be-processed task may be a to-be-processed task set that is customized and inserted by a user, and the to-be-processed task set includes to-be-processed tasks of at least one task type.

[0106] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the electronic device includes: a memory 41 and a processor 42.

[0107] Memory, used to store computer programs.

[0108] The processor is used to read the computer program stored in the memory and execute the task scheduling method of any of the above embodiments according to the computer program in the memory.

[0109] Figure 5 A block diagram of a terminal device provided in an embodiment of the present application, which device may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0110] The device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0111] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0112] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0113] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0114] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0115] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0116] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0117] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800 and the temperature change of the device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.

[0118] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0119] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0120] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0121] An embodiment of the present application also provides a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method provided by the above embodiment.

[0122] An embodiment of the present application also provides a computer program product, which includes: a computer program, which is stored in a readable storage medium, and at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.

[0123] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0124] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A task scheduling method, characterized in that: The method is applied to a node in a task scheduling system, the system includes at least two nodes, and the method includes: In response to a start instruction, a master node record table is read, and master node status information in the task scheduling system is determined, wherein the master node record table is used to record address information of the master node in the task scheduling system and activity information of the master node, and the start instruction is used to indicate a task to be processed; If it is determined that the address information of the master node does not exist in the master node record table or it is determined that the update time interval of the address information of the master node in the master node record table is greater than a preset threshold, the address information or coding identification information corresponding to the node is entered into the master node record table; If it is determined that the information entry into the master node record table is successful, the pending tasks are obtained, and the pending tasks are distributed to each task execution node in the system to execute the pending tasks.

2. The method according to claim 1, characterized in that Allocating the tasks to be processed to each task execution node in the system to execute the tasks to be processed includes: The task to be processed is divided into pieces to generate N subtasks, where N is a positive integer greater than or equal to 1; The node load information of each task execution node in the system is read, and according to the node load information of each task execution node, each subtask is allocated to each task execution node to execute the task to be processed.

3. The method according to claim 2, characterized in that According to the node load information of each task execution node, each subtask is allocated to each task execution node to execute the task to be processed, including: Determine the load difference between each task execution node according to the node load information of each task execution node; According to the load difference between each task execution node, each subtask is evenly distributed to the corresponding task execution node to execute the task to be processed.

4. The method according to claim 1, characterized in that The method further comprises: If it is determined that the address information of the master node exists in the master node record table, and the update time interval of the address information of the master node in the master node record table is less than or equal to the preset threshold, then the information entry into the master node record table is abandoned, and the task to be processed is received and executed.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: If it is determined that the entry of the master node record table information fails, wait for receiving and executing the pending task.

6. The method according to any one of claims 1 to 4, characterized in that The to-be-processed tasks may be a set of to-be-processed tasks that are customized and inserted by a user, and the set of to-be-processed tasks includes to-be-processed tasks of at least one task type.

7. A task scheduling device, characterized in that: The device is applied to a node in a task scheduling system, the system includes at least two nodes, and the device includes: a determination unit, configured to read a master node record table in response to a start instruction, and determine master node status information in the task scheduling system, wherein the master node record table is used to record address information of the master node in the task scheduling system and activity information of the master node, and the start instruction is used to indicate a task to be processed; A first processing unit is configured to enter the address information or coding identification information corresponding to the node into the master node record table if it is determined that the address information of the master node does not exist in the master node record table or if it is determined that the update time interval of the address information of the master node in the master node record table is greater than a preset threshold; The second processing unit is used to obtain the pending tasks if it is determined that the information of the master node record table is successfully entered, and distribute the pending tasks to each task execution node in the system to execute the pending tasks.

8. An electronic device, characterized in that: The electronic device comprises a memory and a processor; The memory is used to store computer programs; The processor is used to read the computer program stored in the memory and execute the task scheduling method according to any one of claims 1 to 6 according to the computer program in the memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the task scheduling method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the task scheduling method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Distributed task scheduling method and system based on messaging middleware

    CN102521044A

  • Load balancing method and device for distributed database

    CN111625592A

  • Load balancing control method and device and computer readable storage medium

    CN113553171A

  • Method and apparatus for scheduling task processing entity

    US20220083375A1

  • Task allocation method and system

    WO2017045553A1