CN115391018A - Task scheduling method, device and equipment - Google Patents
Task scheduling method, device and equipment Download PDFInfo
- Publication number
- CN115391018A CN115391018A CN202211206090.0A CN202211206090A CN115391018A CN 115391018 A CN115391018 A CN 115391018A CN 202211206090 A CN202211206090 A CN 202211206090A CN 115391018 A CN115391018 A CN 115391018A
- Authority
- CN
- China
- Prior art keywords
- node
- task
- processed
- record table
- main node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000012545 processing Methods 0.000 claims abstract description 59
- 238000004590 computer program Methods 0.000 claims description 19
- 230000000694 effects Effects 0.000 claims description 9
- 238000013467 fragmentation Methods 0.000 claims description 3
- 238000006062 fragmentation reaction Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 abstract description 7
- 230000001419 dependent effect Effects 0.000 abstract description 4
- 238000004891 communication Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a task scheduling method, a task scheduling device and task scheduling equipment, and relates to the technical field of computers. The method comprises the following steps: responding to a starting instruction, reading a main node record table, and determining main node state information in the task scheduling system; if the fact that the main node does not exist in the main node state information representation task scheduling system or the main node is not active is determined, information input processing is conducted on a main node record table; and if the information of the main node record table is determined to be successfully recorded, acquiring the tasks to be processed, and distributing the tasks to be processed to each task execution node in the system to execute the tasks to be processed. The process can be realized by any node in the task scheduling system, and the task scheduling is not dependent on a certain node, so that the success rate and efficiency of task scheduling can be improved, and resources are saved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for task scheduling.
Background
With the development of the financial industry, the number of various tasks is more and more, and the tasks are more and more complex, so that the requirements on the reliability, the throughput and the operation efficiency of a task scheduling system are higher and higher.
In the prior art, task scheduling is usually performed based on a centralized distributed task scheduling system, and when a task execution instruction is received, a preset master node performs unified issuing of a task, and schedules other nodes to perform task execution.
However, in the prior art, a centralized distributed task scheduling system must deploy a certain master node, and there is a limitation in application, and the centralized distributed task scheduling system depends on the scheduling of tasks performed by the master node, and has instability, and if the master node fails or has a performance bottleneck, the efficiency of task scheduling is affected.
Disclosure of Invention
The application provides a task scheduling method, a task scheduling device and a task scheduling device, which are used for solving the problems that a centralized task scheduling method is unstable and task scheduling efficiency is low.
In a first aspect, the present application provides a task scheduling method, where the method is applied to a node in a task scheduling system, where the system includes at least two nodes, and the method includes:
responding to a starting instruction, reading a main node record table, and determining main node state information in the task scheduling system, wherein the main node record table is used for recording address information of a main node in the task scheduling system and activity information of the main node, and the starting instruction is used for indicating a task to be processed;
if the master node state information indicates that no master node exists in the task scheduling system or the master node is inactive, performing information entry processing on the master node record table;
and if the information of the main node record table is determined to be successfully input, acquiring the tasks to be processed, and distributing the tasks to be processed to each task execution node in the system to execute the tasks to be processed.
In an optional implementation manner, if it is determined that the master node status information indicates that a master node does not exist currently in the task scheduling system or that the master node is inactive, performing information entry processing on the master node record table includes:
if the address information of the main node does not exist in the main node record table, performing information input processing on the main node record table;
or if the update time interval of the address information of the main node in the main node record table is determined to be larger than a preset threshold value, performing information entry processing on the main node record table.
In an optional embodiment, the information entry processing on the master node record table includes:
and inputting the address information corresponding to the node into the main node record table.
In an optional implementation manner, the allocating the to-be-processed task to each task execution node in the system to execute the to-be-processed task includes:
performing fragment processing on the task to be processed to generate N subtasks, wherein N is a positive integer greater than or equal to 1;
and reading the node load information of each task execution node in the system, and distributing each subtask to each task execution node according to the node load information of each task execution node to execute the task to be processed.
In an optional implementation manner, allocating each subtask to each task execution node according to the node load information of each task execution node to execute the to-be-processed task includes:
determining load difference among task execution nodes according to the node load information of each task execution node;
and according to the load difference between the task execution nodes, evenly distributing each subtask to the corresponding task execution node to execute the task to be processed.
In an optional embodiment, the method further comprises:
and if 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 smaller than or equal to a preset threshold value, giving up the information input of the main node record table, and waiting for receiving and executing the task to be processed.
In an optional embodiment, the method further comprises:
and if determining that the information entry of the main node record list fails, waiting to receive and executing the task to be processed.
In an optional implementation manner, the to-be-processed task may be a to-be-processed task set customized by a user, where the to-be-processed task set includes at least one task type of to-be-processed task.
In a second aspect, the present application provides a task scheduling apparatus, where the apparatus is applied to a node in a task scheduling system, where the system includes at least two nodes, and the apparatus includes:
the system comprises a determining unit, a processing unit and a processing unit, wherein the determining unit is used for responding to a starting instruction, reading a main node record table and determining the state information of a main node in the task scheduling system, the main node record table is used for recording the address information of the main node in the task scheduling system and the activity information of the main node, and the starting instruction is used for indicating a task to be processed;
the first processing unit is configured to perform information entry processing on the master node record table if it is determined that the master node state information indicates that a master node does not exist in the task scheduling system currently or the master node is inactive;
and the second processing unit is used for acquiring the tasks to be processed and distributing the tasks to be processed to each task execution node in the system to execute the tasks to be processed if the information entry of the main node record list is determined to be successful.
In a third aspect, the present application provides an electronic device comprising a memory and a processor;
the memory for storing a computer program;
the processor is configured to read the computer program stored in the memory, and execute the task scheduling method according to the computer program in the memory.
In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the task scheduling method according to the first aspect is implemented.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the method of task scheduling according to the first aspect.
The task scheduling method, the device and the equipment provided by the application comprise the following steps: responding to a starting instruction, reading a main node record table, and determining main node state information in the task scheduling system; if the fact that the main node does not exist in the main node state information representation task scheduling system or the main node is not active is determined, information input processing is conducted on a main node record table; and if the information of the main node record table is determined to be successfully recorded, acquiring the tasks to be processed, and distributing the tasks to be processed to each task execution node in the system to execute the tasks to be processed. The process can be realized by any node in the task scheduling system, and the task scheduling is not dependent on a certain node, so that the success rate and efficiency of task scheduling can be improved, and resources are saved.
Drawings
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 application.
Fig. 1 is a flowchart of a task scheduling method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of another task scheduling method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a task scheduling apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a terminal device according to an embodiment of the present application.
Specific embodiments of the present application have been shown by way of example in the drawings and will be described in more detail below. The drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the concepts of the application by those skilled in the art with reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In the technical scheme of the application, the collection, storage, use, processing, transmission, provision, publication and other processing of the related information such as financial data or user data and the like all accord with the regulations of related laws and regulations, and do not violate the customs of public order.
Distributed task scheduling refers to a task scheduling method in which a plurality of tasks divided from one application or service are handled by a plurality of servers. The distributed task scheduling can solve the problems of insufficient resources of a single server and the like, and achieves the purpose of large-scale data calculation. With the development of financial services, the number of tasks is more and more, the tasks are more and more complex, and the requirements on the reliability, throughput and operating efficiency of a task scheduling system are higher and higher.
In one example, currently, distributed task scheduling systems in mainstream are designed in a centralized manner, and when a task execution instruction is received, a preset master node issues a task in a unified manner, and schedules other nodes to execute the task.
However, the centralized distributed task scheduling system 1) has high deployment difficulty, depends on the registry, needs to additionally deploy the registry service, and increases deployment complexity; 2) The task throughput is not high, the tasks are uniformly scheduled by the main node by the centralized task scheduling system, the execution performance of the main node becomes a bottleneck, and the task scheduling efficiency is influenced; 3) The cluster needs to deploy at least 3 nodes to achieve high availability, and the requirement on resources is high; 4) The method does not support the combined execution of multiple task types, does not support the user-defined expansion of the tasks, needs a large amount of customized transformation and has poor task expansion capability.
Therefore, the present application proposes a task scheduling method based on a design idea of a decentralized distributed task scheduling system, and aims to solve the above technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a flowchart of a task scheduling method provided in an embodiment of the present application, where the method is applied to a node in a task scheduling system, where the system includes at least two nodes, and as shown in fig. 1, the method includes:
101. and responding to a starting instruction, reading a main node record table and determining the main node state information in the task scheduling system, wherein the main node record table is used for recording the address information of the main node and the activity information of the main node in the task scheduling system, and the starting instruction is used for indicating the task to be processed.
Illustratively, when receiving a start instruction of a user, a node in the distributed task scheduling system reads a master node record table in response to the start instruction, and determines 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 for recording address information of the master node in the task scheduling system and activity information of the master node, and the start instruction is used for indicating a task to be processed.
102. And if the master node state information represents that no master node exists in the task scheduling system currently or the master node is inactive, performing information entry processing on the master node record table.
Illustratively, if it is determined that a master node does not exist in the task scheduling system currently or the master node is in an inactive state in the task scheduling system currently through master node state information in the current task scheduling system, the information entry processing is performed on the master node record table. When the master node is in the inactive state, the master node record table may not have information updated for more than the preset time, or the information for representing the activity of the master node in the master node record table may be smaller than a preset threshold.
103. And if the information of the main node record table is determined to be successfully recorded, acquiring the tasks to be processed, and distributing the tasks to be processed to each task execution node in the system to execute the tasks to be processed.
For example, if it is determined that the information entry of the master node record table is successful, for example, the code identification information of the master node record table or the address information of the master node record table is successfully inserted into the master node record table, the to-be-processed task indicated in the start instruction may be loaded and acquired, and the to-be-processed task may be allocated to each task execution node in the system to execute the to-be-processed task.
In summary, the task scheduling method provided in this embodiment includes the following steps: responding to a starting instruction, reading a main node record table, and determining main node state information in the task scheduling system; if the fact that the main node does not exist in the main node state information representation task scheduling system or the main node is not active is determined, information input processing is conducted on a main node record table; and if the information of the main node record table is determined to be successfully recorded, acquiring the tasks to be processed, and distributing the tasks to be processed to each task execution node in the system to execute the tasks to be processed. The process can be realized by any node in the task scheduling system, and the task scheduling is not dependent on a certain node, so that the success rate and efficiency of task scheduling can be improved, and resources are saved.
Fig. 2 is a flowchart of another task scheduling method provided in an embodiment of the present application, where the method is applied to a node in a task scheduling system, where the system includes at least two nodes, and as shown in fig. 2, the method includes:
201. and responding to a starting instruction, reading a main node record table and determining the state information of the main node in the task scheduling system, wherein the main node record table is used for recording the address information of the main node and the activity information of the main node in the task scheduling system, and the starting instruction is used for indicating the task to be processed.
For example, this step is referred to as step 101, and is not described again.
202. And if the fact that the main node does not exist in the main node state information representation task scheduling system currently or the main node is not active is determined, information entry processing is carried out on the main node record table.
In one example, step 202 includes the steps of:
and if the master node record table is determined not to have the address information of the master node, recording the address information corresponding to the node into the master node record table.
Or if the update time interval of the address information of the master node in the master node record list is determined to be larger than the preset threshold value; the address information corresponding to the node is recorded into the record table of the master node.
Illustratively, if it is determined that the master node does not exist in the task scheduling system currently or the master node is in an inactive state in the task scheduling system currently by reading the master node state information in the master node record table, the information entry processing is performed on the master node record table. When the address information of the master node does not exist in the master node record table, the master node may be considered to be currently absent 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 the preset threshold value, the master node may be considered to be currently inactive in the task scheduling system. The information entry processing is performed on the main node record table, the address information corresponding to the node itself may be entered into the main node record table, or the coding identification information of the node itself may be entered into the main node record table, so as to update the main node record table.
203. And if the information of the main node record list is determined to be successfully input, acquiring the task to be processed, and carrying out fragment processing on the task to be processed to generate N subtasks, wherein N is a positive integer greater than or equal to 1.
Illustratively, if the master node record table is authorized to be subjected to information entry and other nodes cannot modify and update the master node record table before, the master node record table can be subjected to information entry, if the master node record table is determined to be successfully entered, it is indicated that the node serves as a master node in the task scheduling at the moment, a task to be processed indicated in a starting instruction can be read, the task to be processed is loaded into a memory, the task to be processed is subjected to fragmentation processing, and N subtasks are generated, wherein N is a positive integer greater than or equal to 1.
204. And reading the node load information of each task execution node in the system, and distributing each subtask to each task execution node according to the node load information of each task execution node to execute the task to be processed.
In one example, step 204 includes the steps of:
determining the load difference among the task execution nodes according to the node load information of the task execution nodes;
and according to the load difference between the task execution nodes, evenly distributing each subtask to the corresponding task execution node to execute the task to be processed.
Illustratively, when the node is determined as the master node in the task scheduling of this time, other nodes in the task scheduling system are automatically determined as task execution nodes at this time, and the master node reads the task execution nodes which are currently active in the task scheduling system and node load information of each task execution node at this time, and allocates each subtask to each task execution node according to the node load information of each task execution node to execute the task to be processed.
In one example, the load difference between the task execution nodes can be calculated and determined according to the node load information of the task execution nodes; and pre-distributing each subtask according to the load difference between each task execution node and the total task amount so as to complete the load difference of each task execution node, and evenly distributing the rest subtasks to the corresponding task execution nodes.
In one example, after each task execution node receives a corresponding subtask, a service thread for task execution may be started, the service thread may load the corresponding subtask into a memory, and the task thread may delegate the subtask to a service thread pool for execution; the business thread analyzes the arrangement relation of the subtasks, if the subtasks have dependent father tasks, whether the father tasks are executed or not is judged firstly, and if the father tasks are not executed, the father tasks are executed firstly; in the process, the business thread finds a corresponding task execution engine from the memory according to the type of the subtask, transmits the parameter of the subtask to the execution engine, and updates the execution state of the task after the execution engine is finished. The node serving as the master node also updates the execution information of each subtask, and modifies the state of each task to be executed.
In one example, in the task scheduling system, each node is equal, any node can acquire master node state information in the current system, and perform information entry operation on a master node record table according to the current master node state information to compete for a master node of the task scheduling, and when a certain node successfully enters its own information in the master node record table, the node is a master node of the task scheduling, and other nodes automatically become task execution nodes.
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 recorded in the master node record table. The state of the current main node in the system can be more accurately confirmed, and then follow-up information entry can be effectively carried out according to the state information, the main node is competed, the efficiency of the task scheduling preparation step is improved, and the task scheduling efficiency is further improved. By fragmenting the tasks and performing balanced distribution on the subtasks into which the tasks to be processed are divided according to the load information of each task execution node, the task execution efficiency can be improved.
One or more embodiments of the present application may further include: and if the master node record table is determined to have the address information of the master node, and the update time interval of the address information of the master node in the master node record table is smaller than or equal to a preset threshold value, giving up information entry of the master node record table, and waiting for receiving and executing the task to be processed.
Exemplarily, if it is determined that address information of a master node exists in the master node record table and an update time interval of the address information of the master node in the master node record table is smaller than or equal to a preset threshold, it is determined that an effective master node exists in the task scheduling system at present and can perform task scheduling of this time, and the master node gives up information entry to the master node record table, automatically becomes a task execution node, waits for receiving and executes a task to be processed.
In summary, in this embodiment, if it is determined that there is an effective master node in the task scheduling system currently to perform the task scheduling of this time, the information entry to the master node record table is abandoned, and the master node record table automatically becomes a task execution node in the task scheduling of this time, so that the normal operation of the task scheduling system can be effectively ensured in this process.
One or more embodiments of the present application may further include: and if determining that the information entry of the main node record list fails, waiting for receiving and executing the task to be processed.
Exemplarily, when the node performs information entry on the master node record table, other nodes have successfully performed information entry on the master node record table, and at this time, the node does not have an authority to perform information entry on the master node record table, or cannot successfully perform information entry on the master node record table, and at this time, the node automatically becomes a task execution node in the task scheduling of this time, and waits for receiving and executing a task to be processed.
In summary, in the embodiment, the master node record table is set in an optimistic locking manner, so that only one node can perform information entry on the master node record table, and normal operation of the task scheduling system can be effectively guaranteed in the process.
One or more embodiments of the present application may further include: the to-be-processed tasks can be a user-defined and woven set of the to-be-processed tasks, and the set of the to-be-processed tasks comprises at least one task type of the to-be-processed tasks.
Illustratively, the to-be-processed tasks may be a custom set of to-be-processed tasks that are woven into the execution by the user through the serial peripheral interface, and may include at least one task type of the to-be-processed tasks, for example, hypertext Transfer Protocol (HTTP) tasks, script tasks, and the like.
In summary, in the embodiment, combined execution of multiple task types is supported, custom expansion of tasks is supported, and the universality and flexibility of the task scheduling method can be improved.
Fig. 3 is a schematic structural diagram of a task scheduling apparatus according to an embodiment of the present application, where the apparatus is applied to a node in a task scheduling system, the system includes at least two nodes, and as shown in fig. 3, the apparatus includes:
the determining unit 31 is configured to, in response to a start instruction, read a master node record table, where the master node record table is used to record address information of a master node and activity information of the master node in the task scheduling system, and determine master node state information in the task scheduling system, and the start instruction is used to indicate a task to be processed.
The first processing unit 32 is configured to perform information entry processing on the master node record table if it is determined that a master node does not exist currently in the task scheduling system or the master node is inactive.
And the second processing unit 33 is configured to, if it is determined that the entry of the master node record table information is successful, acquire a task to be processed, and allocate the task to be processed to each task execution node in the system to execute the task to be processed.
In one example, the first processing unit 32 includes:
and the first determining subunit is used for performing information entry processing on the master node record table if the address information of the master node does not exist in the master node record table.
And the second determining subunit is used for performing information entry processing on the master node record table if the update time interval of the address information of the master node in the master node record table is determined to be greater than the preset threshold value.
In one example, the first processing unit 32 further includes:
and the first processing subunit is used for recording the address information corresponding to the node into the main node record table.
In one example, the second processing unit 33 includes:
and the second processing sub-unit is used for carrying out fragmentation processing on the tasks to be processed to generate N sub-tasks, wherein N is a positive integer greater than or equal to 1.
And the third processing subunit is used for reading the node load information of each task execution node in the system, and distributing each subtask to each task execution node according to the node load information of each task execution node to execute the task to be processed.
In one example, the third processing subunit includes:
and the determining module is used for determining the load difference between the task execution nodes according to the node load information of each task execution node.
And the processing module is used for evenly distributing each subtask to the corresponding task execution node according to the load difference between the task execution nodes so as to execute the task to be processed.
In one example, the apparatus further comprises:
and the third processing unit is used for giving up information entry to the main node record table and waiting for receiving and executing the task to be processed if the main node record table is determined to have the address information of the main node and the update time interval of the address information of the main node in the main node record table is smaller than or equal to a preset threshold value.
In one example, the apparatus further comprises:
and the fourth processing unit is used for waiting for receiving and executing the task to be processed if the information entry of the main node record list is determined to fail.
In one example, the set of to-be-processed tasks may be a set of to-be-processed tasks that is customized by a user, and the set of to-be-processed tasks includes at least one task type of to-be-processed task.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 4, the electronic device includes: memory 41, processor 42.
A memory for storing a computer program.
And the processor is used for reading the computer program stored in the memory and executing the task scheduling method of any one of the above embodiments according to the computer program in the memory.
Fig. 5 is a block diagram of a terminal device, which may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, etc., according to an embodiment of the present disclosure.
The apparatus 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.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices, 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 or optical disks.
A power supply component 806 provides power to the various components of the device 800. The power components 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.
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 an input signal from a 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 boundary of a 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 facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed status of the device 800, the relative positioning of the components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position 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 a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may 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, communications component 816 further includes a Near Field Communications (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Embodiments of the present application further provide a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method provided by the foregoing embodiments.
An embodiment of the present application further provides a computer program product, where the computer program product includes: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements 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 application is limited only by the appended claims.
Claims (12)
1. A task scheduling method is applied to a node in a task scheduling system, the system comprises at least two nodes, and the method comprises the following steps:
responding to a starting instruction, reading a main node record table, and determining main node state information in the task scheduling system, wherein the main node record table is used for recording address information of a main node in the task scheduling system and activity information of the main node, and the starting instruction is used for indicating a task to be processed;
if the master node state information indicates that no master node exists in the task scheduling system or the master node is inactive, performing information entry processing on the master node record table;
and if the information of the main node record table is determined to be successfully input, acquiring the tasks to be processed, and distributing the tasks to be processed to each task execution node in the system to execute the tasks to be processed.
2. The method of claim 1, wherein if it is determined that the master node status information indicates that a master node does not currently exist in the task scheduling system or that a master node is not active, performing information entry processing on the master node log table comprises:
if the address information of the main node does not exist in the main node record table, performing information input processing on the main node record table;
or if the update time interval of the address information of the master node in the master node record table is determined to be greater than a preset threshold, performing information entry processing on the master node record table.
3. The method according to claim 2, wherein performing information entry processing on the master node record table comprises:
and inputting the address information corresponding to the node into the main node record table.
4. The method of claim 1, wherein assigning the pending tasks to respective task execution nodes in the system for execution of the pending tasks comprises:
carrying out fragmentation processing on the task to be processed to generate N subtasks, wherein N is a positive integer greater than or equal to 1;
and reading node load information of each task execution node in the system, and distributing each subtask to each task execution node according to the node load information of each task execution node to execute the task to be processed.
5. The method according to claim 4, wherein allocating each subtask to each task execution node according to node load information of each task execution node to execute the task to be processed comprises:
determining the load difference among the task execution nodes according to the node load information of the task execution nodes;
and according to the load difference between the task execution nodes, evenly distributing each subtask to the corresponding task execution node to execute the task to be processed.
6. The method of claim 1, further comprising:
and if 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 smaller than or equal to a preset threshold value, giving up the information input of the main node record table, and waiting for receiving and executing the task to be processed.
7. The method according to any one of claims 1-6, further comprising:
and if determining that the information entry of the main node record list fails, waiting to receive and execute the task to be processed.
8. The method according to any one of claims 1 to 6, wherein the tasks to be processed can be a user-defined woven set of tasks to be processed, and the set of tasks to be processed comprises tasks to be processed of at least one task type.
9. A task scheduling apparatus, applied to a node in a task scheduling system, the system including at least two nodes, the apparatus comprising:
the system comprises a determining unit, a processing unit and a processing unit, wherein the determining unit is used for responding to a starting instruction, reading a main node record table and determining the state information of a main node in the task scheduling system, the main node record table is used for recording the address information of the main node in the task scheduling system and the activity information of the main node, and the starting instruction is used for indicating a task to be processed;
the first processing unit is used for performing information entry processing on the main node record table if the main node state information indicates that a main node does not exist in the task scheduling system currently or the main node is not active;
and the second processing unit is used for acquiring the tasks to be processed and distributing the tasks to be processed to each task execution node in the system to execute the tasks to be processed if the information entry of the main node record list is determined to be successful.
10. An electronic device, comprising a memory and a processor;
the memory for storing a computer program;
the processor is used for reading the computer program stored in the memory and executing the task scheduling method according to any one of the claims 1 to 8 according to the computer program in the memory.
11. A computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a processor, implement the method of task scheduling according to any one of claims 1-8.
12. A computer program product comprising a computer program, characterized in that the computer program realizes the method of task scheduling according to any of claims 1-8 when executed by a processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211206090.0A CN115391018A (en) | 2022-09-30 | 2022-09-30 | Task scheduling method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211206090.0A CN115391018A (en) | 2022-09-30 | 2022-09-30 | Task scheduling method, device and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115391018A true CN115391018A (en) | 2022-11-25 |
Family
ID=84129061
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211206090.0A Pending CN115391018A (en) | 2022-09-30 | 2022-09-30 | Task scheduling method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115391018A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521044A (en) * | 2011-12-30 | 2012-06-27 | 北京拓明科技有限公司 | Distributed task scheduling method and system based on messaging middleware |
WO2017045553A1 (en) * | 2015-09-15 | 2017-03-23 | 阿里巴巴集团控股有限公司 | Task allocation method and system |
CN111625592A (en) * | 2019-02-28 | 2020-09-04 | 北京京东尚科信息技术有限公司 | Load balancing method and device for distributed database |
CN113553171A (en) * | 2021-06-07 | 2021-10-26 | 用友汽车信息科技(上海)股份有限公司 | Load balancing control method, device and computer readable storage medium |
US20220083375A1 (en) * | 2019-05-30 | 2022-03-17 | Huawei Technologies Co., Ltd. | Method and apparatus for scheduling task processing entity |
-
2022
- 2022-09-30 CN CN202211206090.0A patent/CN115391018A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521044A (en) * | 2011-12-30 | 2012-06-27 | 北京拓明科技有限公司 | Distributed task scheduling method and system based on messaging middleware |
WO2017045553A1 (en) * | 2015-09-15 | 2017-03-23 | 阿里巴巴集团控股有限公司 | Task allocation method and system |
CN111625592A (en) * | 2019-02-28 | 2020-09-04 | 北京京东尚科信息技术有限公司 | Load balancing method and device for distributed database |
US20220083375A1 (en) * | 2019-05-30 | 2022-03-17 | Huawei Technologies Co., Ltd. | Method and apparatus for scheduling task processing entity |
CN113553171A (en) * | 2021-06-07 | 2021-10-26 | 用友汽车信息科技(上海)股份有限公司 | Load balancing control method, device and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110515709B (en) | Task scheduling system, method, device, electronic equipment and storage medium | |
CN114138439A (en) | Task scheduling method and device, electronic equipment and storage medium | |
CN111078356A (en) | GPU cluster resource control system, method, device, equipment and storage medium | |
CN113238763A (en) | Application deployment method, device, storage medium and program product | |
CN113138812B (en) | Spacecraft task scheduling method and device | |
CN112506553B (en) | Upgrading method and device for data surface container of service grid and electronic equipment | |
CN114090303B (en) | Software module scheduling method and device, electronic equipment, storage medium and product | |
CN112685104A (en) | Application program starting control method and device, electronic equipment and storage medium | |
CN112632184A (en) | Data processing method and device, electronic equipment and storage medium | |
KR102230266B1 (en) | Method and electronic device for sharing applications among a plurality of electronic devices | |
CN111666146A (en) | Multitask concurrent processing method and device | |
CN115391018A (en) | Task scheduling method, device and equipment | |
CN114430410B (en) | System access method, device and equipment based on virtual domain name | |
CN111723353A (en) | Identity authentication method, device, terminal and storage medium based on face recognition | |
CN111857804B (en) | Offline task processing method and device, electronic equipment and storage medium | |
CN115033369A (en) | Thread scheduling method, device and equipment based on task processing | |
CN114066370A (en) | Inventory service calling method, device, equipment, storage medium and program product | |
CN113905083A (en) | User code operation method and device, electronic equipment and storage medium | |
CN113407316A (en) | Service scheduling method and device, electronic equipment and storage medium | |
CN112286687A (en) | Resource processing method and device | |
CN111625329A (en) | Task allocation method and device, electronic equipment, server and storage medium | |
CN112783623B (en) | Process scheduling method and device, electronic equipment and storage medium | |
CN115242970B (en) | Vehicle camera data sharing system, method, electronic equipment and storage medium | |
CN111625251B (en) | Method and device for processing application instance | |
CN116360780A (en) | Dex compiling optimization method and device, terminal equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |