CN117632425A - Task allocation method and device, electronic equipment and storage medium - Google Patents

Task allocation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117632425A
CN117632425A CN202311631393.1A CN202311631393A CN117632425A CN 117632425 A CN117632425 A CN 117632425A CN 202311631393 A CN202311631393 A CN 202311631393A CN 117632425 A CN117632425 A CN 117632425A
Authority
CN
China
Prior art keywords
server
task
current
budget
determining
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
Application number
CN202311631393.1A
Other languages
Chinese (zh)
Inventor
刘佳俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202311631393.1A priority Critical patent/CN117632425A/en
Publication of CN117632425A publication Critical patent/CN117632425A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention discloses a task allocation method, a task allocation device, electronic equipment and a storage medium. The method comprises the following steps: determining a current task to be allocated and a task duration budget required for executing the current task; determining an alternative server from the servers based on task duration budgets, a preset current duration budgets and a current working state of the servers; the current activity period of each alternative server is determined, a target server is determined in the alternative servers based on the current activity period, and the current task is distributed to the target server for execution. The technical scheme of the embodiment of the invention can solve the problems of easy failure and difficult management caused by the task respectively through the configuration table, and realize the effect of rapidly and effectively distributing the current task.

Description

Task allocation method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a task allocation method, a task allocation device, electronic equipment and a storage medium.
Background
Task allocation is to control when a job is executed by those resources, and also includes processing after the job fails to execute. The task execution efficiency can be improved through task allocation.
In the prior art, the task allocation method is to write the configuration information of the task into the configuration table in advance, and allocate the task according to the configuration table when executing the task. However, in the process of implementing the present invention, it is found that at least the following technical problems exist in the prior art: when the configuration table has the problems of data error, loss and the like, the task allocation fails; moreover, as the number of tasks increases, the configuration table becomes more and more lengthy and complex, increasing the management difficulty.
Disclosure of Invention
The embodiment of the invention provides a task allocation method, a device, electronic equipment and a storage medium, which are used for realizing the purpose of rapidly and effectively allocating current tasks.
According to an aspect of the present invention, there is provided a task allocation method, including:
determining a current task to be allocated currently and a task duration budget required for executing the current task;
determining an alternative server from the servers based on the task duration budget, the predetermined current duration budget and the current working state of each server;
and determining the current activity deadline of each alternative server, determining a target server in the alternative servers based on the current activity deadline, and distributing the current task to the target server for execution.
According to another aspect of the present invention, there is provided a task allocation device including:
the task duration budget determining module is used for determining a current task to be allocated currently and a task duration budget required for executing the current task;
the alternative server determining module is used for determining an alternative server in each server based on the task duration budget, the preset current duration budget and the current working state of each server;
and the target server determining module is used for determining the current activity deadline of each candidate server, determining a target server in the candidate servers based on the current activity deadline, and distributing the current task to the target server for execution.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the task allocation method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a task allocation method according to any one of the embodiments of the present invention.
According to the technical scheme, a current task to be allocated and a task duration budget required for executing the current task are determined; determining an alternative server from the servers based on task duration budgets, a preset current duration budgets and a current working state of the servers; the current activity period of each alternative server is determined, a target server is determined in the alternative servers based on the current activity period, and the current task is distributed to the target server for execution. According to the method and the device, the target server corresponding to the current task is determined to be distributed through the determined task duration budget, the current working state and the current activity period, and the problem that tasks are easy to fail and difficult to manage due to the fact that the configuration tables are used for respectively are solved without being written into the configuration tables in advance; and, can realize the effect that distributes the current task fast, effectively.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a task allocation method provided according to an embodiment of the present invention;
FIG. 2 is a flow chart of another task allocation method provided in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of a task assigning apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing a task allocation method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "includes," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flowchart of a task allocation method according to an embodiment of the present invention. The present embodiment is applicable to the case of assigning servers to tasks, and the method may be performed by task assigning devices, which may be implemented in hardware and/or software.
As shown in fig. 1, the method of this embodiment may specifically include:
s110, determining a current task to be allocated currently and a task duration budget required for executing the current task.
It should be noted that, the task allocation method of this embodiment may complete the task allocation work of the batch by using a queue and a soft interrupt mode based on the multi-core processing model. The CPU (Central Processing Unit ) domain may be initialized prior to the task allocation process, and the hierarchical relationship of the CPU may be described by a data structure struct schdule domain topology level.
The current task to be distributed is a task which is not processed and is in a waiting state; the task duration budget is the duration that is expected to be spent executing the current task. For example, the current task a is expected to take 5 unit time periods, and a person skilled in the art can determine a specific time value of the unit time period, for example, one unit time period is 1 second, according to practical situations.
In a specific implementation, each task to be allocated currently can be used as a current task; or determining a preset number of tasks as current tasks in the tasks to be distributed currently. The manner of determining the current task may be based on the working condition of each server, and if the servers are in idle state, each task to be allocated currently may be determined as the current task.
S120, determining an alternative server in each server based on the task duration budget, the predetermined current duration budget and the current working state of each server.
The current time budget is an estimated time for executing the task, which is allocated to the server in advance. For example, the server may include an idle state and/or a busy state in the current operating state. The alternative server is a server that is available to receive the current task and process the current task.
In a specific implementation, a server which can meet the requirement of the task duration budget for the current duration budget of the server can be determined to be an alternative server based on the current duration budget and the current working state.
In a specific implementation, determining an implementation manner of an alternative server in each server based on a task duration budget, a predetermined current duration budget and a current working state of each server comprises: and for each server, under the condition that the current working state of the server is an idle state, if the current time length budget of the server is greater than or equal to the task time length budget, determining the server as an alternative server.
In this embodiment, if the server is in the idle state, it is described that the server may receive the task, in order to avoid the situation that the server is in the idle state, but is disconnected before the task execution ends, and the task execution fails, and if the current working state of the server is the idle state, it may be determined whether the server is an alternative server based on the current time length. It should be noted that, for the server in the idle state, the current duration budget is reduced according to the preset rate.
Specifically, if the current time budget is greater than or equal to the task time budget, which indicates that the server can keep the working state all the time before the task execution is completed, and the offline condition can not occur, the server can be determined to be an alternative server; if the current duration budget of the server is smaller than the task duration budget, the server is not used as an alternative server.
According to the embodiment, the server with the current working state being the idle state and the current time length budget being greater than or equal to the task time length budget is used as the alternative server, so that the alternative server can execute the current task and is not disconnected before the execution of the current task is completed, and the current task can be effectively executed.
In a specific implementation, determining an implementation manner of an alternative server in each server based on the task duration budget, the predetermined current duration budget and the current working state of each server further comprises: and determining the task deadline of the current task under the condition that the current working state of the server is a busy state for each server, and determining the server as an alternative server if the server is in an idle state and the idle time is greater than or equal to the task time budget before the task deadline.
The task deadline is a time corresponding to the maximum allowable waiting time of the current task. In order to improve task execution efficiency, a maximum allowable waiting time period including a time required for executing a task is preset for each task. And when the waiting time of the task reaches the maximum duration, the task is disconnected, and the waiting is stopped. The idle time is the time that the server is in an idle state.
Specifically, when the current working state of the server is a busy state, whether the corresponding moment after the busy is finished is before the task deadline of the current task or not can be determined, if the moment is before the task deadline, the server is indicated to have time for executing the current task, and in order to avoid the condition that the server is disconnected or the current task is suspended when executing other tasks in the current task execution, the idle time of the server can be determined; the idle time is the time from the completion of the task being executed to the offline time. If the idle time length is greater than or equal to the task time length budget, indicating that the server has enough time for processing the current task after finishing the busy state, determining the server as an alternative server; if the server remains busy until the task deadline; or if the idle time length of the server is smaller than the task time length budget, the server is not determined to be an alternative server, if the idle time length of the server is not smaller than the task time length budget, the server cannot receive the current task or cannot normally execute to complete after receiving the current task.
In this embodiment, for the server in the busy state, by determining the idle time length and the working state of the server before the task deadline, the alternative server is determined in the server in the busy state in the current working state, which increases the optional range of the alternative server and is beneficial to effectively distributing the current task.
S130, determining the current activity deadline of each alternative server, determining a target server in the alternative servers based on the current activity deadline, and distributing the current task to the target server for execution.
The current activity deadline comprises an online deadline for starting to receive the task and a offline deadline for stopping to receive the task; the online time limit indicates the time limit for the server to start receiving the task and processing the task, and the offline time limit indicates the time limit for the server to stop the task processing work. It should be noted that the current active period of the server may be determined by the working environment and the working content of the server.
In specific implementation, one server can be selected from each alternative server as a target server; or taking the candidate server with the shortest duration corresponding to the current activity deadline as a target server to idle the candidate server with longer duration corresponding to the current activity deadline to execute the task with longer budget of the current duration.
Or determining the offline period of each alternative server, and determining the alternative servers with offline periods after the task deadlines as target servers. Thereby avoiding waste of service resources for performing the current task.
In order to improve the utilization rate of the server, fully utilizing the server to be disconnected and avoiding resource waste, in this embodiment, the method for determining the current activity deadline of each alternative server includes: determining the offline period of the alternative server; determining a target server from the candidate servers based on the current activity deadline comprises the following steps: and determining the task deadline of the current task, and determining the candidate server with the offline deadline which is after the task deadline and has the earliest offline deadline as the target server.
Specifically, the target server may be determined according to the offline deadline of the candidate server. The offline deadline is after the task deadline, and the alternative server can be ensured to have enough time to execute the current task; meanwhile, the earlier the offline period is, the earlier the alternative server is stopped for receiving and executing the task, so that the alternative server with the earliest offline period can be determined as the target server for fully utilizing the server resources, and the current task is distributed to the target server for executing, thereby improving the overall utilization rate of the server resources and avoiding resource waste.
According to the technical scheme, a current task to be allocated and a task duration budget required for executing the current task are determined; determining an alternative server from the servers based on task duration budgets, a preset current duration budgets and a current working state of the servers; the current activity period of each alternative server is determined, a target server is determined in the alternative servers based on the current activity period, and the current task is distributed to the target server for execution. According to the method and the device, the target server corresponding to the current task is determined to be distributed through the determined task duration budget, the current working state and the current activity period, and the problem that tasks are easy to fail and difficult to manage due to the fact that the configuration tables are used for respectively are solved without being written into the configuration tables in advance; and, can realize the effect that distributes the current task fast, effectively.
Fig. 2 is a flowchart of another task allocation method according to an embodiment of the present invention. The present embodiment further includes, after the current task is allocated to the target server for execution: determining the residual time budget of the target server based on the task time budget and the current time budget, and updating the current time budget of the target server based on the residual time budget. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein. As shown in fig. 2, the method includes:
s210, determining a current task to be allocated currently and a task duration budget required for executing the current task.
S220, determining an alternative server from the servers based on the task duration budget, the predetermined current duration budget and the current working state of each server.
S230, determining the current activity deadline of each alternative server, determining a target server in the alternative servers based on the current activity deadline, and distributing the current task to the target server for execution.
S240, determining the residual time budget of the target server based on the task time budget and the current time budget, and updating the current time budget of the target server based on the residual time budget.
In a specific implementation, in order to obtain accurate current time budget when the task is allocated later, after the current task is allocated to the target server, a current time budget updating operation can be performed. Specifically, subtracting the task duration budget from the current duration budget to obtain the residual duration budget of the target server, and updating the current duration budget of the target server based on the residual duration budget, so that the accuracy of the subsequent determination of the current duration budget is improved, and the server is reasonably allocated to the task.
Specifically, the manner of updating the current time budget of the target server based on the remaining time budget may include: and determining the residual time budget as the current time budget, and completing the updating operation of the current time budget.
Further, in order to make full use of server resources, the method for updating the current duration budget based on the remaining duration budget includes: under the condition that the residual time budget is smaller than a preset time threshold, updating the current time budget into a preset supplementary time budget; after updating the current duration budget based on the remaining duration budget, further comprising: and updating the current activity period of the target server according to the preset period increment value.
When the residual time budget is smaller than the preset time threshold, the residual time budget of the server is smaller, the task processing operation cannot be continued, and the current time budget can be supplemented for fully utilizing the server resources.
Specifically, under the condition that the residual duration is preselected to be smaller than a preset duration threshold value, the current duration budget is supplemented. For example, the preset duration threshold may include 1 unit duration. Further, the current activity deadline may be updated after the target server performs the current task to avoid frequent offline of the target server. For example, the current active period may be increased by a preset period increase value, and the period after the preset period increase value is increased as the current active period of the target server. For example, the preset period increment value may be 5 units long.
In this embodiment, the current time budget and the current active period of the target server are updated, which is favorable for improving the resource utilization rate and avoiding frequent offline of the server.
Optionally, the method further comprises: for each server, under the condition that the server is in an idle state, determining whether the server is a browsing server for providing services for the browser, and if the server is the browsing server, reducing the duration corresponding to the current activity period of the browsing server by a preset multiple of unit duration.
The servers can be divided into browsing servers for providing services for the browser and user servers for providing servers for the user side according to different purposes. Since the browsing server needs to be continuously accessed and occupied, other work can not be carried out on the browsing server without being influenced, and the current activity period of the browsing server can be adjusted.
Specifically, the working state of each server can be determined, when the server is in an idle state, whether the type of the server is a browsing server or not can be determined, and if the type of the server is not the browsing server, no operation is needed; if the browsing server is a browsing server, in order to enable the browsing server to perform other works, the waiting time of the server is reduced, and the duration of the current active period of the browsing server can be reduced by a preset multiple of unit duration. The preset multiple is a floating type constant. Specific values of the preset times can be determined by those skilled in the art according to practical application, and the embodiment is not limited thereto.
For example, in order to reduce the waiting time of the browsing server to the greatest extent, the preset multiple may be a ratio of the duration of the current active period to the unit duration, so that after the duration of the current active period is reduced by the unit duration of the preset multiple, the duration becomes 0, and the browsing server may be directly disconnected.
According to the method and the device, the unit duration of the preset times is reduced for the duration of the current activity period, so that the browsing server is offline in advance and used for executing other works, the waiting time of the browsing server is reduced, and the resource utilization rate and the task scheduling efficiency are improved.
In this embodiment, if the server is in the idle state, it is determined whether the server is a user server, and if so, a task may be allocated to the user server, and by enabling the user server to execute the allocated task, the current time budget of the user server is consumed until the current time budget is zero.
Further, the state of each server may be detected, when it is detected that the server is switched from the down state to the up state, the current active duration is set to be a default duration for the server that is on line again, and the current active period is set based on the working environment and the working content of the server. For example, the current activity duration may be set to the sum of the maximum value of the historical activity duration of the server and a preset increment, so as to avoid frequent offline of the server.
In this embodiment, the distributed tasks may be executed in batches by using the symmetric multiprocessor model, and during the task execution process, the workload balancing may be performed according to the registered soft interrupt of the symmetric multiprocessor model, and after each task distribution, it may be checked whether the symmetric multiprocessor load balancing is currently required to be processed. Specifically, load balancing may be triggered by a soft interrupt manner based on the trigger_load_policy () function. In addition, the sysctls interface of the system can be used for modifying kernel parameters during running to regulate the task allocation process. Illustratively, the kernel parameters include a minimum time value for the process to occupy the CPU, a schedule cycle time, and the like.
According to the embodiment, the task can be dynamically allocated according to the actual resource condition, and the allocation efficiency and the resource utilization rate are improved. The symmetrical multiprocessor model provides that load balancing adjustment is performed periodically, so that loads of different processors can be effectively balanced, the situation of unbalanced load is avoided, and the overall performance of the system is improved. Meanwhile, kernel parameters can be dynamically adjusted according to actual running conditions, and the performance of the system is further improved.
Fig. 3 is a schematic structural diagram of a task allocation device according to an embodiment of the present invention, where the task allocation device is configured to perform the task allocation method provided in any of the foregoing embodiments. The device and the task allocation method of each embodiment belong to the same invention conception, and the details of the task allocation device embodiment are not described in detail, and reference is made to the embodiment of the task allocation method. As shown in fig. 3, the apparatus includes:
a task duration budget determining module 10, configured to determine a current task to be currently allocated and a task duration budget required for executing the current task;
an alternative server determining module 11, configured to determine an alternative server from the servers based on the task duration budget, the predetermined current duration budget and the current working state of each server;
the target server determining module 12 is configured to determine a current activity deadline of each of the candidate servers, determine a target server among the candidate servers based on the current activity deadline, and allocate the current task to the target server for execution.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the optional server determining module 11 includes:
the first alternative server determining unit is configured to determine, for each server, if the current duration budget of the server is greater than or equal to the task duration budget in a case where the current working state of the server is an idle state, the server as an alternative server.
On the basis of any optional technical solution in the embodiment of the present invention, optionally, the optional server determining module 11 includes:
the second alternative server determining unit is configured to determine, for each server, a task deadline of the current task when the current working state of the server is a busy state, and determine the server as an alternative server if the server is in an idle state and the idle time is greater than or equal to the task time budget before the task deadline.
On the basis of any optional technical scheme in the embodiment of the invention, optionally, the current activity deadline comprises an online deadline for starting to receive the task and a offline deadline for stopping to receive the task;
the target server determination module 12 includes:
the off-line period determining unit is used for determining the off-line period of the server;
and the target server determining unit is used for determining the task deadline of the current task, and determining the candidate server with the offline deadline which is after the task deadline and has the earliest offline deadline as the target server.
On the basis of any optional technical scheme in the embodiment of the invention, the method further comprises the following steps:
the residual time length budget determining module is used for determining the residual time length budget of the target server based on the task time length budget and the current time length budget after the current task is distributed to the target server for execution, and updating the current time length budget of the target server based on the residual time length budget.
On the basis of any optional technical scheme in the embodiment of the invention, an optional residual duration budget determining module comprises:
the current time length budget updating unit is used for updating the current time length budget into a preset supplementary time length budget under the condition that the residual time length budget is smaller than a preset time length threshold;
and the activity period updating unit is used for updating the current activity period of the target server according to the preset period increasing value after updating the current time budget of the target server based on the residual time budget.
On the basis of any optional technical scheme in the embodiment of the invention, the method further comprises the following steps:
the browse server determining module is used for determining whether the server is a browse server for providing service for the browser or not according to each server under the condition that the server is in an idle state, and if the server is the browse server, reducing the duration corresponding to the current activity duration of the browse server by a preset multiple of unit duration.
According to the technical scheme, a current task to be allocated and a task duration budget required for executing the current task are determined; determining an alternative server from the servers based on task duration budgets, a preset current duration budgets and a current working state of the servers; the current activity period of each alternative server is determined, a target server is determined in the alternative servers based on the current activity period, and the current task is distributed to the target server for execution. According to the method and the device, the target server corresponding to the current task is determined to be distributed through the determined task duration budget, the current working state and the current activity period, and the problem that tasks are easy to fail and difficult to manage due to the fact that the configuration tables are used for respectively are solved without being written into the configuration tables in advance; and, can realize the effect that distributes the current task fast, effectively.
It should be noted that, in the above embodiment of the task allocation device, each unit and module included are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Fig. 4 is a schematic structural diagram of an electronic device implementing a task allocation method according to an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 20 includes at least one processor 21, and a memory, such as a Read Only Memory (ROM) 22, a Random Access Memory (RAM) 23, etc., communicatively connected to the at least one processor 21, wherein the memory stores a computer program executable by the at least one processor, and the processor 21 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 22 or the computer program loaded from the storage unit 28 into the Random Access Memory (RAM) 23. In the RAM23, various programs and data required for the operation of the electronic device 20 may also be stored. The processor 21, the ROM22 and the RAM23 are connected to each other via a bus 24. An input/output (I/O) interface 25 is also connected to bus 24.
Various components in the electronic device 20 are connected to the I/O interface 25, including: an input unit 26 such as a keyboard, a mouse, etc.; an output unit 27 such as various types of displays, speakers, and the like; a storage unit 28 such as a magnetic disk, an optical disk, or the like; and a communication unit 29 such as a network card, modem, wireless communication transceiver, etc. The communication unit 29 allows the electronic device 20 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 21 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 21 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 21 performs the various methods and processes described above, such as the task allocation method.
In some embodiments, the task allocation method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 28. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 20 via the ROM22 and/or the communication unit 29. When the computer program is loaded into RAM23 and executed by processor 21, one or more steps of the task allocation method described above may be performed. Alternatively, in other embodiments, the processor 21 may be configured to perform the task allocation method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of task allocation, comprising:
determining a current task to be allocated currently and a task duration budget required for executing the current task;
determining an alternative server from the servers based on the task duration budget, the predetermined current duration budget and the current working state of each server;
and determining the current activity deadline of each alternative server, determining a target server in the alternative servers based on the current activity deadline, and distributing the current task to the target server for execution.
2. The method of claim 1, wherein the determining an alternative server among the servers based on the task duration budget, a predetermined current duration budget for each server, and a current operational state comprises:
and for each server, if the current time length budget of the server is greater than or equal to the task time length budget under the condition that the current working state of the server is an idle state, determining the server as the alternative server.
3. The method of claim 1, wherein the determining an alternative server among the servers based on the task duration budget, a predetermined current duration budget for each server, and a current operational state comprises:
and determining a task deadline of the current task for each server under the condition that the current working state of the server is a busy state, and determining the server as the alternative server if the server is in an idle state and the idle time is greater than or equal to the task time budget before the task deadline.
4. The method of claim 1, wherein the current active deadline includes an on-line deadline for starting to receive a task and an off-line deadline for stopping to receive a task; the determining the current activity deadline of each of the alternative servers includes:
determining the offline period of the alternative server;
the determining a target server from the candidate servers based on the current activity deadline comprises the following steps:
and determining the task deadline of the current task, and determining the candidate server with the offline deadline which is after the task deadline and has the earliest offline deadline as the target server.
5. The method of claim 1, further comprising, after said assigning said current task to said target server for execution:
determining the residual time length budget of the target server based on the task time length budget and the current time length budget, and updating the current time length budget of the target server based on the residual time length budget.
6. The method of claim 5, wherein the updating the current duration budget based on the remaining duration budget comprises:
updating the current time length budget to a preset supplementary time length budget under the condition that the residual time length budget is smaller than a preset time length threshold;
after said updating said current time length budget based on said remaining time length budget, further comprising:
and updating the current activity deadline of the target server according to the preset deadline increment value.
7. The method as recited in claim 1, further comprising:
for each server, determining whether the server is a browsing server for providing service for a browser or not under the condition that the server is in an idle state, and if so, reducing the duration corresponding to the current activity duration of the browsing server by a preset multiple of unit duration.
8. A task assigning apparatus, comprising:
the task duration budget determining module is used for determining a current task to be allocated currently and a task duration budget required for executing the current task;
the alternative server determining module is used for determining an alternative server in each server based on the task duration budget, the preset current duration budget and the current working state of each server;
and the target server determining module is used for determining the current activity deadline of each candidate server, determining a target server in the candidate servers based on the current activity deadline, and distributing the current task to the target server for execution.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the task allocation method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the task allocation method of any one of claims 1-7.
CN202311631393.1A 2023-11-30 2023-11-30 Task allocation method and device, electronic equipment and storage medium Pending CN117632425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311631393.1A CN117632425A (en) 2023-11-30 2023-11-30 Task allocation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311631393.1A CN117632425A (en) 2023-11-30 2023-11-30 Task allocation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117632425A true CN117632425A (en) 2024-03-01

