Image generation method and system

By setting multiple task types in the image generation system and configuring preset traffic, the problem of inefficient image processing in the prior art is solved, efficient image processing in multiple scenarios is realized, and resource independence and computing efficiency are ensured.

CN119228624APending Publication Date: 2024-12-31ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411299111.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Existing image processing methods have challenges in multi-scene adaptability and resource utilization, which are inefficient and difficult to meet personalized needs.

Method used

Provide an image generation method and system, by presetting multiple task types and configuring preset proportional traffic for each task type, determining the task type of image processing request, and processing it within its corresponding traffic, ensuring that resources are independent avoid resource acquisition.

Benefits of technology

It improves the efficiency of image processing, simplifies system management, realizes exclusive resources for each task type, ensures computing efficiency and processing speed, and is suitable for image processing requirements in multiple scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228624A_ABST
    Figure CN119228624A_ABST
Patent Text Reader

Abstract

The invention provides an image generation method and system, and the method achieves the exclusive occupation of the preset proportion of flow for each task type in a mode of configuring the preset proportion of flow for each task type in a plurality of task types. After a plurality of image processing requests sent by a client are received and task types corresponding to the image processing requests are determined, the contained image processing requests can be processed in a preset proportion of traffic exclusively occupied by each task type, so that corresponding images are generated and sent to the client. The image generation method provided by the invention can be applied to image processing in multiple scenes, the image processing efficiency is improved, and the condition of resource occupation among multiple task types is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image generation method and system. Background Art

[0002] Traditional image processing methods, such as filter application and image editing, often require a lot of computing resources and manual user intervention, especially when dealing with complex scenes and style conversion, which are inefficient and difficult to meet personalized needs. In recent years, the development of deep learning technology has enabled artificial intelligence to automatically learn and generate high-quality images, greatly enriching the possibilities of image creation. However, existing technologies still face challenges in terms of multi-scene adaptability and resource occupation, which has become an urgent problem to be solved.

[0003] Therefore, it is necessary to provide an image generation method that can be applied to multiple scenarios.

[0004] The content of the background technology section is only the information known to the inventor personally, and does not mean that the above information has entered the public domain before the filing date of this specification, nor does it mean that it can become the prior art of this specification. Summary of the invention

[0005] This specification provides an image generation method and system.

[0006] In a first aspect, the present specification provides an image generation method, comprising: receiving multiple image processing requests sent by a client; determining the task type corresponding to each of the multiple image processing requests, wherein multiple task types are pre-set in the image generation system and a preset proportion of traffic is configured for each task type; for a task type, processing the image processing requests contained therein within its corresponding traffic to generate images corresponding to each of the contained image processing requests; and sending the images to the corresponding client.

[0007] In some embodiments, an image processing request includes: at least one image to be processed; determining the task type corresponding to each of the multiple image processing requests includes: for the image processing request, determining the corresponding task type based on the data of the object to be processed in the at least one image to be processed contained therein, the data of the object to be processed including the type and / or relationship of the object to be processed.

[0008] In some embodiments, an image processing request includes: an image processing scenario; and determining the task type corresponding to each of the multiple image processing requests includes: for the image processing request, determining the corresponding task type according to the image processing scenario contained therein.

[0009] In some embodiments, configuring a preset ratio of traffic for each task type includes: configuring traffic for each task type based on the total traffic of the image generation system and the preset ratio corresponding to each task type, wherein the sum of the preset ratios corresponding to the multiple task types is less than or equal to 1.

[0010] In some embodiments, the image processing requests contained in the corresponding traffic are processed to generate images corresponding to each of the contained image processing requests, including: determining the processing capacity corresponding to the task type based on the traffic corresponding to the task type, the processing capacity including a target number of image processing requests to be processed per unit time; and processing the contained image processing requests based on the processing capacity to generate the image.

[0011] In some embodiments, the processing of the image processing requests contained in the corresponding traffic to generate images corresponding to each of the image processing requests also includes: adding the image processing requests contained in the task type to the task queue corresponding to the task type in chronological order, in which the image processing requests with an earlier time are placed before the image processing requests with a later time.

[0012] In some embodiments, the processing of the included image processing requests based on the processing capability to generate the image includes: for one unit time, processing the target number of image processing requests queued in front of the task queue to generate corresponding images.

[0013] In some embodiments, before processing the image processing requests contained in the corresponding traffic to generate images corresponding to the respective image processing requests, the method further includes: allocating the image processing requests contained in the task type to a first preset number of slice queues, wherein the image processing requests contained in a slice queue are arranged in chronological order, and image processing requests earlier in time are arranged before image processing requests later in time.

[0014] In some embodiments, the image processing requests included are processed based on the processing capability to generate the image, including: for a unit time: selecting from each slice queue a second preset number of image processing requests that are arranged in front of the slice queue as image processing requests to be processed; and based on a preset probability corresponding to the task type, extracting the target number of image processing requests from the image processing requests to be processed for processing to generate a corresponding image.

[0015] In some embodiments, the preset probability is related to the first preset number and the second preset number.

[0016] In some embodiments, based on the preset probability corresponding to the task type, the target number of image processing requests are extracted from the image processing requests to be processed for processing to generate a corresponding image, including: based on the preset probability, the target number of image processing requests are randomly extracted from the image processing requests to be processed for processing to generate a corresponding image.

[0017] In some embodiments, the processing of the image processing requests contained within the corresponding traffic to generate images corresponding to each of the contained image processing requests also includes: processing a first image processing request to generate a corresponding image, wherein the first image processing request appears in the image processing requests to be processed within a preset number of unit times and is not processed.

[0018] In some embodiments, the preset number corresponding to the task type is related to the preset probability.

[0019] In some embodiments, the image processing requests contained in the corresponding traffic are processed to generate images corresponding to each of the contained image processing requests, and also includes: determining the estimated waiting time corresponding to each of the contained image processing requests; the method also includes: sending the estimated waiting time corresponding to each of the multiple image processing requests to the corresponding client.

[0020] In some embodiments, determining the estimated waiting time corresponding to each of the included image processing requests includes: assigning corresponding sorting numbers to the included image processing requests; and determining the estimated waiting time corresponding to each of the included image processing requests based on the distance between the current sorting number of the task type and the sorting number corresponding to each of the included image processing requests and the processing capacity of the task type.

[0021] In some embodiments, after receiving the multiple image processing requests sent by the client, the method further includes: saving the multiple image processing requests in a non-temporary memory.

[0022] In a second aspect, the present specification also provides an image generation system, comprising at least one storage medium and at least one processor, wherein the at least one storage medium stores at least one instruction set for performing an image generation method; the at least one processor is communicatively connected to the at least one storage medium, wherein the at least one processor reads the at least one instruction set when running, and executes the image generation method described in the first aspect according to the instructions of the at least one instruction set.

[0023] In a third aspect, the present specification also provides a computer-readable non-volatile storage medium, wherein the computer-readable non-volatile storage medium stores at least one instruction set, and when the at least one instruction set is executed by at least one processor, the image generation method as described in any one of the first aspects above is implemented.

