CN116610453A - 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
CN116610453A
CN116610453A CN202310685275.2A CN202310685275A CN116610453A CN 116610453 A CN116610453 A CN 116610453A CN 202310685275 A CN202310685275 A CN 202310685275A CN 116610453 A CN116610453 A CN 116610453A
Authority
CN
China
Prior art keywords
task
current task
tag
weight value
current
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
CN202310685275.2A
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.)
Shanghai Enflame Technology Co ltd
Original Assignee
Shanghai Enflame Technology Co ltd
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 Shanghai Enflame Technology Co ltd filed Critical Shanghai Enflame Technology Co ltd
Priority to CN202310685275.2A priority Critical patent/CN116610453A/en
Publication of CN116610453A publication Critical patent/CN116610453A/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/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
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2413Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
    • 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)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a task allocation method, a device, electronic equipment and a storage medium, comprising the following steps: sequentially acquiring a task from a task queue to be processed as a current task; determining target execution equipment matched with the current task according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one equipment tag corresponding to each alternative execution equipment and the weight value of each equipment tag; distributing the current task to target execution equipment, and executing the current task through the target execution equipment; and returning to execute the operation of sequentially acquiring one task as the current task in the task queue to be processed until the processing of all the tasks is completed. The technical scheme of the embodiment of the invention can screen the target execution equipment which is most matched with the task processing requirement, avoid resource waste and improve the execution efficiency of the task and the effectiveness of the execution result.

Description