Family

ID=90023003

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311631393.1A Pending CN117632425A (en) 2023-11-30 2023-11-30 Task allocation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117632425A (en)

Similar Documents

Publication Publication Date Title
CN112559182B (en) Resource allocation method, device, equipment and storage medium
JP2021121959A (en) Scheduling method for deep layer learning inference engine, device, equipment and medium
CN112783659A (en) Resource allocation method and device, computer equipment and storage medium
CN114936173B (en) Read-write method, device, equipment and storage medium of eMMC device
CN113032102A (en) Resource rescheduling method, device, equipment and medium
CN115658311A (en) Resource scheduling method, device, equipment and medium
CN117785465A (en) Resource scheduling method, device, equipment and storage medium
CN113986497B (en) Queue scheduling method, device and system based on multi-tenant technology
CN115391031A (en) Load balancing scheduling method and computing equipment
CN114579323A (en) Thread processing method, device, equipment and medium
CN117472471A (en) Application program configuration method, device, equipment and storage medium
WO2024139754A1 (en) Test node regulation and control method and apparatus, electronic device and storage medium
CN116303132A (en) Data caching method, device, equipment and storage medium
CN117632425A (en) Task allocation method and device, electronic equipment and storage medium
CN115964166A (en) Resource allocation method, device, equipment and storage medium
CN115390992A (en) Virtual machine creating method, device, equipment and storage medium
CN115756808A (en) Resource adjusting method, device, equipment and storage medium
CN115373860A (en) Scheduling method, device and equipment of GPU (graphics processing Unit) tasks and storage medium
CN115098269A (en) Resource allocation method, device, electronic equipment and storage medium
CN116893893B (en) Virtual machine scheduling method and device, electronic equipment and storage medium
CN114598705B (en) Message load balancing method, device, equipment and medium
CN114610575B (en) Method, apparatus, device and medium for calculating updated peak value of branch
CN115361449B (en) Method, device, equipment and storage medium for adjusting IP resources
CN116389499A (en) Task allocation method, device, equipment and medium based on electric power Internet of things
CN117519940A (en) Process scheduling method and device, electronic 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