[0024] It can be seen from the above technical solutions that the image generation method and system provided in this specification are applied to scenarios with multiple task types, and each task type corresponds to the image processing requests corresponding to different scenarios. In this specification, by configuring a preset proportion of traffic for each task type in multiple task types, the exclusive use of the preset proportion of traffic by each task type is achieved. After receiving multiple image processing requests sent by the client and determining the task type corresponding to each image processing request. The image processing requests contained in the preset proportion of traffic exclusively occupied by each task type can be processed to generate the corresponding image and send it to the client. This setting method makes the resources between multiple task types independent of each other and do not interfere with each other in image processing under multiple scenarios. The resource occupation between multiple task types is avoided, thereby improving the efficiency of image processing.

[0025] Other functions of the image generation method and system provided in this specification will be partially listed in the following description. The creative aspects of the image generation method and system provided in this specification can be fully explained by practicing or using the methods, devices and combinations described in the following detailed examples. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 A schematic diagram of an application scenario of an image generation system provided according to an embodiment of this specification is shown;

[0028] Figure 2 A schematic diagram of the hardware structure of a computing device provided according to some embodiments of this specification is shown;

[0029] Figure 3 A schematic diagram of a process of an image generating method provided according to some embodiments of this specification is shown;

[0030] Figure 4 A schematic flow chart of another image generating method provided according to some embodiments of this specification is shown;

[0031] Figure 5 A schematic diagram showing a flow chart of image generation steps provided according to some embodiments of the present specification; and

[0032] Figure 6 A flow chart of a flow control principle provided according to an embodiment of this specification is shown. DETAILED DESCRIPTION

[0033] The following description provides specific application scenarios and requirements of this specification, with the purpose of enabling those skilled in the art to make and use the contents of this specification. Various local modifications to the disclosed embodiments will be apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of this specification. Therefore, this specification is not limited to the embodiments shown, but to the widest scope consistent with the claims.

[0034] The terms used herein are only used for the purpose of describing specific example embodiments and are not restrictive. For example, unless the context clearly indicates otherwise, as used herein, the singular forms "a", "an" and "the" may also include plural forms. When used in this specification, the terms "include", "comprise" and / or "contain" mean that the associated integers, steps, operations, elements and / or components exist, but do not exclude the existence of one or more other features, integers, steps, operations, elements, components and / or groups or that other features, integers, steps, operations, elements, components and / or groups may be added in the system / method.

[0035] In view of the following description, these and other features of the present specification, as well as the operation and function of the related elements of the structure, and the economy of the combination and manufacture of the parts can be significantly improved. Reference is made to the accompanying drawings, all of which form a part of this specification. However, it should be clearly understood that the drawings are for illustration and description purposes only and are not intended to limit the scope of this specification. It should also be understood that the drawings are not drawn to scale.

[0036] The flowcharts used in this specification illustrate the operations implemented by the system according to some embodiments in this specification. It should be clearly understood that the operations of the flowcharts may not be implemented in sequence. On the contrary, the operations may be implemented in reverse order or simultaneously. In addition, one or more other operations may be added to the flowchart. One or more operations may be removed from the flowchart.

[0037] In this specification, "X includes at least one of A, B or C" means that X includes at least A, or X includes at least B, or X includes at least C. That is, X may include only any one of A, B, and C, or may include any combination of A, B, and C and other possible contents / elements at the same time. The any combination of A, B, and C may be A, B, C, AB, AC, BC, or ABC.

[0038] In this specification, unless explicitly stated otherwise, the association relationship between structures can be a direct association relationship or an indirect association relationship. For example, when describing "A is connected to B", unless it is explicitly stated that A is directly connected to B, it should be understood that A can be directly connected to B or indirectly connected to B; for another example, when describing "A is above B", unless it is explicitly stated that A is directly above B (AB is adjacent and A is above B), it should be understood that A can be directly above B or indirectly above B (AB is separated by other elements and A is above B). And so on.

[0039] It should be noted that the user data obtained in this manual is authorized by the user and does not involve user privacy.

[0040] For the convenience of description, the terms that will appear in the following text of this specification are first explained.

[0041] GPU computing power, that is, the computing power of the graphics processing unit (Graphics Processing Unit), refers to the amount of calculations that the GPU can perform per unit time, especially its ability to process floating-point operations.

[0042] Database persistence (DB persistence) refers to the process of transferring data from volatile storage (such as memory) to persistent storage (such as hard disk) to ensure that the data is still available after the program or system crashes and restarts.

[0043] In existing image processing scenarios, this is generally achieved through a single-machine QPS (Queries Per Second) current limiting queue solution. The single-machine QPS current limiting solution controls the number of image processing requests that pass through a fixed time window by setting a QPS current limiting value for each server (standalone) in the cluster, thereby ensuring the stability of the system. However, when processing requests from different sources or different types, the single-machine QPS current limiting solution will lead to resource occupation and resource snatching. Requests with larger computational loads will occupy more resources, causing other requests to wait too long, affecting the user experience.

[0044] The image generation method and system provided in this specification can solve the technical problems existing in the above-mentioned existing solutions. In the image generation system of this specification, multiple task types are pre-set, and each task type is configured with a preset proportion of traffic. For multiple image processing requests sent by the client, the image generation system can determine the task type corresponding to each image processing request; the image generation system will process the image processing requests contained in each task type within the traffic corresponding to each task type to generate an image corresponding to each image processing request, and send the generated image to the corresponding client. In the image generation method and system provided in this specification, the resources between multiple task types are independent of each other and do not interfere with each other. Resource occupation between multiple task types is avoided, thereby improving the efficiency of image processing.

[0045] In the image generation method and system provided in this specification, each task type has a corresponding preset ratio of GPU resources. For a preset ratio of GPU resources corresponding to a task type 1, other task types are not allowed to simultaneously access or share the preset ratio of GPU resources corresponding to the above task type 1. This setting method makes it possible for all computing units, memory and other resources of the GPU to focus on processing image processing requests under the current task type for the preset ratio of GPU resources corresponding to each task type, so as to achieve the highest computing efficiency and the fastest processing speed. When the preset ratio of GPU resources is monopolized by one task type, no other task types will compete for the preset ratio of GPU resources, thereby avoiding performance degradation and instability. In addition, in the case where each task type has a corresponding preset ratio of GPU resources, there is no need for complex resource scheduling strategies to balance resource allocation between multiple tasks, which simplifies system management and optimization.

[0046] The image generation method and system provided in this specification have a wide range of application scenarios and can be applied to various scenarios where image processing is required, especially image processing involving multiple scenarios. For example, the image processing scenarios involved in the image generation method and system may include, but are not limited to, any combination of scenarios such as artificial intelligence image generation scenarios, image recognition scenarios, image analysis scenarios, image synthesis scenarios, or image restoration scenarios. It should be understood that the above embodiments are only exemplary descriptions, and the specific application scenarios of the image generation method can be flexibly adjusted according to user needs. It only needs to be a scenario for processing image processing requests for multiple scenarios, and is not limited to the above embodiments.

[0047] It should be noted that the above-mentioned application scenario is only one of the multiple usage scenarios provided in this specification. Those skilled in the art should understand that when the image generation method and system provided in this specification are applied to other usage scenarios, their implementation methods and technical effects are similar.

[0048] Figure 1 The image generation method provided in this specification can be applied to the following: Figure 1 In the application scenario 100 shown in FIG. Figure 1 As shown, the application scenario 100 may include a user 110, a terminal 120, and an image generation system 130 (hereinafter referred to as system 130).