Task allocation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a task allocation method, a task allocation device, an electronic device, and a storage medium.
Background
Continuous processing pipelines include continuous integration (Continuous Integration, CI) procedures, continuous delivery (Continuous Delivery, CD) procedures, and continuous deployment (Continuous Deployment, CD) procedures. The pipeline includes a plurality of tasks such as compilation, unit testing, code scanning, integration testing, etc. The plurality of tasks may be performed serially or in parallel. When the pipeline runs, different types of tasks have specific requirements on the running environment, so each task needs to be distributed to corresponding execution devices.
In the existing task allocation method, the executing device is generally selected randomly from the device cluster to match with the task. However, this approach may result in some simple tasks being distributed to devices with higher configuration, and complex tasks being distributed to devices with lower configuration, so that optimal matching between the tasks and the devices cannot be achieved, resulting in resource waste or queuing of a large number of tasks.
Disclosure of Invention
The invention provides a task allocation method, a device, electronic equipment and a storage medium, which can screen out target execution equipment which is most matched with task processing requirements, avoid resource waste and improve the execution efficiency of tasks and the effectiveness of execution results.
According to an aspect of the present invention, there is provided a task allocation method, the method including:
sequentially acquiring a task from a task queue to be processed as a current task;
determining target execution equipment matched with the current task according to at least one task tag corresponding to the current task, a weight value of each task tag, at least one equipment tag corresponding to each alternative execution equipment and a weight value of each equipment tag;
distributing the current task to target execution equipment, and executing the current task through the target execution equipment;
and returning to execute the operation of sequentially acquiring one task as the current task in the task queue to be processed until the processing of all the tasks is completed.
According to another aspect of the present invention, there is provided a task allocation device including:
the task acquisition module is used for sequentially acquiring a task from a task queue to be processed as a current task;
the device determining module is used for determining target execution devices matched with the current task according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device and the weight value of each device tag;
the task execution module is used for distributing the current task to the target execution equipment and executing the current task through the target execution equipment;
and the all-task processing module is used for returning to be executed in a task queue to be processed, and sequentially acquiring one task as the operation of the current task until the processing of all the tasks is completed.
According to another aspect of the present invention, there is provided an electronic device, the 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 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 provided by the embodiment of the invention, a task is sequentially obtained from the task queue to be processed as a current task, the target execution device matched with the current task is determined according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device and the weight value of each device tag, the current task is distributed to the target execution device, the current task is executed through the target execution device, the task is returned to be executed in the task queue to be processed, and one task is sequentially obtained as the operation of the current task until the processing of all the tasks is completed.
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. 3a is a flow chart of another task allocation method provided in accordance with an embodiment of the present invention;
fig. 3b is a schematic view of a scenario in which a KNN algorithm is used to determine a target execution device according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a task assigning apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for 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 "having," 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 a first embodiment of the present invention, where the method may be performed by a task allocation device, and the task allocation device may be implemented in hardware and/or software, and the task allocation device may be configured in an electronic device. As shown in fig. 1, the method includes:
step 110, sequentially acquiring a task as a current task from a task queue to be processed.
Step 120, determining a target execution device matched with the current task according to at least one task tag corresponding to the current task, a weight value of each task tag, at least one device tag corresponding to each alternative execution device, and a weight value of each device tag.
In this embodiment, each task may correspond to one or more task tags that are used to identify the attribute type of the task. Each task tag corresponds to a weight value that identifies the dependency strength of the task tag. Accordingly, each alternative execution device may also correspond to one or more device tags that identify the task attribute types supported by the device. Each device tag corresponds to a weight value that identifies the strength of support of the device for the task attribute type.
In a specific embodiment, the tag type, the tag number and the tag weight corresponding to each task and the alternative execution device may be determined according to an actual operation scenario. For example, assuming that a task label corresponding to a certain task is "CPU", the task can be considered as a task occupying a larger CPU resource; assuming that the device tag corresponding to a certain alternative execution device is "CPU", the alternative execution device may be considered as a device of a high configuration CPU type.
The total number T of labels corresponding to each task is more than or equal to 1, and the weight value of each task label is T i (i represents the ith tag, 0 < t) i < 1), whereinThe total number D of labels corresponding to each execution device is more than or equal to 1, and the weight value of each device label is D i (i represents the ith tag, 0 < d) i < 1), wherein
In one implementation of this embodiment, assume that the set of labels for the task is S t The label set of the alternative execution device is S d Then there is generally
In this step, optionally, after the task tag corresponding to the current task and the device tag corresponding to each alternative execution device are obtained, the alternative execution device including the task tag may be first selected from all the alternative execution devices, and then the task tag with higher importance is determined according to the weight value of each task tag and the weight value of the device tag corresponding to each alternative execution device, and the alternative execution device with higher support strength for the task tag is used as the target execution device.
And 130, distributing the current task to the target execution device, and executing the current task through the target execution device.
In this embodiment, after the current task is allocated to the target execution device, the running state of the target execution device may be updated, that is, the running state is updated from "idle" to "running".
And 140, judging whether the processing of all the tasks is finished, if yes, determining that the task allocation method is finished, otherwise, returning to the task queue to be processed in the execution step 110, and sequentially acquiring one task as the operation of the current task until the processing of all the tasks is finished.
In this embodiment, by determining the task labels of the tasks, the weight values of the task labels, the device labels of the alternative execution devices, and the weight values of the device labels in the continuous processing pipeline, the target execution device that is most matched with the task processing requirements can be screened out from all the alternative execution devices, so that the situation that resources are wasted or a large number of tasks are queued in the task allocation method can be avoided, and further the execution efficiency of the tasks and the effectiveness of the execution results can be improved.
According to the technical scheme provided by the embodiment of the invention, a task is sequentially obtained from the task queue to be processed as a current task, the target execution device matched with the current task is determined according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device and the weight value of each device tag, the current task is distributed to the target execution device, the current task is executed through the target execution device, the task is returned to be executed in the task queue to be processed, and one task is sequentially obtained as the operation of the current task until the processing of all the tasks is completed.
Fig. 2 is a flowchart of a task allocation method according to a second embodiment of the present invention, and this embodiment is further elaborated on the foregoing embodiment. As shown in fig. 2, the method includes:
step 210, sequentially acquiring a task as a current task from a task queue to be processed.
Step 220, determining the matching degree between the current task and each alternative execution device according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device, and the weight value of each device tag.
In this embodiment, optionally, the support strength of each alternative execution device to the current task may be determined according to the weight value of each task tag and the weight value of each device tag, and the matching degree between the current task and each alternative execution device may be determined according to the support strength.
In one implementation manner of this embodiment, determining the matching degree between the current task and each alternative execution device according to at least one task tag corresponding to the current task, a weight value of each task tag, at least one device tag corresponding to each alternative execution device, and a weight value of each device tag includes: multiplying the weight value of each task label corresponding to the current task with the weight value of each equipment label corresponding to each alternative execution equipment in sequence; and determining the matching degree between the current task and each alternative execution device according to the multiplication result.
In a specific embodiment, the matching degree between the current task and each alternative execution device can be calculated in turn by the following formula:
wherein P is the matching degree (-1 < P < 1). The closer the matching degree P is to 1, the higher the matching degree of the alternative execution device to the current task is considered. And when the matching degree P is smaller than 0, the alternative execution device is not matched with the current task. The closer the matching degree P is to-1, the higher the mismatch degree of the alternative execution device and the current task is considered.
And 230, determining target execution equipment matched with the current task according to the matching degree.
In this step, optionally, the highest candidate execution device that matches may be regarded as the target execution device.
And step 240, distributing the current task to the target execution device, and executing the current task through the target execution device.
Step 250, judging whether to finish the processing of all tasks, if yes, determining that the task allocation method is finished, if not, returning to the task queue to be processed in the execution step 210, and sequentially acquiring one task as the operation of the current task until the processing of all tasks is finished.
According to the technical scheme provided by the embodiment of the invention, a task is sequentially obtained from a task queue to be processed as a current task, the matching degree between the current task and each alternative execution device is determined according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device and the weight value of each device tag, the target execution device matched with the current task is determined according to the matching degree, the current task is distributed to the target execution device, the current task is executed through the target execution device, and the task is sequentially obtained from the task queue to be processed as the current task until the processing of all the tasks is completed.
Fig. 3a is a flowchart of another task allocation method according to a third embodiment of the present invention, which is further elaborated on the foregoing embodiment. As shown in fig. 3a, the method comprises:
step 310, sequentially acquiring a task as a current task from a task queue to be processed.
Step 320, determining a distance between the current task and each alternative execution device by adopting a nearest neighbor classification algorithm (K-NearestNeighbor, KNN) according to the weight value of each task tag corresponding to the current task and the weight value of each device tag corresponding to each alternative execution device, and determining a target execution device matched with the current task according to the distance.
In this embodiment, the KNN algorithm is one of the simplest methods in the data mining classification technique. K nearest neighbors can be understood as K nearest neighbors, if the task's label is taken as a sample, each sample can be represented by its nearest K neighbor values.
In one implementation manner of this embodiment, a KNN algorithm is adopted, according to a weight value of each task tag corresponding to a current task and a weight value of each device tag corresponding to each alternative execution device, a distance between the current task and each alternative execution device is determined, and according to the distance, a target execution device matched with the current task is determined, including:
step 321, setting an initial search range, and determining a plurality of tag distances between the current task and each alternative execution device according to the weight value of each task tag corresponding to the current task and the weight value of each device tag corresponding to each alternative execution device;
in this step, the tag distance may be calculated by the weight value corresponding to the same tag between the current task and the alternative execution device. Specifically, assuming that the ith tag corresponding to the current task is the same as the ith tag corresponding to the alternative execution device, the tag distance corresponding to the tag may be calculated by the following formula:
L i =1/t i d i
step 322, screening the alternative execution device and the corresponding label, wherein the label distance falls within the initial search range;
step 323, if all the labels corresponding to the alternative execution devices are not included in the initial search range, increasing the initial search range to obtain an updated search range;
step 324, screening the alternative execution device and the corresponding label, wherein the label distance falls within the updated search range;
and step 325, if all labels corresponding to the alternative execution device are contained in the updated search range and the label distance between the current task and the alternative execution device is nearest, taking the alternative execution device as a target execution device.
In a specific embodiment, a schematic view of a scenario in which the KNN algorithm is used to determine the target execution device may be shown in fig. 3b, where it is assumed that the alternative execution devices corresponding to the current task are device 1, device 2, and device 3, where each device corresponds to 6 device tags.
After determining the initial search range K1, a search area corresponding to K1 may be constructed with the current task as a center, then a plurality of tag distances between the current task and each of the alternative execution devices (i.e., device 1, device 2, and device 3) are determined, and the alternative execution devices and the corresponding tags whose tag distances fall within K1 are screened. From fig. 3b, 1 device tag corresponding to device 1, 1 device tag corresponding to device 2, and 1 device tag corresponding to device 3 can be determined to fall within K1.
Since all the labels corresponding to the devices are not contained in the K1, the K1 can be increased to obtain an updated search range K2, and the alternative execution devices and the corresponding labels with the label distances falling into the K2 are screened. From fig. 3b, it can be determined that the K2 falls into 3 device tags corresponding to the device 1, 3 device tags corresponding to the device 2, and 3 device tags corresponding to the device 3.
Since all the labels corresponding to the devices are not contained in the K2, the K2 can be continuously increased to obtain an updated search range K3, and the alternative execution devices and the corresponding labels with the label distances falling into the K3 are screened. From fig. 3b, it can be determined that the K3 falls into 6 device tags corresponding to the device 1, 6 device tags corresponding to the device 2, and 4 device tags corresponding to the device 3.
Since all the device tags corresponding to the devices 1 are contained in K3 and the tag distance between the current task and the devices 1 is nearest, the devices 1 can be used as target execution devices corresponding to the current task.
And step 330, distributing the current task to the target execution device, and executing the current task through the target execution device.
Step 340, determining whether to complete the processing of all tasks, if yes, determining that the task allocation method is completed, if not, returning to execute the operation of sequentially obtaining one task as the current task in the task queue to be processed in step 310 until the processing of all tasks is completed.
According to the technical scheme provided by the embodiment of the invention, a task is sequentially obtained from a task queue to be processed as a current task, a KNN algorithm is adopted according to the weight value of each task label corresponding to the current task and the weight value of each equipment label corresponding to each alternative execution equipment, the distance between the current task and each alternative execution equipment is determined, the target execution equipment matched with the current task is determined according to the distance, the current task is distributed to the target execution equipment, the current task is executed through the target execution equipment, the task is returned to be executed in the task queue to be processed, one task is sequentially obtained as the operation of the current task until the processing of all tasks is completed, the target execution equipment which is most matched with the task processing requirements can be screened, the resource waste is avoided, and the execution efficiency and the effectiveness of the execution result of the task are improved.
On the basis of the above embodiment, after the current task is allocated to the target execution device and the current task is executed by the target execution device, the method further includes: and acquiring the execution condition of the target execution equipment in real time, and adjusting the corresponding label and the weight value of the current task or the target execution equipment according to the execution condition.
Fig. 4 is a schematic structural diagram of a task allocation device according to a fourth embodiment of the present invention, where the task allocation device includes: a task acquisition module 410, a device determination module 420, a task execution module 430, and an overall task processing module 440.
The task obtaining module 410 is configured to sequentially obtain a task as a current task in a task queue to be processed;
the device determining module 420 is configured to determine a target execution device that matches the current task according to at least one task tag corresponding to the current task, a weight value of each task tag, at least one device tag corresponding to each alternative execution device, and a weight value of each device tag;
a task execution module 430, configured to allocate the current task to a target execution device, and execute the current task through the target execution device;
and the all-task processing module 440 is configured to return to be executed in the task queue to be processed, and sequentially acquire one task as an operation of the current task until processing of all the tasks is completed.
According to the technical scheme provided by the embodiment of the invention, a task is sequentially obtained from the task queue to be processed as a current task, the target execution device matched with the current task is determined according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device and the weight value of each device tag, the current task is distributed to the target execution device, the current task is executed through the target execution device, the task is returned to be executed in the task queue to be processed, and one task is sequentially obtained as the operation of the current task until the processing of all the tasks is completed.
On the basis of the above embodiment, the device determining module 420 includes:
the matching degree determining unit is used for determining the matching degree between the current task and each alternative execution device according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device and the weight value of each device tag;
the matching degree processing unit is used for determining target execution equipment matched with the current task according to the matching degree;
the weight multiplication unit is used for multiplying the weight value of each task label corresponding to the current task with the weight value of each equipment label corresponding to each alternative execution equipment in sequence; determining the matching degree between the current task and each alternative execution device according to the multiplication result;
the distance determining unit is used for determining the distance between the current task and each alternative executing device according to the weight value of each task tag corresponding to the current task and the weight value of each device tag corresponding to each alternative executing device by adopting a KNN algorithm, and determining target executing devices matched with the current task according to the distance;
the initial range setting unit is used for setting an initial search range and determining a plurality of tag distances between the current task and each alternative execution device according to the weight value of each task tag corresponding to the current task and the weight value of each device tag corresponding to each alternative execution device;
the initial tag screening unit is used for screening the alternative execution equipment and the corresponding tags of which the tag distance falls within the initial search range;
a range increasing unit, configured to increase the initial search range if the initial search range does not include all the tags corresponding to the alternative execution devices, so as to obtain an updated search range;
the updating label screening unit is used for screening the labels with the distance falling within the updating search range, the alternative execution equipment and the corresponding labels;
and the target equipment determining unit is used for taking the alternative execution equipment as target execution equipment if all labels corresponding to the alternative execution equipment are contained in the updating search range and the label distance between the current task and the alternative execution equipment is nearest.
The apparatus further comprises:
the tag adjustment module is used for acquiring the execution condition of the target execution device in real time, and adjusting the corresponding tag and the weight value of the current task or the target execution device according to the execution condition.
The device can execute the method provided by all the embodiments of the invention, and has the corresponding functional modules and beneficial effects of executing the method. Technical details not described in detail in the embodiments of the present invention can be found in the methods provided in all the foregoing embodiments of the present invention.
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. 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. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 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 11 performs the respective methods and processes described above, such as a 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 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the task allocation method described above may be performed. Alternatively, in other embodiments, the processor 11 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), complex 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, the method comprising:
sequentially acquiring a task from a task queue to be processed as a current task;
determining target execution equipment matched with the current task according to at least one task tag corresponding to the current task, a weight value of each task tag, at least one equipment tag corresponding to each alternative execution equipment and a weight value of each equipment tag;
distributing the current task to target execution equipment, and executing the current task through the target execution equipment;
and returning to execute the operation of sequentially acquiring one task as the current task in the task queue to be processed until the processing of all the tasks is completed.
2. The method of claim 1, wherein determining a target execution device that matches the current task based on the at least one task tag corresponding to the current task, the weight value of each task tag, the at least one device tag corresponding to each alternative execution device, and the weight value of each device tag, comprises:
determining the matching degree between the current task and each alternative execution device according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device and the weight value of each device tag;
and determining target execution equipment matched with the current task according to the matching degree.
3. The method of claim 2, wherein determining the degree of matching between the current task and each of the alternative execution devices based on the at least one task tag corresponding to the current task, the weight value of each task tag, the at least one device tag corresponding to each of the alternative execution devices, and the weight value of each device tag comprises:
multiplying the weight value of each task label corresponding to the current task with the weight value of each equipment label corresponding to each alternative execution equipment in sequence;
and determining the matching degree between the current task and each alternative execution device according to the multiplication result.
4. The method of claim 1, wherein determining a target execution device that matches the current task based on the at least one task tag corresponding to the current task, the weight value of each task tag, the at least one device tag corresponding to each alternative execution device, and the weight value of each device tag, comprises:
and determining the distance between the current task and each alternative execution device according to the weight value of each task tag corresponding to the current task and the weight value of each device tag corresponding to each alternative execution device by adopting a nearest neighbor classification algorithm KNN, and determining the target execution device matched with the current task according to the distance.
5. The method according to claim 4, wherein determining a distance between a current task and each alternative execution device according to a weight value of each task tag corresponding to the current task and a weight value of each device tag corresponding to each alternative execution device by using a nearest neighbor classification algorithm KNN, and determining a target execution device matched with the current task according to the distance, comprises:
setting an initial search range, and determining a plurality of tag distances between the current task and each alternative execution device according to the weight value of each task tag corresponding to the current task and the weight value of each device tag corresponding to each alternative execution device;
screening the alternative execution equipment and the corresponding labels, wherein the label distance falls within the initial search range;
if the initial search range does not contain all the labels corresponding to the alternative execution equipment, the initial search range is increased to obtain an updated search range;
screening label distances fall within the updating search range, alternative execution equipment and corresponding labels;
and if all the labels corresponding to the alternative execution equipment are contained in the updating search range and the label distance between the current task and the alternative execution equipment is nearest, taking the alternative execution equipment as target execution equipment.
6. The method of claim 1, further comprising, after assigning the current task to the target execution device and executing the current task by the target execution device:
and acquiring the execution condition of the target execution equipment in real time, and adjusting the corresponding label and the weight value of the current task or the target execution equipment according to the execution condition.
7. A task allocation device, the device comprising:
the task acquisition module is used for sequentially acquiring a task from a task queue to be processed as a current task;
the device determining module is used for determining target execution devices matched with the current task according to at least one task tag corresponding to the current task, the weight value of each task tag, at least one device tag corresponding to each alternative execution device and the weight value of each device tag;
the task execution module is used for distributing the current task to the target execution equipment and executing the current task through the target execution equipment;
and the all-task processing module is used for returning to be executed in a task queue to be processed, and sequentially acquiring one task as the operation of the current task until the processing of all the tasks is completed.
8. An electronic device, the 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-6.
9. A computer readable storage medium storing computer instructions for causing a processor to perform the task allocation method of any one of claims 1-6.
10. Computer program product, characterized in that it comprises a computer program which, when executed by a processor, implements the task allocation method according to any of claims 1-6.
CN202310685275.2A 2023-06-09 2023-06-09 Task allocation method and device, electronic equipment and storage medium Pending CN116610453A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310685275.2A CN116610453A (en) 2023-06-09 2023-06-09 Task allocation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310685275.2A CN116610453A (en) 2023-06-09 2023-06-09 Task allocation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116610453A true CN116610453A (en) 2023-08-18

