Task execution method and device, storage medium and electronic equipment
By receiving user task requests and obtaining shared computing device information, identifying candidate devices that meet task requirements, the problem of low equipment utilization is solved, resource sharing and flexible scheduling is realized, computing resource utilization is improved and cost is reduced.
Patent Information
- Application Number
- CN202411068682.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when a background computing device is assigned to multiple users to perform image generation tasks, the device utilization rate is low, resulting in wasted computing resources.
By receiving user's task execution requests, obtaining device information and operating status information of shared computing devices, determining candidate devices that meet task configuration requirements, and deploying program instances to execute tasks on target devices to realize resource sharing and flexible scheduling.
It improves the resource utilization rate of shared computing devices, avoids waste of computing resources, and reduces service costs.
Smart Images

Figure CN119003118A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a task execution method, device, storage medium and electronic device. Background Art
[0002] In recent years, deep learning technology has developed rapidly, and image generation models based on deep learning technology have also begun to be widely used in image generation tasks such as AI painting, image beautification, and image restoration, providing users with high-quality image generation services.
[0003] In order to ensure that image generation services are provided to multiple users at the same time, program instances containing image generation models are usually deployed on multiple computing devices to meet the users' growing business needs.
[0004] However, in the process of allocating background computing devices to multiple users to perform image generation tasks, users and computing devices are usually allocated one-to-one. That is to say, for each computing device, the computing device will only perform image generation tasks for the user within the validity period of the user's contract. Even if the shared computing device is idle, it will not provide services to other users. This method has low device utilization and greatly wastes the computing resources of the device.
[0005] Therefore, how to improve equipment utilization in the process of executing image generation tasks for multiple users is an urgent problem to be solved. Summary of the invention
[0006] This specification provides a task execution method, device, storage medium and electronic device to partially solve the above-mentioned problems existing in the prior art.
[0007] This manual adopts the following technical solutions:
[0008] This specification provides a task execution method, including:
[0009] Receive a task execution request for a target task from a user, and obtain device information of each shared computing device and corresponding operation status information of each shared computing device at a current moment, wherein for each shared computing device, a program instance required to execute the target task is pre-deployed on the shared computing device, and each shared computing device includes a computing device used by other users to execute tasks;
[0010] According to the task execution request, acquiring the task configuration information pre-set by the user for the target task, and, based on the running status information, determining each candidate device among the shared computing devices;
[0011] According to the device information of each candidate device, a shared computing device that meets the computing power requirements corresponding to the task configuration information is determined among the candidate devices as the target device, and the target task is executed through the program instance deployed on the target device.
[0012] Optionally, the step of determining each candidate device from each shared computing device based on the running status information specifically includes:
[0013] For each shared computing device, determining whether the shared computing device is in an idle state according to the operation state information corresponding to the shared computing device;
[0014] If so, the shared computing device is used as the candidate device.
[0015] Optionally, the step of determining each candidate device from each shared computing device based on the running status information specifically includes:
[0016] For each shared computing device, determining the number of tasks currently executed by the shared computing device according to the operation status information corresponding to the shared computing device;
[0017] If the number of tasks currently executed by the shared computing device is lower than a preset number, the shared computing device is used as the candidate device.
[0018] Optionally, before the step of determining, from among the candidate devices, a shared computing device that meets the computing power requirement corresponding to the task configuration information according to the device information of the candidate devices, the method further includes:
[0019] Determining the priority corresponding to each shared computing device according to the device information of each shared computing device;
[0020] The step of determining, from among the candidate devices, a shared computing device that meets the computing power requirement corresponding to the task configuration information based on the device information of the candidate devices specifically includes:
[0021] If there are multiple candidate devices that meet the computing power requirements corresponding to the task configuration information, the target device is determined according to the priority corresponding to each candidate device that meets the computing power requirements corresponding to the task configuration information.
[0022] Optionally, the step of determining the priority corresponding to each shared computing device according to the device information of each candidate device specifically includes:
[0023] For each shared computing device, determine the computing power that the shared computing device can provide when executing the task according to the device information of the shared computing device;
[0024] The priority of each shared computing device is determined based on the computing power that each shared computing device can provide when executing a task, wherein for each shared computing device, the greater the computing power that the shared computing device can provide when executing a task, the greater the priority corresponding to the shared computing device.
[0025] Optionally, before the step of determining, according to the device information, a shared computing device that meets the computing power requirement corresponding to the task configuration information from among the candidate devices, the method further includes:
[0026] Determine a shared computing device where a program instance on which the user has historically performed configuration operations is located as a configured device;
[0027] The step of determining, from among the candidate devices, a shared computing device that meets the computing power requirement corresponding to the task configuration information according to the device information specifically includes:
[0028] If there are multiple candidate devices that meet the computing power requirements corresponding to the task configuration information, and the candidate devices that meet the computing power requirements corresponding to the task configuration information include the configured device, the configured device is used as the target device.
[0029] Optionally, the method further comprises:
[0030] After the target task is completed, the task data obtained by executing the target task is stored in a preset storage device;
[0031] After receiving the download request from the user, the task data is read from the storage device and sent to the user according to the download request.
[0032] Optionally, the step of executing the target task through the program instance deployed on the target device specifically includes:
[0033] If an abnormality occurs in the target device when executing the target task, the candidate devices are re-determined, and a shared computing device that meets the computing power requirements corresponding to the task configuration information is determined from the re-determined candidate devices to execute the target task.
[0034] Optionally, the target task includes: an image generation task;
[0035] The task configuration information includes: image quality, image quantity, image style, keywords used to generate images, parameter information of an image generation model used to generate images, and at least one of a device configuration selected by a user, of images generated by the program instance.
[0036] This specification provides a task execution device, including:
[0037] an acquisition module, configured to receive a task execution request from a user for a target task, and acquire device information of each shared computing device and corresponding operation status information of each shared computing device at a current moment, wherein for each shared computing device, a program instance required for executing the target task is pre-deployed on the shared computing device, and each shared computing device includes a shared computing device used by other users to execute tasks;
[0038] a determination module, configured to obtain, according to the task execution request, task configuration information pre-set by the user for the target task, and to determine candidate devices among the shared computing devices based on the running status information;
[0039] An execution module is used to determine, according to the device information of each candidate device, a shared computing device that meets the computing power requirements corresponding to the task configuration information among the candidate devices as the target device, and execute the target task through the program instance deployed on the target device.
[0040] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned task execution method is implemented.
[0041] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned task execution method when executing the program.
[0042] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0043] In the task execution method provided in the present specification, a task execution request for a target task is received from a user, and device information of each shared computing device and the corresponding operating status information of each shared computing device at the current moment are obtained; according to the task execution request, the task configuration information pre-set by the user for the target task is obtained, and, based on the operating status information, each candidate device is determined in each shared computing device; according to the device information of each candidate device, a shared computing device that meets the computing power requirements corresponding to the task configuration information is determined in each candidate device as the target device, and the target task is executed through the program instance deployed on the target device.
[0044] It can be seen from the above method that in the process of executing the target task, this solution can determine the candidate devices based on the status information of different shared computing devices at the current moment, and further select the target device that meets the task requirements from the candidate devices. Compared with the current method of one-to-one allocation of users and computing devices, this solution fully utilizes the computing resources of each available shared computing device to execute tasks based on the status information of the shared computing device, realizes the resource sharing and flexible scheduling of computing devices, and greatly improves the resource utilization rate of shared computing devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0046] Figure 1 A flowchart of a task execution method provided in this specification;
[0047] Figure 2 A schematic diagram of a management architecture of a computing device provided in this specification;
[0048] Figure 3 A schematic diagram of a task execution device provided in this specification;
[0049] Figure 4 A method corresponding to the Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0051] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0052] Figure 1 A flowchart of a task execution method provided in this specification includes the following steps:
[0053] S101: Receive a task execution request for a target task from a user, and obtain device information of each shared computing device and the corresponding operating status information of each shared computing device at the current moment, wherein for each shared computing device, a program instance required to execute the target task is pre-deployed on the shared computing device, and each shared computing device includes a computing device used by other users to execute tasks.
[0054] In multi-image generation tasks, program instances of deep learning models (such as Stable Diffusion) are usually deployed in different computing devices to provide services to multiple users at the same time. However, currently, WebUI can only be provided to the outside world through one-to-one allocation of access addresses or using gateway allocation. In this process, each user who signs up or registers for the service will be assigned a computing device that is limited to the user's task execution within the validity period. After the user accesses the service link, it will jump to the WebUI terminal dedicated to the computing device to perform subsequent tasks. This process will not only cause a waste of computing resources, but also increase the service cost to a certain extent.
[0055] Based on this, this specification provides a task execution method, which provides users with a unified access portal, realizes the monitoring and scheduling of shared computing devices within the system, and solves problems such as resource management, task allocation and node communication.
[0056] In this specification, the execution subject used to implement a task execution method can be a designated device such as a server. For the sake of ease of description, the following will only take the server as the execution subject as an example to illustrate a task execution method provided in this specification.
[0057] The server may receive a task execution request for a target task, and obtain device information of each shared computing device and corresponding operation status information of each shared computing device at the current moment.
[0058] In this specification, the above-mentioned target tasks can be image generation tasks such as AI painting, image beautification and image restoration. Users can access the service facade of the server provided by the server, and through the service facade, set the image quality, number of images, image style, and keywords used to generate images of the program instance, and select the image generation model used to generate the image and the configuration of the shared computing device.
[0059] After the user sets the above information, the task execution request can be sent to the server through the server facade, where the service facade accessed by the user can be a client page provided by the Application Programming Interface (API) interface or a Web page.
[0060] Of course, the above-mentioned target tasks may also be other tasks such as target recognition, anomaly detection, and natural language processing, and this specification does not make specific limitations on this.
[0061] The device information of the shared computing device may include the types and specific models of computing resources required to execute the target task, such as graphics processing unit (GPU), natural processing unit (NPU), central processing unit (CPU), etc. Different types and models of computing resources can provide different amounts of computing power.
[0062] The running state information corresponding to each shared computing device at the current moment may include the number of computing tasks currently being executed by the shared computing device. When no task is executed on the shared computing device, its corresponding running state is an idle state.
[0063] For each shared computing device, a program instance required for executing the target task is pre-deployed on the shared computing device. Taking the target task as an image generation task as an example, a program instance of an image generation model is deployed on each device.
[0064] In the process of deploying program instances, Ubuntu and Docker software can be pre-installed on each shared computing device. Developers can download the operating environment image of the program instance to the local computer in advance and provide a startup script so that the system can start external services. After configuring a shared computing device, a snapshot is generated for the system, and the program instances are installed in batches on all shared computing devices through the installation and maintenance software.
[0065] Each shared computing device can execute tasks submitted by each user, that is, the shared computing device includes computing devices used by other users to execute tasks, rather than being exclusively used by a certain user.
[0066] S102: According to the task execution request, obtaining the task configuration information pre-set by the user for the target task, and, based on the running status information, determining each candidate device in the shared computing devices.
[0067] After receiving the task execution request, the server can determine the task configuration information pre-set for the target task carried in the task request. When the target task is an image generation task, the corresponding task configuration information may include: image quality (such as resolution, clarity, frame size, etc.) of the image generated by the program instance, number of images, image style (such as ancient style, realism, comics, etc.), keywords used to generate images, parameter information of the image generation model used to generate images, and at least one of the device configurations selected by the user.
[0068] In addition, the user may also determine candidate devices among the shared computing devices based on the operating status information.
[0069] In this specification, there are multiple ways to determine the candidate device, wherein for each shared computing device, the server can determine whether the shared computing device is in an idle state according to the running status information corresponding to the shared computing device, and if the shared computing device is in an idle state, the shared computing device is used as a candidate device, otherwise the shared computing device is not used as a candidate device. This method is mainly used for shared computing devices with low computing power, and each shared computing device is only allowed to execute one task at the same time.
[0070] In another embodiment, for each shared computing device, the server can determine the number of tasks currently executed by the shared computing device according to the running status information corresponding to the shared computing device, and if the number of tasks currently executed by the shared computing device is lower than the preset number, the shared computing device is used as a candidate device, otherwise the shared computing device is not used as a candidate device. The above preset number can be set according to actual conditions, and this specification does not specifically limit this.
[0071] Furthermore, the server can also determine the maximum executable task volume corresponding to different shared computing devices without affecting computing efficiency based on the device information corresponding to each shared computing device. For each shared computing device, if the task data is lower than a preset number, the shared computing device will be used as a candidate device, otherwise the shared computing device will not be used as a candidate device.
[0072] S103: According to the device information of each candidate device, determine a shared computing device that meets the computing power requirements corresponding to the task configuration information from each candidate device as the target device, and execute the target task through the program instance deployed on the target device.
[0073] After determining the candidate devices, the server can determine, based on the device information corresponding to each candidate device, a shared computing device that meets the computing power requirements corresponding to the task configuration information among the candidate devices as the target device.
[0074] Specifically, the server can determine the priority corresponding to each shared computing device based on the device information of each shared computing device, wherein for each shared computing device, the server can determine the computing power that the shared computing device can provide when executing a task based on the device information of the shared computing device. Then, the priority corresponding to each shared computing device is determined based on the computing power that each shared computing device can provide when executing a task. For each shared computing device, the greater the computing power that the shared computing device can provide when executing a task, the greater the priority corresponding to the shared computing device, and vice versa.
[0075] When there are multiple shared computing devices that meet the computing power requirements corresponding to the task configuration information, the server can determine the target device according to the priority corresponding to each candidate device that meets the computing power requirements corresponding to the task configuration information.
[0076] In this specification, the server can use the candidate device with the highest priority as the target device. In this way, when there are multiple shared computing devices that can perform the target task, the server can give priority to the idle shared computing device with the highest computing power to perform the target task, thereby improving the efficiency of task execution.
[0077] When a user executes historical tasks through a shared computing device, the user may perform personalized configuration on the current program instance, such as uploading a new model, supplementing scripts, modifying parameters, etc. In order to ensure that the user does not need to reconfigure the program instance the next time he executes the target task and improve the task execution efficiency, the server can use the shared computing device where the program instance where the user has historically performed configuration operations is located as the configured shared computing device corresponding to the user.
[0078] After the server receives the user's task execution request, if there are multiple candidate devices that meet the computing power requirements corresponding to the task configuration information of the target task, and the candidate devices that meet the computing power requirements corresponding to the task configuration information include configured devices in which the user has historically configured program instances, then the configured device will be used as the target device.
[0079] After determining the target device, the server can execute the target task through the program instance deployed on the target device.
[0080] In this specification, the server may be provided with a device management module, which maintains the device status, device information, and priority of each shared computing device through a heartbeat mechanism. If an abnormality occurs in the target device (such as a crash, disconnection, etc.) when executing the target task, the server may re-determine each candidate device through the device management module, and determine the shared computing device that meets the computing power requirements corresponding to the task configuration information from the re-determined candidate devices to continue to execute the target task. For ease of understanding, this specification provides a schematic diagram of the management architecture of a computing device, such as Figure 2 shown.
[0081] Figure 2 A schematic diagram of a management architecture of a computing device provided in this specification.
[0082] Among them, the server can queue according to the priority and other strategies designed by the system, and select the appropriate node (computing device) through the node management module. The appropriate rules are not limited to the upper limit of resources accessible to users, whether there are currently idle nodes, node priority and other information.
[0083] The node management module in the cluster controller maintains the status of all shared computing devices in the computing device cluster through a heartbeat mechanism. The node manager maintains the device information, priority, and operating status of the computing devices.
[0084] After the target task is completed, the server can store the task data obtained by executing the target task in a preset storage device. After receiving the user's download request, the server can read the task data from the storage device and send it to the user according to the download request.
[0085] For example, in an image generation task, the shared computing device may send the generated image to a storage device for storage, and after receiving a download request, may download the image in the storage device to a terminal device used by the user.
[0086] As can be seen from the above method, this solution can maintain the node (shared computing device) status through heartbeats and can quickly intervene in the management node. Through queuing algorithms and load balancing strategies, available nodes can be better allocated and cluster resources can be utilized as much as possible. Using containerization technology, the node environment can be easily maintained for subsequent upgrades. The server and the shared computing device cluster are in the same network segment, so the transmission speed will be very fast, but users do not necessarily access the facade through the same network segment. Therefore, the task module will upload the results to the object storage when the task is completed, and will not directly return the results through the service facade, reducing the pressure on the service facade and the server.
[0087] The above are one or more implementation task execution methods of this specification. Based on the same idea, this specification also provides corresponding task execution devices, such as Figure 3 shown.
[0088] Figure 3 A schematic diagram of a task execution device provided for this specification includes:
[0089] The acquisition module 301 is used to receive a task execution request from a user for a target task, and to acquire device information of each shared computing device and the corresponding operation status information of each shared computing device at the current moment, wherein for each shared computing device, a program instance required to execute the target task is pre-deployed on the shared computing device, and each shared computing device includes a shared computing device used by other users to execute tasks;
[0090] A determination module 302 is used to obtain, according to the task execution request, the task configuration information pre-set by the user for the target task, and to determine each candidate device among the shared computing devices based on the running state information;
[0091] The execution module 303 is used to determine, according to the device information of each candidate device, a shared computing device that meets the computing power requirements corresponding to the task configuration information among the candidate devices as the target device, and execute the target task through the program instance deployed on the target device.
[0092] Optionally, the determination module 302 is specifically configured to determine, for each shared computing device, whether the shared computing device is in an idle state according to the operation state information corresponding to the shared computing device; if so, use the shared computing device as the candidate device.
[0093] Optionally, the determination module 302 is specifically used to determine, for each shared computing device, the number of tasks currently executed by the shared computing device according to the operating status information corresponding to the shared computing device; if the number of tasks currently executed by the shared computing device is lower than a preset number, the shared computing device is used as the candidate device.
[0094] Optionally, before the step of determining, from among the candidate devices, a shared computing device that meets the computing power requirement corresponding to the task configuration information according to the device information of each candidate device, the determination module 302 is further configured to determine, according to the device information of each shared computing device, a priority corresponding to each shared computing device;
[0095] The execution module 303 is specifically used to determine the target device according to the priority corresponding to each candidate device that meets the computing power requirement corresponding to the task configuration information if there are multiple candidate devices that meet the computing power requirement corresponding to the task configuration information.
[0096] Optionally, the determination module 302 is specifically used to determine, for each shared computing device, the computing power that the shared computing device can provide when executing a task based on the device information of the shared computing device; and determine the priority corresponding to each shared computing device based on the computing power that each shared computing device can provide when executing a task, wherein, for each shared computing device, the greater the computing power that the shared computing device can provide when executing a task, the greater the priority corresponding to the shared computing device.
[0097] Optionally, before the step of determining, from among the candidate devices, a shared computing device that meets the computing power requirement corresponding to the task configuration information according to the device information, the determination module 302 is further configured to determine, as a configured device, a shared computing device where a program instance on which the user has historically performed a configuration operation is located;
[0098] The execution module 303 is specifically used to, if there are multiple candidate devices that meet the computing power requirements corresponding to the task configuration information, and the candidate devices that meet the computing power requirements corresponding to the task configuration information include the configured device, use the configured device as the target device.
[0099] Optionally, the device further comprises:
[0100] The storage module 304 is used to store the task data obtained by executing the target task in a preset storage device after the target task is completed; after receiving the user's download request, read the task data from the storage device according to the download request and send it to the user.
[0101] Optionally, the execution module 303 is specifically used to, if an exception occurs in the target device when executing the target task, redetermine each candidate device, and determine a shared computing device that meets the computing power requirements corresponding to the task configuration information from the redetermined candidate devices to execute the target task.
[0102] Optionally, the target task includes: an image generation task;
[0103] The task configuration information includes: image quality, image quantity, image style, keywords used to generate images, parameter information of an image generation model used to generate images, and at least one of a device configuration selected by a user, of images generated by the program instance.
[0104] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 Provides a task execution method.
[0105] This manual also provides Figure 4 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Figure 4 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other tasks. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0106] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0107] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0108] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0109] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0110] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0111] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0112] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0114] In a typical configuration, a shared computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0115] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0116] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a shared computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0117] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0118] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0119] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0120] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0121] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.
Claims
1. A task execution method, It is characterized in that include: Receive a task execution request for a target task from a user, and obtain device information of each shared computing device and corresponding operation status information of each shared computing device at a current moment, wherein for each shared computing device, a program instance required to execute the target task is pre-deployed on the shared computing device, and each shared computing device includes a computing device used by other users to execute tasks; According to the task execution request, acquiring the task configuration information pre-set by the user for the target task, and, based on the running status information, determining each candidate device among the shared computing devices; According to the device information of each candidate device, a shared computing device that meets the computing power requirements corresponding to the task configuration information is determined among the candidate devices as the target device, and the target task is executed through the program instance deployed on the target device.
2. The method according to claim 1, It is characterized in that The step of determining each candidate device in each shared computing device based on the running status information specifically includes: For each shared computing device, determining whether the shared computing device is in an idle state according to the operation state information corresponding to the shared computing device; If so, the shared computing device is used as the candidate device.
3. The method according to claim 1, It is characterized in that The step of determining each candidate device in each shared computing device based on the running status information specifically includes: For each shared computing device, determining the number of tasks currently executed by the shared computing device according to the operation status information corresponding to the shared computing device; If the number of tasks currently executed by the shared computing device is lower than a preset number, the shared computing device is used as the candidate device.
4. The method according to claim 1, It is characterized in that Before the step of determining, from among the candidate devices, a shared computing device that meets the computing power requirement corresponding to the task configuration information based on the device information of the candidate devices, the method further includes: Determining the priority corresponding to each shared computing device according to the device information of each shared computing device; The step of determining, from among the candidate devices, a shared computing device that meets the computing power requirement corresponding to the task configuration information based on the device information of the candidate devices specifically includes: If there are multiple candidate devices that meet the computing power requirements corresponding to the task configuration information, the target device is determined according to the priority corresponding to each candidate device that meets the computing power requirements corresponding to the task configuration information.
5. The method according to claim 4, It is characterized in that The step of determining the priority corresponding to each shared computing device according to the device information of each candidate device specifically includes: For each shared computing device, determine the computing power that the shared computing device can provide when executing the task according to the device information of the shared computing device; The priority of each shared computing device is determined based on the computing power that each shared computing device can provide when executing a task, wherein for each shared computing device, the greater the computing power that the shared computing device can provide when executing a task, the greater the priority corresponding to the shared computing device.
6. The method according to claim 1, It is characterized in that Before the step of determining, according to the device information, a shared computing device that meets the computing power requirement corresponding to the task configuration information from among the candidate devices, the method further includes: Determine a shared computing device where a program instance on which the user has historically performed configuration operations is located as a configured device; The step of determining, from among the candidate devices, a shared computing device that meets the computing power requirement corresponding to the task configuration information according to the device information specifically includes: If there are multiple candidate devices that meet the computing power requirements corresponding to the task configuration information, and the candidate devices that meet the computing power requirements corresponding to the task configuration information include the configured device, the configured device is used as the target device.
7. The method according to claim 1, It is characterized in that The method further comprises: After the target task is completed, the task data obtained by executing the target task is stored in a preset storage device; After receiving the download request from the user, the task data is read from the storage device and sent to the user according to the download request.
8. The method according to claim 1, It is characterized in that The step of executing the target task through the program instance deployed on the target device specifically includes: If an abnormality occurs in the target device when executing the target task, the candidate devices are re-determined, and a shared computing device that meets the computing power requirements corresponding to the task configuration information is determined from the re-determined candidate devices to execute the target task.
9. The method according to claim 1, It is characterized in that The target tasks include: image generation tasks; The task configuration information includes: image quality, image quantity, image style, keywords used to generate images, parameter information of an image generation model used to generate images, and at least one of a device configuration selected by a user, of images generated by the program instance.
10. A task execution device, It is characterized in that include: an acquisition module, configured to receive a task execution request from a user for a target task, and acquire device information of each shared computing device and corresponding operation status information of each shared computing device at a current moment, wherein for each shared computing device, a program instance required for executing the target task is pre-deployed on the shared computing device, and each shared computing device includes a shared computing device used by other users to execute tasks; a determination module, configured to obtain, according to the task execution request, task configuration information pre-set by the user for the target task, and to determine candidate devices among the shared computing devices based on the running status information; An execution module is used to determine, according to the device information of each candidate device, a shared computing device that meets the computing power requirements corresponding to the task configuration information among the candidate devices as the target device, and execute the target task through the program instance deployed on the target device.
11. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Computing power resource adjusting method, system and device
CN109857542A
Computing power resource allocation method and device
CN110995614A
Application deployment method, device and equipment and computer readable storage medium
CN114840220A
Deployment method of service cluster
CN115150263A
Task scheduling method and device, equipment and storage medium
CN117149372A
Cited By
Image generation method, scheduling equipment, system and storage medium
CN121033213A