[0049] User 110 may be any user 110 who inputs an image processing request to system 130 and hopes to obtain an image corresponding to the image processing request through system 130. User 110 may submit an image processing request under a relevant scenario through terminal 120. Terminal 120 may send the obtained image processing request to system 130 and receive an image generated by system 130 for the image processing request. User 110 may be a user who needs to generate an image. For example, a user may input an image processing request in the hope of obtaining an image corresponding to the image processing request in a preset style or a specific scenario. For example, a user hopes to obtain a cartoon-style image corresponding to the image processing request or an image under a New Year scene, an image under a retro scene, and so on. Alternatively, user 110 may be a user who needs to repair an image to be processed contained in an image processing request. For example, user 110 inputs an old photo as an image to be processed and hopes to obtain a clear photo corresponding to the old photo after repair through processing by system 130. Alternatively, user 110 may be a user who needs to synthesize the to-be-processed images contained in the image processing request. For example, the user inputs multiple portrait photos and hopes to obtain an image after the multiple portrait photos are synthesized into one photo through processing by system 130 .

[0050] The user 110 needs to upload an image processing request through the terminal 120 and obtain the image corresponding to the image processing request output by the system 130. The terminal 120 may be a device for interacting with the user 110. The user 110 may input an image processing request to the terminal 120 through the input and output devices of the terminal 120, and may also receive an image corresponding to the image processing request from the terminal 120. In some embodiments, the terminal 120 may include a hardware device with a data information processing function and an application necessary to drive the hardware device to work. The application can provide the user 110 with the ability and interface to interact with the outside world through the network. For example, the terminal 120 may have an application that provides the above-mentioned image processing function. For example, an application that provides an image generation function, an application that provides an image repair function, an application that provides an image merging function, and so on. The terminal 120 may receive the image processing request input by the user 110 through the interactive interface of this application, and output the image corresponding to the image processing request to the user 110. For example, the terminal 120 may receive the image processing request input by the user 110 for the image merging scenario, and output the image corresponding to the above-mentioned image processing request to the user 110. For example, the terminal 120 may receive an image processing request for an image generation scenario input by the user 110 , and output an image corresponding to the image processing request to the user 110 .

[0051] In some embodiments, the terminal 120 may include a mobile device, a tablet computer, a laptop computer, a built-in device of a motor vehicle, or the like, or any combination thereof. In some embodiments, the mobile device may include a smart home device, a smart mobile device, a virtual reality device, an augmented reality device, or the like, or any combination thereof. In some embodiments, the smart home device may include a smart TV, a desktop computer, or the like, or any combination thereof. In some embodiments, the smart mobile device may include a smart phone, a personal digital assistant, a gaming device, a navigation device, or the like, or any combination thereof. In some embodiments, the built-in device in a motor vehicle may include an onboard computer, an onboard TV, or the like.

[0052] The system 130 may be a background server that provides services to the terminal 120. For example, the system 130 may be a background server that performs image processing. The system 130 may be connected to the terminal 120 for communication. The system 130 may be connected to multiple terminals 120 for communication, and receive image processing requests sent by multiple terminals 120. The system 130 may store data or instructions for executing the image generation method described in this specification, and may execute or be used to execute data or instructions. For example, when multiple users 110 submit multiple image processing requests through multiple terminals 120, the system 130 processes the image processing request and responds to the request, executing the image generation method provided in this specification. The system 130 may process the image processing request within the traffic corresponding to the above-mentioned task type based on the task type corresponding to the image processing request, so as to generate an image corresponding to the image processing request.

[0053] The system 130 may be a single computing device or a cluster system composed of multiple computing devices. The data or instructions stored in the system 130 for executing the image generation method described in this specification may adopt any form of system architecture, such as a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.

[0054] It should be understood that Figure 1 The application scenario shown is only one of the multiple application scenarios provided in this specification. Figure 1 The numbers of users 110, terminals 120, and systems 130 shown in FIG. 1 are merely illustrative and may be any number depending on implementation requirements.

[0055] Figure 2 FIG. 2 shows a hardware structure diagram of a computing device 200 provided according to some embodiments of the present specification. The computing device 200 may be a computing device in the system 130. Figure 2 As shown, computing device 200 includes at least one storage medium 230 and at least one processor 220. In some embodiments, computing device 200 may further include an internal communication bus 210. In some embodiments, computing device 200 may further include a communication port 250. In some embodiments, computing device 200 may further include an I / O component 260.

[0056] Internal communication bus 210 may connect various system components, including storage media 230 and processor 220. I / O components 260 support input / output between computing device 200 and other components.

[0057] The storage medium 230 may include a data storage device. The data storage device may be a non-temporary storage medium or a temporary storage medium. For example, the data storage device may include one or more of a disk 232, a read-only storage medium (ROM) 234, or a random access storage medium (RAM) 236. The storage medium 230 also includes at least one instruction set stored in the data storage device. The instruction set is a computer program code, and the computer program code may include a program, a routine, an object, a component, a data structure, a process, a module, etc. for executing the image generation method provided in this specification.

[0058] The communication port 250 is used for data communication between the computing device 200 and the outside world. For example, the computing device 200 can be connected to the network through the communication port 250. At least one processor 220 is connected to at least one storage medium 230 through the internal communication bus 210. At least one processor 220 is used to execute the at least one instruction set. When the system 130 is running, the at least one processor 220 reads the at least one instruction set and executes the image generation method provided in this specification according to the instructions of the at least one instruction set.

[0059] The processor 220 can perform all the steps included in the image generation method. The processor 220 can be in the form of one or more processors. The processor 220 can issue execution instructions. The processor 220 may include one or more hardware processors, such as a microcontroller, a microprocessor, a reduced instruction set computer (RISC), an application-specific integrated circuit (ASIC), an application-specific instruction set processor (ASIP), a central processing unit (CPU), a graphics processing unit (GPU), a physical processing unit (PPU), a microcontroller unit, a digital signal processor (DSP), a field programmable gate array (FPGA), an advanced RISC machine (ARM), a programmable logic device (PLD), any circuit or processor capable of performing one or more functions, etc., or any combination thereof.

[0060] For illustrative purposes only, only one processor 220 is described in the computing device 200 in this specification. However, it should be noted that the computing device 200 in this specification may also include multiple processors, and therefore, the operations and / or method steps disclosed in this specification may be performed by one processor as described in this specification, or may be performed jointly by multiple processors. For example, if the processor 220 of the computing device 200 in this specification performs step A and step B, it should be understood that step A and step B may also be performed jointly or separately by two different processors 220 (e.g., the first processor performs step A, the second processor performs step B, or the first and second processors perform steps A and B together).

[0061] Figure 3A schematic diagram of a process of an image generating method provided according to some embodiments of this specification is shown; Figure 4 A schematic flow chart of another image generating method provided according to some embodiments of the present specification is shown. Figure 4 Yes Figure 3 The processing flow is exemplified in an intuitive manner. The image generation method P300 is applied to the image generation system 130. As previously mentioned, the system 130 can be connected to multiple terminals 120 for communication, and receive image processing requests sent by multiple terminals 120. The system 130 can execute the image generation method P300 provided in this specification in response to the image processing request. As previously mentioned, the computing device 200 can execute the image generation method P300 of this specification. Specifically, the processor 220 in the computing device 200 can read the instruction set stored in its local storage medium, and then execute the image generation method P300 of this specification according to the provisions of the instruction set. Figure 3 As shown, the method P300 provided in this specification includes S310-S370.