Family

ID=87674617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310685275.2A Pending CN116610453A (en) 2023-06-09 2023-06-09 Task allocation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116610453A (en)

Similar Documents

Publication Publication Date Title
US8434085B2 (en) Scalable scheduling of tasks in heterogeneous systems
CN117032938B (en) Operator parallel scheduling method and device, electronic equipment and storage medium
CN115202847A (en) Task scheduling method and device
CN114861039A (en) Parameter configuration method, device, equipment and storage medium of search engine
CN114360027A (en) Training method and device for feature extraction network and electronic equipment
CN114065864A (en) Federal learning method, federal learning device, electronic device, and storage medium
CN115495248B (en) Memory allocation method and device of reasoning card, electronic equipment and storage medium
CN116382658A (en) Compiling method and device of AI model, computer equipment and storage medium
CN113761379B (en) Commodity recommendation method and device, electronic equipment and medium
CN116610453A (en) Task allocation method and device, electronic equipment and storage medium
CN115168509A (en) Processing method and device of wind control data, storage medium and computer equipment
CN114862223A (en) Robot scheduling method, device, equipment and storage medium
CN114579191A (en) Instruction transmitting method and device, electronic equipment and storage medium
CN117271098B (en) AI model calculation core scheduling method, device, equipment and storage medium
CN116700996B (en) Memory allocation method, device, equipment and medium of neural network
CN117370471B (en) Global prediction method, device, equipment and storage medium based on pruning average
CN117370473B (en) Data processing method, device, equipment and storage medium based on integrity attack
CN115640112A (en) Resource scheduling method, device, equipment and medium based on label
CN117829562B (en) Scheduling plan generation method and related equipment based on identification analysis
CN117076720B (en) Embedded table access method and device, electronic equipment and storage medium
CN113313196B (en) Labeling data processing method, related device and computer program product
CN114461889B (en) Data searching method, device, electronic equipment and program product
CN114037058B (en) Pre-training model generation method and device, electronic equipment and storage medium
CN116594708A (en) Method, device, equipment and medium for generating multi-model loading configuration file
CN116502841A (en) Event processing method and device, electronic equipment and 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
CB02 Change of applicant information

Country or region after: China

Address after: Room a-522, 188 Yesheng Road, Lingang New District, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai, 201306

Applicant after: Shanghai Suiyuan Technology Co.,Ltd.

Address before: Room a-522, 188 Yesheng Road, Lingang New District, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai, 201306

Applicant before: SHANGHAI ENFLAME TECHNOLOGY Co.,Ltd.

Country or region before: China

CB02 Change of applicant information