[0062] S310: receiving multiple image processing requests sent by the client.

[0063] The client may be the aforementioned terminal 120. Multiple image processing requests may come from multiple terminals 120. The system 130 may receive an image processing request input by the user 110. The way in which the user 110 inputs the image processing request may be, for example, that the user 110 logs in to an application for image generation on the terminal 120 and then uploads the image processing request through a preset entrance of the application. That is, the way in which the user uploads the image processing request is online uploading.

[0064] Among them, in order to ensure that multiple image processing requests can be persisted and saved for subsequent processing and recording. Multiple image processing requests can be saved in non-temporary storage, that is, non-volatile storage, such as a hard disk drive or a solid-state drive. Non-temporary storage can still retain data after the system is powered off. Therefore, saving multiple image processing requests in such storage can ensure that even in the event of unexpected situations, such as power outages or system failures, no relevant information of any image processing request will be lost. The above method ensures the continuity and reliability of the image processing process. It not only improves the security of the data corresponding to multiple image processing requests, but also lays a solid foundation for subsequent image processing operations, ensuring that each image processing request can be properly managed and executed.

[0065] In some embodiments, an image processing request includes: at least one image to be processed. The image processing request includes a request to process at least one image to be processed. The method for user 110 to upload at least one image to be processed may be, for example, that user 110 selects at least one pre-shot image to be processed in the photo album of terminal 120 and uploads it. Alternatively, user 110 may authorize a camera to shoot at least one image to be processed and upload it. Alternatively, user 110 may also select one or more images to be processed from at least one image to be processed uploaded in history as the images to be processed to be uploaded this time. It should be understood that the above embodiments are only exemplary descriptions, and the specific method of uploading the images to be processed can be flexibly adjusted according to user needs, and this specification does not impose any restrictions on this.

[0066] In some embodiments, in addition to at least one image to be processed, an image processing request may also include an image processing demand. The image processing demand may include a method for performing image processing on at least one image to be processed. The image processing request includes a request for processing at least one image to be processed according to the image processing demand. In some embodiments, the image processing demand may also be referred to as an image processing scenario. For example, the image processing demand may be artificial intelligence image generation, image recognition, image analysis, image synthesis, or image restoration, etc. The method in which the user 110 determines the image processing demand may be, for example, that the user 110 performs the operation in a plurality of image processing demands or image processing scenario options pre-set by the terminal 120. Alternatively, the user 110 may also input the image processing demand. Alternatively, the terminal 120 may automatically determine the image processing demand based on the type or style of at least one image to be processed uploaded by the user 110. Alternatively, the terminal 120 may determine the image processing demand corresponding to the image to be processed this time based on the images to be processed and their corresponding image processing demands uploaded by the user 110 in the past. It should be understood that the above embodiments are only exemplary descriptions, and the specific uploading method of the image to be processed may be flexibly adjusted according to the needs of the user, and this specification does not impose any restrictions thereon.

[0067] In some embodiments, an image processing request includes: a segment of characters. For example, a user can enter a segment of characters "Please generate an image, the image content is our family of four happily making dumplings during the Chinese New Year." Or a segment of characters can be entered "Please generate an image with a warm style, the image content is a little girl playing in the park on a sunny afternoon." The way for user 110 to upload a segment of characters can be to edit and input a segment of characters through terminal 120. Alternatively, user 110 can enter a segment of characters by pasting in the preset input box of the application. Alternatively, user 110 can generate and enter a segment of characters in a random generation method in the preset input box of the application. Alternatively, the user can select one or more segments of characters from at least one segment of characters uploaded in the history (if there are multiple segments, the multiple segments of characters are merged into one segment of characters) as the segment of characters uploaded this time. It should be understood that the above embodiments are only exemplary descriptions, and the specific upload method of a segment of characters can be flexibly adjusted according to user needs, and this specification does not impose any restrictions here.

[0068] In some embodiments, an image processing request includes: at least one image to be processed and a segment of characters. The user can upload at least one image to be processed as the basis for image generation and enter a segment of characters. The characters are used as a supplementary description of the image that the user expects to generate. For example, when the user uploads at least one image to be processed, he / she enters a segment of characters "I want to generate an image in the style of oil painting". The segment of characters entered by the user can instruct the system to generate an image in the style of oil painting corresponding to the image to be processed. In some embodiments, the segment of characters mentioned above can serve as the aforementioned image processing request.

[0069] It should be understood that the above embodiments are merely exemplary, and the content included in a specific image processing request can be flexibly adjusted according to user needs and is not limited to the above embodiments.

[0070] S330: Determine the task type corresponding to each of the plurality of image processing requests.

[0071] Among them, a plurality of task types are pre-set in the image generation system 130, and a preset ratio of traffic is configured for each task type. In some embodiments, the way to configure the traffic may be to configure the traffic for each task type according to the total traffic of the image generation system and the preset ratio corresponding to each task type, wherein the sum of the preset ratios corresponding to each of the plurality of task types is less than or equal to 1. In some embodiments, the task type can be understood as a task scenario. That is, different task types correspond to different image processing tasks. For example, the task type may be an artificial intelligence image generation task, an image recognition task, an image analysis task, an image synthesis task, or an image restoration task, and so on. In some embodiments, dedicated task types, such as member task types, may be opened for special users (such as member users of different levels). In some embodiments, the task type may be understood as being classified according to the task scenario, and at this time a task type may include multiple task scenarios. It should be understood that, Figure 4 Although three task types are shown, namely, task type 1, task type 2, and task type 3. However, in actual applications, the number of task types can be flexibly adjusted according to the scene settings, and can be set to 2 task types, 4 task types, or more. The specific number of task types is not limited to that given in the above embodiment and can be flexibly expanded.

[0072] In the embodiments of the present specification, different task types may have different processing methods for the processed images. For example, under the artificial intelligence image generation task type, the processed image may be subjected to artificial intelligence image processing under the current scene setting to generate a corresponding image. The generation method may be: taking the entire image to be processed as a unit, directly performing artificial intelligence image processing on the entire image to be processed to generate an image corresponding to the image to be processed. Under the image synthesis task type, the generation method may be: taking each object to be processed (human object, animal object or object object, etc.) in the image to be processed as a unit. Perform artificial intelligence image processing under the current scene setting on each object to be processed respectively to generate an object image corresponding to each object to be processed. After merging multiple object images contained in the image to be processed, an image corresponding to the image to be processed is generated. It should be understood that the above embodiments are only exemplary descriptions, and the processing methods corresponding to specific different task types can be flexibly adjusted according to user needs, as long as different task types correspond to different processing methods, for example, different task types correspond to different image styles. The image processing style corresponding to the first task type may be oil painting style, the image processing style corresponding to the second task type may be minimalist style, and the image processing style corresponding to the third task type may be ancient style, which is not limited to the above embodiments.

[0073] The image processing tasks under the same task type have the same characteristics. In some embodiments, the computational loads of the image processing tasks under the same task type are similar or within a certain range. In some embodiments, the processing processes of the image processing tasks under the same task type are similar or identical.

[0074] In the embodiments of this specification, when configuring a preset ratio of traffic for different task types, that is, allocating a preset ratio of GPU computing power, it is necessary to first determine the preset ratio corresponding to each task type according to the image processing complexity of each task type, and different task types may have different requirements for computing resources. For example, some task types may require highly complex image rendering, so a larger proportion of GPU traffic can be allocated to such task types. While other task types may focus on fast batch processing of simple images, a smaller proportion of GPU traffic can be allocated to such task types. The above-mentioned method of configuring a preset ratio of GPU (graphics processing unit) traffic for each task type can enable the system to achieve a more refined and reasonable allocation of the preset ratio of traffic corresponding to each task type according to the different properties and different requirements of each task type. Ensure that all types of task types can obtain appropriate GPU support, avoid waste of resources, and ensure that all tasks can be completed within a reasonable time.

[0075] In addition, each task type is configured with a preset ratio of traffic, so that the preset ratio of GPU resources corresponding to each task type can be focused on processing image processing requests under the current task type, so as to improve computing efficiency and speed up processing. When the preset ratio of GPU resources is monopolized by a task type, no other task types will compete for the preset ratio of GPU resources, and there is no need for complex resource scheduling strategies to balance resource allocation among multiple tasks, which simplifies system management and optimization. Users can benefit from faster image generation speed and more stable system performance, thereby improving user satisfaction and overall system availability.

[0076] Secondly, when configuring a preset ratio of traffic for different task types, the total computing power (total traffic) of the GPU itself also needs to be considered. In the allocation process, it is not only necessary to ensure that the preset ratio of traffic allocated to each task type can meet the needs of each task type, but also to avoid waste of resources and maintain efficient and balanced GPU utilization. In the embodiments of this specification, by comprehensively evaluating the complexity of each task type and the computing power of the GPU, a reasonable and efficient resource allocation plan is formulated to maximize the use efficiency of the GPU and improve the performance and efficiency of the overall system.

[0077] In some embodiments, the sum of the preset ratios of the multiple task types is 1. In this case, the multiple task types share the GPU computing power of the system 130. In some embodiments, the sum of the preset ratios of the multiple task types is less than 1. In this case, the remaining proportion of the GPU computing power of the system 130 can be used as a backup computing power to cope with emergencies, such as compensation tasks or traffic spikes.

[0078] As mentioned above, in some embodiments, an image processing request includes: at least one image to be processed. At this time, the method of determining the task type corresponding to each image processing request may be: for an image processing request, the corresponding task type is determined according to the data of the object to be processed in at least one image to be processed contained in the image processing request, and the data of the object to be processed includes the type and / or relationship of the object to be processed.

[0079] In some embodiments, the manner in which the task type corresponding to each image processing request is determined is related to, for example, the current scene setting. For example, if the current scene setting is "Me and My Pet", it may correspond to an artificial intelligence image generation task type, and the objects to be processed in the image to be processed that requires an image processing request include: human objects and animal objects. When the objects to be processed in the image to be processed include only human objects, or only animal objects, or only landscape objects, it means that the current image to be processed does not conform to the current scene setting, then, for example, it can be determined that the task type corresponding to the image processing request is other task types, such as image synthesis task types, image analysis task types, and so on.

[0080] In some embodiments, for example, if the current scene is set to "family portrait", it may correspond to an image synthesis task type, which requires that the objects to be processed in the image to be processed include multiple objects with family relationships. For example, there are an adult man and a woman (couple), or men and women, old and young, or a man, a woman and at least one child (a family of three or more). If the objects to be processed in the image to be processed only include male character objects, or only include female character objects, or do not include character objects, it means that the current image to be processed does not meet the current scene setting, and for example, the artificial intelligence image generation task type can be entered.

[0081] As mentioned above, in some embodiments, an image processing request also includes: image processing demands (image processing scenarios); the method for determining the task types corresponding to each of the multiple image processing requests can be: for an image processing request, determine its corresponding task type based on the image processing scenario it contains.

[0082] Among them, the image processing scenarios include, for example: artificial intelligence image generation scenarios, image recognition scenarios, image analysis scenarios, image synthesis scenarios or image restoration scenarios, etc. The system 130 can determine the task type corresponding to each image processing request based on the correspondence between the image processing scenarios and the task types. It should be understood that the above embodiments are only exemplary descriptions, and the scene contents included in the specific image processing scenarios and the actual conditions of each scene can be flexibly adjusted according to user needs, and are not limited to the above embodiments.

[0083] S350: For a task type, the included image processing requests are processed within the corresponding traffic to generate images corresponding to the included image processing requests.

[0084] As mentioned above, different task types have exclusive use of their corresponding GPU computing power. Therefore, each task type can align the image processing requests contained in its corresponding traffic for processing. The image processing processes of different task types do not interfere with each other. The above-mentioned one task type can be any one of the multiple task types, or each of the multiple task types, or a specific task type among the multiple task types.

[0085] S370: Send the image to the corresponding client.

[0086] The corresponding client may be a client of an image processing request corresponding to the image. The user may view the generated image through the client. If the user is not satisfied with the generated image, for example, the user may resubmit the image processing request to request the image corresponding to the image processing request to be regenerated until the generated image meets the user's requirements.

[0087] In summary, in the image generation method P300 and system 130 provided in this specification, by configuring a preset ratio of traffic for each of the multiple task types, each task type is allowed to exclusively occupy the preset ratio of traffic. This allows the resources between the multiple task types to be independent of each other and not interfere with each other in image processing under multiple scenarios. This avoids resource occupation between multiple task types, thereby improving the efficiency of image processing.

[0088] For the convenience of description, we will describe the image processing process under one task type. Those skilled in the art should understand that the image processing processes under other task types are also the same or similar.

[0089] Figure 5 A schematic diagram of a process flow of image generation steps provided according to some embodiments of this specification is shown, such as Figure 5 As shown, step S350 includes S351-S353.

[0090] S351: Determine the processing capacity corresponding to the task type based on the traffic corresponding to the task type, where the processing capacity includes a target number of image processing requests to be processed in a unit time.

[0091] In some embodiments, in addition to the flow rate corresponding to the task type, the flow rate required to process each image processing request based on the task type is also required to comprehensively determine the processing capacity corresponding to the task type. This processing method ensures the rationality of resource allocation and avoids over-allocation or under-allocation of resources.

[0092] For example, the flow rate corresponding to the task type is A, the flow rate required for processing each image processing request of the task type is B, and the maximum processing capacity corresponding to the current task type is C. The maximum processing capacity C can be determined by rounding down the result of A / B. That is, the current task type can process a maximum of C image processing requests per unit time. In order to ensure the normal processing of image processing requests, the setting of the target quantity Q needs to be less than or equal to the value of the maximum processing capacity C. It cannot be greater than the maximum processing capacity C, otherwise it will cause problems that cannot be processed normally. The setting value of the specific target quantity can be flexibly adjusted according to user needs.

[0093] S353: Process the included image processing request based on the processing capability to generate an image.

[0094] In some embodiments, a task type may correspond to a task queue. The image processing requests included in a task type may be added to the task queue corresponding to the task type in chronological order. In the task queue, the image processing requests with earlier times are arranged before the image processing requests with later times.

[0095] In some embodiments, step S353 includes: for a unit time, processing the target number Q of image processing requests in front of the task queue to generate corresponding images. That is, for each task queue, the first-in-first-out principle is met, and the image processing request that enters the task queue first is processed first to ensure that each image processing request is processed in order.

[0096] In some embodiments, step S353 includes: for a unit time, a target number Q of image processing requests can be randomly obtained from the task queue for processing. The specific method of obtaining the target number Q of image processing requests can be flexibly adjusted according to the current scene setting, and is not limited to the above embodiment.

[0097] In some embodiments, a task type may include a first preset number of slice queues. Before generating an image, the image processing requests included in the task type need to be allocated to the first preset number of slice queues. The allocation method may be: uniform allocation. For example, the first preset number corresponding to the current task type is N, that is, the current task type includes N slice queues. If there are M unprocessed image processing requests under the current task type, the M unprocessed image processing requests can be evenly allocated to the N slice queues, and one slice queue can be allocated to M / N unprocessed image processing requests. For example, when M is 500 and N is 100, each slice queue will be allocated to 5 unprocessed image processing requests. When M is 500 and N is 10, each slice queue will be allocated to 50 unprocessed image processing requests. Alternatively, the allocation method for multiple unprocessed image processing requests can also be random allocation: multiple unprocessed image processing requests are randomly allocated to N slice queues. Such an allocation method can prevent a queue from being overloaded when the processing capabilities of the queues are similar. Alternatively, the allocation method for multiple unprocessed image processing requests can also be polling allocation. That is, multiple unprocessed image processing requests can be allocated to each slice queue in a cycle according to the order of each slice queue in the N slice queues. For example: the first unprocessed image processing request is allocated to the first slice queue, and the second unprocessed image processing request is allocated to the second slice queue. And so on, until all slice queues are allocated an unprocessed image processing request, and then start from the beginning. It should be understood that the above embodiment is only an exemplary description, and how to allocate multiple unprocessed image processing requests to each task queue can be flexibly adjusted according to user needs, and is not limited to the above embodiment.

[0098] The image processing requests contained in a slice queue are arranged in time order, and the image processing requests in the previous time are arranged before the image processing requests in the later time. At this time, step S353 includes: for a unit time: selecting the second preset number of image processing requests arranged in front of the slice queue from each slice queue as the image processing requests to be processed; based on the preset probability corresponding to the task type, extracting the target number of image processing requests from the image processing requests to be processed in the first preset number of slice queues for processing to generate the corresponding image.

[0099] Among them, the embodiment of this specification introduces a probability controller (preset probability P) to control the number of image processing requests extracted under different task types. The probability controller can effectively control and allocate the number of image processing requests extracted from the image processing requests to be processed to ensure stable operation of the system, avoid overload, and maximize resource utilization.

[0100] For a first preset number N of slice queues under a task type, for example, a second preset number T of image processing requests in the first preset number of slice queues can be obtained in a unit time. For a task type, a total of N*T image processing requests can be obtained in a unit time. Then, the flow of the above task type is controlled by the preset probability P corresponding to the above task type. That is, only N*T*P image processing requests are executed in a unit time.

[0101] Among them, the preset probability corresponding to each task type may be the same or different. The preset probability corresponding to each task type is related to the first preset number N and / or the second preset number T corresponding to each task type. For example, for the first task type, its first preset number N and the second preset number T are both set to be larger, then the preset probability P1 corresponding to the first task type can be set to be smaller. For example, for the second task type, its first preset number N and / or the second preset number T are both set to be smaller, then the preset probability P2 corresponding to the second task type can be set to be larger. It is only necessary to ensure that the number of image processing requests processed per unit time N*T*P% is less than or equal to the maximum processing capacity C or the target number Q corresponding to the task type, so as to avoid the problem that the number of image processing requests processed per unit time is greater than the number C or the target number Q corresponding to the maximum processing capacity, resulting in execution failure.

[0102] In the case where one of the above-mentioned task types includes a first preset number N of slice queues, the method for extracting the target number of image processing requests can be: based on a preset probability P, randomly extracting a target number (N*T*P%) of image processing requests from the image processing requests to be processed (the number of image processing requests to be processed is N*T) for processing to generate a corresponding image.

[0103] The above-mentioned method of setting up slice queues can distribute unprocessed image processing requests to multiple slice queues. When performing image processing, each slice queue performs image processing with the same probability, so that the probability of image processing requests in each slice queue being processed is the same, so that image processing requests can be processed evenly, preventing some image processing requests from waiting for too long, resulting in poor user experience.

[0104] In the method of randomly extracting a target number of image processing requests from the pending image processing requests for processing, there may be a situation where, for the first image processing request in a task type, the first image processing request is already in the pending image processing requests corresponding to the above task type, but the above first image processing request has not been extracted after multiple random extractions. The above situation will cause the waiting time of the first image processing request to be too long, affecting the user experience. In order to solve the above problem, in an embodiment of the present specification, for a task type, step S350 may also include directly processing the first image processing request to generate a corresponding image when the first image processing request appears in the pending image processing requests within a preset number of unit times and is not processed. That is, the first image processing request can skip the screening of the probability controller and be directly processed to generate an image corresponding to the first image processing request. For the convenience of description, we define the above preset number as the maximum number of retries.

[0105] In some embodiments, the preset number corresponding to the task type is related to the preset probability corresponding to each task type. When the preset probability of a task type is P, the preset number corresponding to the task type can be the inverse of the preset probability, that is, the preset number can be 1 / P. Of course, the preset number can also be a preset fixed integer, such as 5, or 10 or other arbitrary integers. A matching preset number can be set for each task type according to the actual situation of each task type. The setting of the preset number corresponding to each specific task type can be flexibly adjusted according to user needs, and is not limited to the above embodiments.

[0106] Figure 6 A schematic diagram of a flow control principle according to an embodiment of this specification is shown. For ease of understanding, the following combined Figure 6 The principle of flow control in each task type in this manual is explained in detail: Figure 6 As shown, the current task type includes N slices, namely slice 1, slice 2, ..., slice N. Among them, the number of pending image processing requests extracted by each slice in unit time is T, and the preset probability is P. For a task type, the complete flow control process is as follows:

[0107] After determining the task types corresponding to the multiple image processing requests, the image processing requests contained in one task type are sent to the slice queues corresponding to the N slices according to the preset distribution rules. The image processing requests in each slice queue are arranged in the corresponding slice queue in chronological order. Each slice queue obtains T image processing requests as the image processing requests to be processed in a unit time (when the number of image processing requests contained in the slice queue is less than T, all image processing requests in the slice queue are obtained). The acquisition method is, for example, to obtain the image processing requests ranked before T in the current slice queue as the image processing requests to be processed according to the ranking of each image processing request in the corresponding slice queue. For one task type, a total of N*T image processing requests to be processed can be obtained in a unit time at most. When it is determined that each of the image processing requests to be processed has not reached the maximum number of retries, the N*T image processing requests to be processed are screened by a preset probability to obtain N*T*P target number of image processing requests for image processing, so as to generate the images corresponding to the above-mentioned image processing requests for image processing.

[0108] When there is a first image processing request in the pending image processing requests, it is determined that the first image processing request has reached the maximum number of retries. The first image processing request is an image processing request that appears in the pending image processing requests within a preset number of unit times and has not been processed. At this time, for the above-mentioned first image processing request, it is no longer necessary to screen through a preset probability, but the first image processing request can be directly image processed to generate an image corresponding to the above-mentioned first image processing request.

[0109] The above setting of the maximum number of retries can prevent the problem of a long waiting time caused by an image processing request not being processed multiple times, further improve the efficiency of image processing, and enhance the user experience.

[0110] The image generation method P300 provided in this specification configures the flow for each task type according to the total flow of the image generation system and the preset ratio corresponding to each task type, thereby realizing the exclusive use of the preset ratio of flow by each task type. Each task type does not interfere with each other when executing multiple image processing requests contained in each task type. After receiving multiple image processing requests sent by the client and determining the task type corresponding to each image processing request. The image processing requests contained in the preset ratio of flow exclusively occupied by each task type can be processed to generate the corresponding image and send it to the client. This setting method makes the resources between multiple task types independent of each other in image processing under multiple scenarios, avoids the situation of resource occupation between multiple task types, and thus improves the efficiency of image processing.

[0111] In some embodiments, in order to make the user's waiting time more intuitive, step S350 may also include: determining the estimated waiting time corresponding to each of the included image processing requests. At this time, the method P300 may also include: sending the estimated waiting time corresponding to each of the multiple image processing requests to the corresponding client. Such a setting method allows the user to know the estimated waiting time and understand the system working status. Avoid unnecessary system load caused by users repeatedly checking progress or retrying task submission due to not understanding the estimated waiting time.

[0112] After the system receives the image processing request sent by the user, the system 130 can assign corresponding sorting numbers to the included image processing requests. The way of assigning the sorting number plates is, for example, to sequentially generate the sorting numbers corresponding to each image processing request according to the timestamp corresponding to the initiation of each image processing request. At a moment, each image processing request has its own unique sorting number, and the sorting numbers corresponding to each image processing request are different. The sorting number of the image processing request with an earlier time is smaller than the sorting number of the image processing request with a later time.

[0113] In the embodiment of the present specification, for example, if the sorting number of the current image processing request is seq, the sorting number of the next image processing request of the current image processing request is seq + 1. The sorting number is used to indicate the position of each image processing request in the queue of the corresponding task type, which is used for the subsequent real-time calculation of the estimated waiting time.

[0114] It should be noted that when image processing requests under a task type are arranged in a task queue, one task queue corresponds to a group of sorting numbers; when image processing requests under a task type are arranged in N slice queues, one slice queue corresponds to a group of sorting numbers, and N slice queues correspond to N groups of sorting numbers. For the convenience of description, the subsequent sorting numbers refer to the sorting numbers corresponding to a task or the sorting numbers of a slice queue.

[0115] The method for determining the estimated waiting time corresponding to each image processing request may be: determining the estimated waiting time corresponding to each of the included image processing requests according to the distance between the current sorting number of the task type and the sorting number corresponding to each of the included image processing requests, and the processing capacity of the task type. The current sorting number is the number plate of the image processing request that is sorted first in the current slice queue or task queue, that is, at the head of the queue.

[0116] Taking the queue as a task queue as an example, when determining the estimated waiting time corresponding to each image processing request, first determine the number plate LastConsumeSeq of the image processing request currently at the head of the task queue in the task queue where the current image processing request is located; then obtain the number plate seq corresponding to the current image processing request; then determine the number of tasks (the number of image processing requests to be processed) that the current image processing request needs to wait for (Seq-LastConsumeSeq) based on seq and LastConsumeSeq. Divide the number of tasks that the current image processing request needs to wait for by the task execution speed Q of the task queue to obtain the estimated waiting time corresponding to the current image processing request: (Seq-LastConsumeSeq) / Q.

[0117] Taking the queue as a shard queue as an example, when determining the estimated waiting time corresponding to each image processing request, first determine the target shard queue where the current image processing request is located, and then obtain the number plate seq corresponding to the current image processing request, and the number plate LastConsumeSeq of the image processing request currently at the head of the target queue in the target shard queue. According to seq and LastConsumeSeq, the number of tasks that the current image processing request needs to wait for (the number of image processing requests to be processed) is determined as (Seq-LastConsumeSeq). Divide the number of tasks that the current image processing request needs to wait for by the task execution speed (P*T) of the target queue to obtain the estimated waiting time corresponding to the current image processing request: (Seq-LastConsumeSeq) / (P*T).

[0118] In some embodiments, in order to ensure the accuracy of the estimated waiting time, in the embodiments of the present specification, when determining the estimated waiting time corresponding to the current image processing request, for example, the image generation parameters and the risk control parameters may also be considered. Among them, the image generation parameters and the risk control parameters are, for example, two preset constant values, which are pre-configured according to each task type, and the image generation parameters and the risk control parameters corresponding to different task types may be different. That is, the method for determining the estimated waiting time in the present specification may be: Aug (image generation) + Aug (risk control) + (Seq-LastConsumeSeq) / (P*T). Among them, the image generation parameters generally refer to some characteristics of the image, including but not limited to the size (width and height) of the image, resolution, color depth, image format (such as JPEG, PNG, TIFF, etc.), the complexity of the image content, etc. The risk control parameters are based on the perspective of risk control, and the factors considered may include but are not limited to security audits, copyright checks, content filtering, etc. The image generation parameters and the risk control parameters can directly affect the complexity, resource requirements and potential risks of processing image processing requests, thereby affecting the accurate estimation of the estimated waiting time. When determining the estimated waiting time, adding two constant parameters, image generation parameters and risk control parameters, can greatly improve the accuracy of the estimated waiting time, thereby improving the user experience.

[0119] In summary, in the image generation method P300 and system 130 provided in this specification, by configuring a preset ratio of traffic for each task type in multiple task types, each task type is exclusive of the preset ratio of traffic. In distributed image processing under multiple scenarios, the resources between multiple task types are independent of each other and do not interfere with each other. The resource occupation between multiple task types is avoided, thereby improving the efficiency of image processing. In addition, this specification also configures a preset probability for each task type to effectively control the traffic of each task type according to the preset probability, and flexibly allocates the number of image processing requests extracted from the image processing requests to be processed to ensure stable operation of the system, avoid overload and maximize resource utilization. In addition, this specification can also return the corresponding estimated waiting time to each user who initiates an image processing request, so that the user can know the estimated waiting time and understand the working status of the system.

[0120] On the other hand, the present specification provides a computer-readable non-transitory storage medium, storing at least one instruction set, which is used to perform executable instructions for the image generation method. When the at least one instruction set is executed by the processor, the at least one instruction set instructs the processor to implement the steps of the image generation method P300 of the present specification. In some possible embodiments, various aspects of the present specification can also be implemented in the form of a program product, which includes a program code. When the program product is run on the system 130, the program code is used to make the system 130 perform the steps of the method P300 described in the present specification. The program product for implementing the above method can use a portable compact disk read-only memory (CD-ROM) to include the program code and can be run on the system 130. However, the program product of the present specification is not limited to this. In the present specification, the readable storage medium can be any tangible medium containing or storing a program, which can be used by the instruction execution system or used in combination with it. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media include: an electrical connection with one or more conductors, a portable disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. A computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above. The program code for performing the operations of this specification can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages.

[0121] In summary, the image generation method P300 and system 130 provided in this specification can realize distributed image processing in multiple scenarios, and the resources between multiple task types are independent of each other and do not interfere with each other. It avoids the resource occupation between multiple task types and improves the efficiency of image processing. In addition, this specification also configures a preset probability for each task type to effectively control the traffic of each task type according to the preset probability, and flexibly allocates the number of image processing requests extracted from the image processing requests to be processed to ensure the stable operation of the system, avoid overload and maximize resource utilization. In addition, this specification can also return the corresponding estimated waiting time to each user who initiates an image processing request, so that the user can know the estimated waiting time and understand the working status of the system. .

[0122] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require a specific order or a continuous order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0123] In summary, after reading this detailed disclosure, those skilled in the art will appreciate that the foregoing detailed disclosure may be presented only by way of example and may not be limiting. Although not explicitly stated herein, those skilled in the art will appreciate that this specification requires various reasonable changes, improvements, and modifications to the embodiments. These changes, improvements, and modifications are intended to be proposed by this specification and are within the spirit and scope of the exemplary embodiments of this specification.

[0124] In addition, certain terms in this specification have been used to describe embodiments of this specification. For example, "one embodiment", "an embodiment" and / or "some embodiments" mean that a particular feature, structure or characteristic described in conjunction with the embodiment may be included in at least one embodiment of this specification. Therefore, it can be emphasized and should be understood that two or more references to "an embodiment" or "one embodiment" or "an alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics may be appropriately combined in one or more embodiments of this specification.

[0125] It should be understood that in the foregoing description of the embodiments of this specification, in order to help understand a feature and for the purpose of simplifying this specification, this specification combines various features in a single embodiment, figure or its description. However, this does not mean that the combination of these features is necessary. When reading this specification, it is entirely possible for a person skilled in the art to mark out some of the devices as separate embodiments. In other words, the embodiments in this specification can also be understood as the integration of multiple secondary embodiments. And the content of each secondary embodiment is also valid when it is less than all the features of a single aforementioned disclosed embodiment.

[0126] Each patent, patent application, publication of patent applications, and other materials, such as articles, books, specifications, publications, documents, articles, etc., cited herein, except to the extent that it is inconsistent or conflicting with this document or that has a limiting effect on the broadest scope of the claims, may be incorporated herein by reference and used for all purposes now or hereafter associated with this document. In addition, in the event of any inconsistency or conflict between the description, definition, and / or use of a term in any material and the description, definition, and / or use of a term in this document, the term in this document shall prevail.

[0127] Finally, it should be understood that the embodiments of the application disclosed herein are explanations of the principles of the embodiments of this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are only used as examples and not as limitations. Those skilled in the art can adopt alternative configurations according to the embodiments in this specification to implement the applications in this specification. Therefore, the embodiments of this specification are not limited to the embodiments accurately described in the application.

Claims

1. An image generation method, applied to an image generation system, the method comprising: Receive multiple image processing requests sent by the client; Determining the task types corresponding to the multiple image processing requests, wherein the image generation system is pre-set with multiple task types, and a preset ratio of traffic is configured for each task type; For a task type, processing the included image processing requests within the corresponding flow to generate images corresponding to the included image processing requests; and The image is sent to the corresponding client.

2. The method of claim 1, wherein: An image processing request includes: at least one image to be processed; The determining the task type corresponding to each of the plurality of image processing requests comprises: For the image processing request, the corresponding task type is determined according to the data of the object to be processed in the at least one image to be processed contained therein, wherein the data of the object to be processed includes the type and / or relationship of the object to be processed.

3. The method of claim 1, wherein: An image processing request includes: image processing scenario; The determining the task type corresponding to each of the plurality of image processing requests comprises: For the image processing request, the corresponding task type is determined according to the image processing scenario contained therein.

4. The method of claim 1, wherein: The configuration of a preset ratio of traffic for each task type includes: The flow rate is configured for each task type according to the total flow rate of the image generation system and the preset ratio corresponding to each task type, wherein the sum of the preset ratios corresponding to the multiple task types is less than or equal to 1.

5. The method of claim 1, wherein: The processing of the included image processing requests within the corresponding traffic to generate images corresponding to the included image processing requests includes: Determining a processing capacity corresponding to the task type based on the flow corresponding to the task type, the processing capacity including a target number of image processing requests to be processed per unit time; and The included image processing request is processed based on the processing capability to generate the image.

6. The method of claim 5, wherein: The step of processing the included image processing requests within the corresponding traffic to generate images corresponding to the included image processing requests also includes: The image processing requests included in the task type are added to the task queue corresponding to the task type in chronological order, wherein the image processing request with an earlier time is arranged before the image processing request with a later time in the task queue.

7. The method of claim 6, wherein: The processing of the included image processing request based on the processing capability to generate the image includes: For one unit time, the target number of image processing requests queued in front of the task queue are processed to generate corresponding images.

8. The method of claim 5, wherein: Before processing the included image processing requests within the corresponding traffic to generate images corresponding to the included image processing requests, the method further includes: The image processing requests included in the task type are allocated to a first preset number of slice queues, wherein the image processing requests included in a slice queue are arranged in chronological order, and the image processing requests in the earlier time are arranged before the image processing requests in the later time.

9. The method of claim 8, wherein: The processing of the included image processing request based on the processing capability to generate the image includes: For one unit of time: Selecting, from each slice queue, a second preset number of image processing requests that are arranged before the slice queue as image processing requests to be processed; and Based on a preset probability corresponding to the task type, the target number of image processing requests are extracted from the image processing requests to be processed for processing to generate corresponding images.

10. The method of claim 9, wherein: The preset probability is related to the first preset number and the second preset number.

11. The method of claim 9, wherein: The step of extracting the target number of image processing requests from the image processing requests to be processed based on the preset probability corresponding to the task type to generate corresponding images includes: Based on the preset probability, the target number of image processing requests are randomly extracted from the image processing requests to be processed for processing to generate corresponding images.

12. The method of claim 9, wherein: The step of processing the included image processing requests within the corresponding traffic to generate images corresponding to the included image processing requests also includes: A first image processing request is processed to generate a corresponding image, wherein the first image processing request appears in the pending image processing requests within a preset number of unit times and has not been processed.

13. The method of claim 12, wherein: The preset number corresponding to the task type is related to the preset probability.

14. The method of claim 5, wherein: The step of processing the included image processing requests within the corresponding traffic to generate images corresponding to the included image processing requests also includes: Determine an estimated waiting time corresponding to each of the included image processing requests; The method further comprises: The estimated waiting time corresponding to each of the plurality of image processing requests is sent to the corresponding client.

15. The method of claim 14, wherein: The determining of the estimated waiting time corresponding to each of the included image processing requests includes: Assigning respective corresponding sort numbers to the included image processing requests; and The estimated waiting time corresponding to each of the included image processing requests is determined according to the distance between the current sorting number of the task type and the sorting numbers corresponding to each of the included image processing requests and the processing capability of the task type.

16. The method of claim 1, wherein: After receiving the multiple image processing requests sent by the client, the method further includes: The plurality of image processing requests are saved in a non-transitory memory.

17. An image generation system, comprising: at least one storage medium storing at least one instruction set for performing the image generation method; as well as At least one processor is communicatively connected to the at least one storage medium, wherein the at least one processor reads the at least one instruction set when running, and executes the image generation method described in any one of claims 1-16 according to the instructions of the at least one instruction set.

18. A computer-readable non-volatile storage medium, wherein: The computer-readable non-volatile storage medium stores at least one instruction set, and when the at least one instruction set is executed by at least one processor, the image generation method according to any one of claims 1 to 16 is implemented.