A task processing method and device
By dynamically adjusting the number of processing modules and constructing basic processing units, the problem of unreasonable configuration of processing modules was solved, which improved task processing efficiency and saved resources.
Patent Information
- Application Number
- CN202011165881.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-27
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2040-10-27
AI Technical Summary
In the prior art, unreasonable configuration of processing modules leads to low task processing efficiency or waste of resources, especially when the number of objects to be processed is large or small. Improper module allocation causes inefficiency or waste of resources.
By dynamically adjusting the number of processing modules based on the number of objects in the task, basic processing units are constructed to ensure that the product of the number of modules and the capacity in each unit is greater than or equal to the upper limit of the number of objects to be processed. Parallel processing is adopted to improve task processing efficiency and save resources.
It enables dynamic and reasonable configuration of processing modules, improves task processing efficiency, avoids resource waste, and adapts to different numbers of task objects.
Smart Images

Figure CN112199625B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer application technology, and more particularly to a task processing method and device. Background Art
[0002] When a website publishes a new article, it usually needs to review whether the new article contains any illegal content before and after publication, for example, whether the pictures in the new article involve violence, whether the text in the new article involves gambling, etc., to ensure that the website content is positive. This process can be considered as the website's task of handling content review, and during the process, new articles are reviewed according to the need to review illegal content.
[0003] In other scenarios, different tasks also need to perform the above task processing process when being processed, and are not limited to the content review scenario.
[0004] Among them, the objects processed by the task are of different types, such as images, voices, and texts. In order to cope with different processing requirements and different types of processing objects, one or more processing modules with different functions are needed for processing. For example, when processing content review tasks, in order to cope with the processing requirements of reviewing illegal content, image-type processing objects, and text-type processing objects, the illegal image recognition module can be used to process the image-type processing objects, and the text information extraction module and the illegal information recognition module can be used to process the text-type processing objects.
[0005] However, there is an upper limit on the number of objects that can be processed by the processing module at the same time. For example, the illegal image recognition module can only recognize up to 3 images at the same time. However, in actual processing tasks, the existing methods do not take into account the number of objects to be processed and the processing capacity of the processing modules. A fixed number of processing modules are often used to process tasks, resulting in unreasonable configuration of the processing modules.
[0006] When the number of processing objects is large, the number of processing objects assigned to each processing module is greater than the upper limit of the number of processing objects that the processing module can process simultaneously, and the task processing efficiency is low. When the number of processing objects is small, some processing modules do not need to process processing objects and are idle, resulting in a waste of resources. Summary of the invention
[0007] In order to solve the above problems, this specification provides a task processing method and device, which dynamically adjusts the number of processing modules according to the number of objects in the task, reasonably configures the processing modules for the task, improves the processing efficiency of the task, and avoids resource waste. The technical solution is as follows.
[0008] A task processing method, comprising:
[0009] According to the type of processing object and processing requirements in the task to be processed, determine several types of processing modules for processing the task;
[0010] According to the processing capacity of each type of processing module, the maximum processing capacity of a single type of module among the several types of processing modules is determined as N; wherein the processing capacity of any type of processing module is used to represent the upper limit of the number of objects that a single processing module of this type can process simultaneously;
[0011] When the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N;
[0012] Constructing basic processing units; wherein each basic processing unit includes the aforementioned several types of processing modules, and the product of the number of each type of processing modules and the processing capacity of the processing modules of this type is greater than or equal to N;
[0013] X basic processing units are called to perform parallel processing on the X processing object sets.
[0014] A task processing method, comprising:
[0015] According to the type of processing object and processing requirements in the task to be processed, determine several types of processing modules for processing the task;
[0016] According to the processing capacity of each type of processing module, the minimum processing capacity of a single type of module among the several types of processing modules is determined as N; wherein the processing capacity of any type of processing module is used to represent the upper limit of the number of objects that a single processing module of this type can process simultaneously;
[0017] When the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N;
[0018] Constructing basic processing units; wherein each basic processing unit includes the aforementioned several types of processing modules, and the number of each type of processing module is 1;
[0019] X basic processing units are called to perform parallel processing on the X processing object sets.
[0020] A task processing device, comprising:
[0021] A first determining unit: used to determine several types of processing modules for processing the task according to the type of processing object and processing requirements in the task to be processed;
[0022] A first division unit is used to determine, according to the processing capacity of each type of processing module, that the maximum processing capacity of a single type of module among the several types of processing modules is N; wherein the processing capacity of any type of processing module is used to characterize the upper limit of the number of objects that can be processed simultaneously by a single processing module of this type; when the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N;
[0023] A first construction unit: used to construct a basic processing unit; wherein each basic processing unit includes the aforementioned several types of processing modules, and the product of the number of each type of processing modules and the processing capacity of the processing modules of this type is greater than or equal to N;
[0024] The first parallel processing unit is used to call X basic processing units to perform parallel processing on the X processing object sets.
[0025] A task processing device, comprising:
[0026] A second determining unit: used to determine several types of processing modules for processing the task according to the type of processing object and processing requirements in the task to be processed;
[0027] A second division unit is used to determine, according to the processing capacity of each type of processing module, that the minimum processing capacity of a single type of module among the several types of processing modules is N; wherein the processing capacity of any type of processing module is used to characterize the upper limit of the number of objects that can be processed simultaneously by a single processing module of this type; when the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N;
[0028] The second construction unit is used to construct a basic processing unit; wherein each basic processing unit includes the aforementioned several types of processing modules, and the number of each type of processing module is 1;
[0029] The second parallel processing unit calls X basic processing units to perform parallel processing on the X processing object sets.
[0030] The above technical solution dynamically adjusts the number of each type of processing modules by considering the processing capabilities of each type of processing modules, so that multiple basic processing units can be called for different numbers of task processing objects, and all task processing objects can be processed simultaneously in one processing, thereby realizing dynamic and reasonable configuration of processing modules, which can not only improve task processing efficiency but also save resources of processing modules. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0032] Figure 1 It is a principle schematic diagram of a task processing process provided by an embodiment of this specification;
[0033] Figure 2 It is a schematic diagram of another principle of a task processing process provided by an embodiment of this specification;
[0034] Figure 3 It is a schematic diagram of another principle of a task processing process provided by an embodiment of this specification;
[0035] Figure 4 It is a flowchart of a task processing method provided in an embodiment of this specification;
[0036] Figure 5 is a structural diagram of a basic processing unit provided in an embodiment of this specification;
[0037] Figure 6 It is a principle schematic diagram of a task processing method provided in an embodiment of this specification;
[0038] Figure 7 is a flowchart of another task processing method provided by an embodiment of this specification;
[0039] Figure 8 is a structural diagram of a task processing device provided in an embodiment of this specification;
[0040] Fig. 9 is a structural diagram of another task processing device provided in an embodiment of this specification;
[0041] Fig.10 It is a structural diagram of a device used to configure the method of the embodiment of this specification. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the technical solutions in the embodiments of this specification will be described in detail below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field should fall within the scope of protection.
[0043] In order to introduce the scenario of this specification, a specific scenario is given below as an exemplary description.
[0044] When a website publishes a new article, it usually needs to review whether the new article involves any illegal content before and after publication, for example, whether the pictures in the new article involve violence, whether the text in the new article involves gambling, etc., to ensure that the website content is positive.
[0045] The above scenario can be seen as reviewing and processing the object to be processed according to the need to review illegal content when handling content review tasks.
[0046] Therefore, in the scenario of this specification, when processing any task, the processing object can be processed according to the specific requirements of the task, which is not limited to the scenario of the above-mentioned content review.
[0047] In order to further explain the scenario of this specification, the processing requirements in the task can specifically be business requirements, for example, detecting whether the processing object complies with the specification, checking whether the processing object contains illegal information, etc. Of course, a task can include one or more processing requirements, and this specification does not limit this.
[0048] The processing object may be an object of different types, such as an image, text, voice, etc. This specification does not limit the number and type of processing objects in a task.
[0049] Several scenario examples are provided below for illustrative purposes.
[0050] Based on the requirement of whether the detection object contains violent information, the image type objects are detected and processed; based on the requirement of whether the detection object contains fraudulent information, the voice type and text type objects are detected and processed; based on the requirement of whether the detection object meets the specifications, the image type objects are detected and processed.
[0051] It should be noted that, in this specification, a task may include one or more requirements, and may also be processed for one or more types of objects.
[0052] When processing is performed according to any requirement and for any type of object, one or more processing modules with different functions may be used for processing.
[0053] For example, the illegal image recognition module can be used to recognize illegal images. When processing an image-type processing object according to the processing requirements of reviewing illegal content, the illegal image recognition module can be used to process the image-type processing object.
[0054] For example, the text information extraction module can be used to extract information keywords contained in the text, and the illegal information identification module can be used to identify whether the information keywords belong to the keywords corresponding to the illegal information. When processing the text type processing object according to the processing requirements of the review of illegal content, the text information extraction module can be used first, and then the illegal information identification module can be used to process the text type processing object.
[0055] For further understanding, Figure 1 As shown, it is a schematic diagram of the principle of a task processing process provided in this specification. Among them, the processing requirement of the task is violation detection, and the objects to be processed include 3 images and 4 texts. Therefore, a single violation image recognition module, a single text information extraction module and a single violation information recognition module can be fixedly used for processing. The specific process can be to input the 3 images into a violation image recognition module for processing, and input the 4 texts into a text information extraction module for processing, and after obtaining 4 text information keywords, the 4 text information keywords are input into a violation information recognition module for processing.
[0056] It should be noted that Figure 1 The task processing process shown is only an example and does not limit the scope of this specification. Specifically, different processing modules may be used for processing according to multiple processing requirements in the task, or different processing modules may be used for processing according to the type of processing object in the task.
[0057] For ease of understanding, Figure 2 As shown, it is a schematic diagram of another task processing process provided in this specification. The task includes 3 processing requirements, 10 images and 4 texts. The processing requirements are violation detection, violent content detection for images, and fraudulent content detection for texts.
[0058] Therefore, according to the processing requirements and the type of processing object, the task can be split and processed according to the single processing requirements and the single type of processing object. Figure 2 It is only used for illustrative purposes and is not intended to limit the scope of the disclosure of this specification.
[0059] In addition, when using multiple processing modules to process a single processing requirement and a single type of processing object, different types of processing modules can process the processing object in a preset order, and there can be a certain processing order. For example, the above-mentioned text information extraction module and violation information identification module can be in a series relationship and process text-type objects.
[0060] During actual processing, due to the limitation of the processing capacity of the processing module itself, there is an upper limit on the number of objects that can be processed simultaneously by a single processing module.
[0061] The upper limits of different types of processing modules may be different or the same, and this specification does not limit this.
[0062] For example, a single violation image recognition module can process up to 3 image type objects at the same time, a single text information extraction module can process up to 5 text type objects at the same time, and a single violation information recognition module can process up to 9 objects at the same time.
[0063] For ease of expression, the upper limit of the number of objects that can be processed simultaneously by a single processing module of each type of processing module may be referred to as the processing capacity of the processing module of that type.
[0064] However, the existing method does not take into account the processing capacity of the processing module itself, and always uses a fixed number of processing modules to process different tasks, resulting in unreasonable allocation of processing modules.
[0065] Since the number of processing objects in different tasks is different, while the number and processing capacity of processing modules remain unchanged, when the number of processing objects in a task is large, the maximum number of objects that can be processed simultaneously by all processing modules is greater than the fixed number, and the processing modules cannot process all objects in one processing, resulting in low task processing efficiency; when the number of processing objects in a task is small, all fixed number of processing modules are not required to process them simultaneously, and some processing modules do not need to process processing objects and are in an idle state, resulting in a waste of processing module resources.
[0066] For further understanding, Figure 3 The figure is a schematic diagram of another principle of task processing process provided in this specification.
[0067] There are two tasks to be processed. Task 1 requires violation detection, and the processing objects include 10 images. Task 2 requires violation detection, and the processing objects include 100 images. For the task of performing violation detection on images, the existing method uses two violation image recognition modules with a processing capacity of 30 for processing.
[0068] When processing Task 1, since a single illegal image recognition module can process all 10 images at the same time, only the 10 images in Task 1 are input to the single illegal image recognition module, and the other illegal image recognition module is idle, resulting in a waste of processing module resources.
[0069] When processing Task 2, since the two illegal image recognition modules can process up to 60 images at the same time, the 60 images in Task 2 can only be input into the two illegal image recognition modules first, and then the remaining 40 images can be input into the two illegal image recognition modules. It takes two processes to complete the processing of 100 images, resulting in low task processing efficiency.
[0070] Combining the above two practical situations, it is obvious that using a fixed number of processing modules in the existing method will cause unreasonable allocation of processing modules, resulting in low task processing efficiency or waste of resources.
[0071] In order to solve the above problems, this specification provides a task processing method.
[0072] By considering the processing capacity of the processing modules, the number of processing modules can be dynamically adjusted according to the number of processing objects in the task, thereby avoiding unreasonable allocation of processing modules. When the number of processing objects is large, more processing modules can be determined for processing, among which different processing modules of the same type can be processed in parallel, thereby increasing the maximum number of objects that can be processed simultaneously by all processing modules; when the number of processing objects is small, fewer processing modules can be determined for processing, thereby avoiding waste of processing module resources.
[0073] The following is a method embodiment of a task processing method disclosed in this specification. The specific method flow can be as follows: Figure 4 The figure is a flowchart of a task processing method provided in this specification.
[0074] It should be noted that this embodiment describes a method for processing a single type of processing object based on a single processing requirement. It is understandable that this embodiment can also be used to process different processing requirements or different types of processing objects.
[0075] The method may include the following steps.
[0076] S101: Determine several types of processing modules for processing the task according to the type of processing object and processing requirements in the task to be processed.
[0077] S101 may specifically determine several types of processing modules for processing the type of object according to the processing requirement. This embodiment does not limit the specific types of processing modules, as long as they can process the type of object according to the processing requirement.
[0078] The examples listed below are for illustrative purposes only.
[0079] According to the content review requirements and the image type object, an image content review module can be determined for processing, or an image information extraction module and an information review module can be determined for processing.
[0080] According to the violent information detection requirements and the text type of the object, a text violent information detection module may be determined for processing, or a text information extraction module and a violent information detection module may be determined for processing.
[0081] Among them, the processing modules of several types determined according to the same processing requirements and the same object type may have a processing order of objects. For example, for a text type object, the text information extraction module may be used for processing first, and then the violent information detection module may be used for processing based on the processing result. The text information extraction module and the violent information detection module may be in a series relationship, and process the processing object.
[0082] In addition, the several types of processing modules in S101 may be one type or multiple types, which is not limited in this embodiment.
[0083] It should be noted that S101 only determines the type of processing modules used for processing, but does not determine the number of processing modules used for processing. The specific number can be determined in subsequent steps.
[0084] S102: Determine, according to the processing capacity of each type of processing module, that the maximum processing capacity of a single type of module among the multiple types of processing modules is N.
[0085] S102 may specifically be to determine, for the several types of processing modules determined in S101, a maximum value N among the processing capacities of a single type of processing modules of all the determined types of processing modules.
[0086] For example, among all five types of processing modules determined in S101 , the processing capabilities of each type of processing module are 3, 4, 5, 3, and 5 respectively. Then, the maximum value N is determined to be 5.
[0087] The purpose of determining N here is to determine the maximum number of objects that the basic processing unit can process at the same time. Specifically determining the maximum value as N is a specific method. Optionally, N can also be determined according to other requirements, which will be explained in detail below and will not be repeated here.
[0088] The processing capacity of a single type of processing module can be used to represent the upper limit of the number of objects that can be processed simultaneously by a single processing module of this type.
[0089] For example, some processing modules can process at most 1 image type object at the same time, and the processing capacity can be 1; some processing modules can process at most 5 text type objects at the same time, and the processing capacity can be 5. Of course, this embodiment does not limit the specific calculation method of the processing capacity.
[0090] S103: When the number M of processing objects in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, such that the number of processing objects contained in each set is less than or equal to N.
[0091] When the number of processing objects in the task is large, that is, M is greater than N, if the M processing objects are divided, since the number of objects contained in each set obtained by the division is less than or equal to the maximum processing capacity N, then for all the types of processing modules determined in S101, there is at least one type of processing module, and a single processing module of this type can simultaneously process all the processing objects in any set.
[0092] Of course, this embodiment does not limit the specific division method, as long as the number of processing objects contained in each set in the division result is less than or equal to N. The following specific examples are only used for illustrative purposes.
[0093] For example, the quotient of M and N is calculated. If there is a remainder, the result of adding one to the quotient can be determined as X, thereby dividing the M processing objects into X-1 sets containing N processing objects and 1 set containing the same number of processing objects as the remainder.
[0094] If there is no remainder, the quotient may be determined to be X, thereby dividing the M processing objects into X sets of N processing objects.
[0095] The case where M is less than or equal to N is described below and will not be elaborated here.
[0096] S104: construct a basic processing unit.
[0097] This embodiment does not limit the specific construction method, as long as the basic processing unit includes several types of processing modules determined in S101, and the product of the number of each type of processing modules in the several types of processing modules and the processing capacity of the processing module is greater than or equal to N.
[0098] This is to ensure that the maximum number of objects processed simultaneously by the basic processing unit is greater than or equal to the number of objects in any set obtained by division in S103, so that any basic processing unit can simultaneously process any set obtained by division in S103.
[0099] The specific method for determining the number of each type of processing modules is not limited in this embodiment, and the following examples are only used for illustrative purposes.
[0100] For example, for each type of processing module i among the types of processing modules determined in S101, the following operations are performed: the number W of processing modules of this type is determined. i , so that W i The product of the processing capacity of this type of processing module is greater than or equal to N; W i This type of processing module is added to the basic processing unit.
[0101] As a more specific example, for each type of processing module among several types of processing modules, the following operations can be performed: the processing capacity of the processing module of this type can be determined, and the quotient of N and the processing capacity of the processing module of this type can be calculated; if there is a remainder, the result of adding one to the quotient can be determined as the number of processing modules of this type in the basic processing unit; if there is no remainder, the quotient can be determined as the number of processing modules of this type in the basic processing unit.
[0102] If at least two types of processing modules are determined in S101, a processing sequence can be preset between different types of processing modules. When constructing a basic processing unit, different types of processing modules can be arranged and constructed according to the preset sequence.
[0103] For ease of understanding, Figure 5 The figure is a schematic diagram of the structure of a basic processing unit provided in this specification. The basic processing unit can be composed of three types of processing modules, namely, a text information extraction module, an information synthesis module, and a violation information identification module. These three types of processing modules can perform sequential processing on the processing object in the preset order of text information extraction module-information synthesis module-violation information identification module.
[0104] The basic processing unit can include 2 text information extraction modules, 3 information integration modules, and 1 illegal information identification module. The specific structure is as follows: Figure 5 As shown, the construction is performed according to the preset sequence.
[0105] It should be noted that Figure 5 The basic processing unit shown in the figure is only an example and does not limit the scope of the disclosure of this embodiment.
[0106] Since the product of the number of each type of processing modules and the processing capacity contained in the constructed basic processing unit is greater than or equal to N, each type of processing module can process at most N objects simultaneously, that is, the basic processing unit can at least process at most N objects simultaneously.
[0107] S105: Calling X basic processing units to perform parallel processing on X processing object sets.
[0108] After the basic processing unit is constructed in S104, since the objects to be processed by the task are divided into X sets in S103, the number of objects contained in each set is less than or equal to N, that is, the basic processing unit constructed in S104 can simultaneously process all objects in any set divided in S103.
[0109] Therefore, in order to improve the task processing efficiency and minimize the waste of processing module resources in S105, X basic processing units may be called to perform parallel processing on the X processing object sets divided in S103 respectively.
[0110] The X basic processing units may correspond one-to-one to the X processing object sets, and different basic processing units may process different processing object sets.
[0111] Obviously, X basic processing units can process X processing object sets at the same time, that is, all the M processing objects in the task. Calling X basic processing units can process all the objects in the task in one process.
[0112] To facilitate further understanding, an example of a basic processing unit performing processing on a processing object is given below. Of course, this example is only used for illustrative purposes and does not limit the scope of this embodiment.
[0113] Based on Figure 5 In the basic processing unit shown, the processing capacity of the text information extraction module can be specifically 3, the processing capacity of the information integration module can be specifically 2, and the processing capacity of the illegal information identification module can be specifically 6.
[0114] When the basic processing unit processes 6 processing objects at the same time, the 6 processing objects can be first divided into 2 sets, each set contains 3 processing objects, and the 2 sets are processed in parallel by 2 text information extraction modules respectively; the 6 processing results are then divided into 3 sets, each set contains 2 processing objects, and the 3 sets are processed in parallel by 3 information integration modules respectively; finally, the 6 processing results are all processed simultaneously by 1 violation information identification module.
[0115] After explaining S101 to S105, the following explains the case where M is less than or equal to N.
[0116] If M is less than or equal to N, one basic processing unit constructed in S104 can process M processing objects simultaneously. Therefore, when M is less than or equal to N, no division is required, and multiple basic processing units do not need to be called. One basic processing unit can be directly constructed through S104 to process M processing objects simultaneously.
[0117] The above-mentioned embodiment dynamically adjusts the number of each type of processing modules by considering the processing capability of each type of processing module, so that multiple basic processing units can be called for different numbers of task processing objects, and all task processing objects can be processed simultaneously in one processing, thereby realizing dynamic and reasonable configuration of processing modules, which can not only improve task processing efficiency but also save resources of processing modules.
[0118] In order to facilitate understanding of the effects of the above embodiments, Figure 6 The figure is a schematic diagram of the principle of a task processing method provided in this specification.
[0119] There are two tasks to be processed. Task 1 requires violation detection, and the processing objects include 10 images. Task 2 requires violation detection, and the processing objects include 100 images. For the task of violation detection for images, a violation image recognition module with a processing capacity of 30 is required for processing.
[0120] When processing Task 1, based on the above embodiment, since the processing capacity 30 of the illegal image recognition module is greater than the number of objects 10 in Task 1, one illegal image recognition module can be called to simultaneously process 10 images in Task 1. The resources of the processing module are not wasted.
[0121] When processing Task 2, based on the above embodiment, since the processing capacity of the illegal image recognition module 30 is less than the number of objects 100 in Task 2, the 100 images in Task 2 are first divided into 4 object sets, and the number of images in each set is less than or equal to 30. As an example, the number of objects in the 4 sets can be 30, 30, 20, and 20 respectively. Of course, this example is only used for illustrative purposes and cannot limit this embodiment.
[0122] Then, four illegal image recognition modules can be called to process the four sets in parallel at the same time. The four illegal image recognition modules correspond to the four sets one by one, and different illegal image recognition modules can process objects in different sets.
[0123] Obviously, calling four illegal image recognition modules can process all 100 images in Task 2 in one process, and the task processing efficiency is relatively high.
[0124] In addition to the above embodiments, this specification also provides another method embodiment. Figure 7 The figure is a flowchart of another task processing method provided in this specification.
[0125] It should be noted that this embodiment describes a method for processing a single type of processing object based on a single processing requirement. It is understandable that this embodiment can also be used to process different processing requirements or different types of processing objects.
[0126] The method may include the following steps.
[0127] S201: Determine several types of processing modules for processing the task according to the type of processing object and processing requirements in the task to be processed.
[0128] S202: Determine, according to the processing capacity of each type of processing module, a minimum value N of the processing capacity of a single type of module among the multiple types of processing modules.
[0129] S203: When the number M of processing objects in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, such that the number of processing objects contained in each set is less than or equal to N.
[0130] S204: construct a basic processing unit.
[0131] This embodiment does not limit the specific construction method, as long as the basic processing unit includes several types of processing modules determined in S201.
[0132] Since N is the minimum processing capacity of the several types of processing modules determined in S201, the processing capacity of each type of processing module determined in S201 is greater than or equal to N, and each type of processing module in the basic processing unit can be single.
[0133] Obviously, the basic processing unit constructed by S204 can also process N processing objects at the same time.
[0134] S205: Calling X basic processing units to perform parallel processing on the X processing object sets.
[0135] For a detailed explanation, please refer to the above embodiments, which will not be repeated here.
[0136] This specification also provides other method embodiments, and does not limit the method for determining N. In addition to determining according to the maximum and minimum values in the above two method embodiments, the specific method can also be determined according to the mode, median, average value, etc.
[0137] Of course, these examples are only used for illustrative purposes and cannot limit the scope of the disclosure of this specification.
[0138] Correspondingly, when constructing a basic processing unit, a specific construction method is not limited, as long as a single basic processing unit can process N objects simultaneously.
[0139] Regardless of how N is determined, since the basic processing unit can process N objects simultaneously, when M is greater than N, X basic processing units can be called for parallel processing, and all M processing objects can be processed in one processing; and when M is less than or equal to N, a single basic processing unit can process all M processing objects in one processing.
[0140] Therefore, the above-mentioned multiple embodiments disclosed in this specification can also achieve technical effects such as improving task processing efficiency and avoiding the problem of waste of processing module resources.
[0141] For further understanding, this specification also provides an application method embodiment. Specific application scenarios may include: processing 100 images in a task and the need for content review. It should be noted that this scenario is only used for exemplary description and cannot limit the scope of disclosure of this specification.
[0142] The method may include at least the following steps.
[0143] S301: Determine the image content extraction module and content review module for processing the task according to the image type in the task to be processed and the processing requirements of the content review.
[0144] Among them, the processing capacity of the image content extraction module can be 4, and the processing capacity of the content review module can be 9.
[0145] S302: Determine the maximum processing capacity of a single type of processing module among several types of processing modules according to the processing capacity of each type of processing module.
[0146] S303: When the number of processing objects 100 in the task to be processed is greater than 9, the quotient of 100 and 9 is calculated to be 11, and the remainder is 1. Therefore, the 100 processing objects can be divided into 12 processing object sets. Specifically, 11 sets may contain 9 processing objects, and the remaining set may contain 1 processing object.
[0147] The number of processing objects contained in each set is less than or equal to 9.
[0148] Of course, as another embodiment, 8 sets may contain 8 processing objects, and the remaining 4 sets may contain 9 processing objects, as long as the number of processing objects contained in each set is less than or equal to 9.
[0149] S304: construct a basic processing unit.
[0150] The basic processing unit may include one content review module and three image content extraction modules, wherein the three image content extraction modules may simultaneously process a total of 12 processing objects in parallel, which is greater than 9.
[0151] S305: calling 12 basic processing units to perform parallel processing on 12 processing object sets.
[0152] Taking a single basic processing unit processing 9 processing objects at the same time as an example, specifically, 3 image content extraction modules process 3 processing objects respectively, and input the 9 processing results into 1 content review module for processing.
[0153] In addition to the above method embodiments, this specification also provides corresponding device embodiments.
[0154] Device embodiment 1.
[0155] like Figure 8 The figure is a schematic diagram of the structure of a task processing device provided in this specification, and the device may include at least the following units.
[0156] The first determining unit 401 is used to determine several types of processing modules for processing the task according to the processing object type and processing requirements in the task to be processed.
[0157] The first division unit 402 is used to determine the maximum value of the processing capacity of a single type of module among several types of processing modules as N according to the processing capacity of each type of processing module; wherein the processing capacity of any type of processing module is used to characterize the upper limit of the number of objects that can be processed simultaneously by a single processing module of this type; when the number M of processing objects in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N.
[0158] The first construction unit 403 is used to construct a basic processing unit; each basic processing unit includes several types of processing modules, and the product of the number of each type of processing modules and the processing capacity of the type of processing modules is greater than or equal to N.
[0159] The first parallel processing unit 404 is used to call X basic processing units to perform parallel processing on X processing object sets.
[0160] Specifically, the first division unit 402 can be used to: calculate the quotient of M and N, and if there is a remainder, determine the result of adding one to the quotient as X, thereby dividing the M processing objects into X-1 sets containing N processing objects and 1 set containing the same number of processing objects as the remainder; if there is no remainder, determine the quotient as X, thereby dividing the M processing objects into X sets containing N processing objects.
[0161] The first construction unit can be specifically used to: for each type of processing module i among several types of processing modules, perform the following operations: determine the number W of the processing modules of this type i , so that W i The product of the processing capacity of this type of processing module is greater than or equal to N; W i This type of processing module is added to the basic processing unit.
[0162] In addition, the device may further include: an independent processing unit 405: configured to, when the number M of processing objects in the task to be processed is less than or equal to N, call one basic processing unit to process the M processing objects.
[0163] Device embodiment 2.
[0164] like Fig. 9 The figure is a schematic diagram of another task processing device provided in this specification. The device may include at least the following units.
[0165] The second determining unit 501 is used to determine several types of processing modules for processing the task according to the processing object type and processing requirements in the task to be processed.
[0166] The second division unit 502 is used to determine the minimum processing capacity of a single type of module among several types of processing modules as N according to the processing capacity of each type of processing module; wherein the processing capacity of any type of processing module is used to characterize the upper limit of the number of objects that can be processed simultaneously by a single processing module of this type; when the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N.
[0167] The second construction unit 503 is used to construct a basic processing unit; each basic processing unit includes several types of processing modules, and the number of each type of processing module is 1.
[0168] The second parallel processing unit 504 calls X basic processing units to perform parallel processing on X processing object sets.
[0169] The detailed explanation of the above two device embodiments can refer to the above method embodiments.
[0170] Of course, the above two device embodiments are only used for illustrative purposes and cannot limit the scope of this specification. The device embodiments corresponding to the above method embodiments are all within the scope of this specification.
[0171] The embodiments of the present specification also provide a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a task processing method when executing the program.
[0172] Fig.10 A more specific hardware structure diagram of a computer device provided in an embodiment of this specification is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0173] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0174] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0175] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0176] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0177] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0178] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0179] The embodiments of the present specification also provide a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, a task processing method is implemented.
[0180] 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 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 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.
[0181] It can be known from the above description of the implementation mode that the technicians in this field can clearly understand that the embodiments of this specification can be implemented by means of software plus the necessary general hardware platform. Based on such an understanding, the technical solution of the embodiments of this specification can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments of this specification.
[0182] 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, which may be in the form of 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 transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0183] Each embodiment in this specification is described in a progressive manner, and the same and 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 device 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. The device embodiment described above is merely schematic, wherein the modules described as separate components may or may not be physically separated, and the functions of each module can be implemented in the same one or more software and / or hardware when implementing the embodiment scheme of this specification. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the embodiment scheme. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0184] The above is only a specific implementation of the embodiments of this specification. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the embodiments of this specification. These improvements and modifications should also be regarded as protection for the embodiments of this specification.
Claims
1. A task processing method, comprising: According to the type of processing object and processing requirements in the task to be processed, determine several types of processing modules for processing the task; According to the processing capacity of each type of processing module, the maximum processing capacity of a single type of module among the several types of processing modules is determined as N; wherein the processing capacity of any type of processing module is used to represent the upper limit of the number of objects that a single processing module of this type can process simultaneously; When the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N; Constructing a basic processing unit; wherein each basic processing unit includes the aforementioned several types of processing modules, and the product of the number of each type of processing modules and the processing capacity of the processing modules of this type is greater than or equal to N; the basic processing unit is used to simultaneously process all objects in any of the aforementioned processing object sets; X basic processing units are called to perform parallel processing on the X processing object sets.
2. The method according to claim 1, wherein dividing the M processing objects into X processing object sets comprises: Calculate the quotient of M and N, and if there is a remainder, determine the result of adding 1 to the quotient as X, so as to divide the M processing objects into X-1 sets including N processing objects and 1 set including the same number of processing objects as the remainder; If there is no remainder, the quotient is determined to be X, so that the M processing objects are divided into X sets containing N processing objects.
3. The method according to claim 1, wherein the constructing of the basic processing unit comprises: For each type of processing module i among the several types of processing modules, the following operations are performed: Determine the number of processing modules of this type W i , so that W i The product of the processing capacity of the processing module of this type is greater than or equal to N; W i This type of processing module is added to the basic processing unit.
4. The method according to claim 1, further comprising: When the number M of processing objects in the task to be processed is less than or equal to N, one basic processing unit is called to process the M processing objects.
5. A task processing method, comprising: According to the type of processing object and processing requirements in the task to be processed, determine several types of processing modules for processing the task; According to the processing capacity of each type of processing module, the minimum value of the processing capacity of a single type of module among the several types of processing modules is determined as N; wherein the processing capacity of any type of processing module is used to represent the upper limit of the number of objects that a single processing module of this type can process simultaneously; When the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N; Constructing a basic processing unit; wherein each basic processing unit includes the aforementioned several types of processing modules, and the number of each type of processing module is 1; the basic processing unit is used to simultaneously process all objects in any of the aforementioned processing object sets; X basic processing units are called to perform parallel processing on the X processing object sets.
6. A task processing device, comprising: A first determining unit: used to determine several types of processing modules for processing the task according to the type of processing object and processing requirements in the task to be processed; A first division unit is used to determine, according to the processing capacity of each type of processing module, that the maximum processing capacity of a single type of module among the several types of processing modules is N; wherein the processing capacity of any type of processing module is used to characterize the upper limit of the number of objects that can be processed simultaneously by a single processing module of this type; when the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N; The first construction unit is used to construct a basic processing unit; each basic processing unit includes the aforementioned several types of processing modules, and the product of the number of each type of processing modules and the processing capacity of the processing modules of this type is greater than or equal to N; the basic processing unit is used to simultaneously process all objects in any of the aforementioned processing object sets; The first parallel processing unit is used to call X basic processing units to perform parallel processing on the X processing object sets.
7. The apparatus according to claim 6, wherein the first dividing unit is configured to: Calculate the quotient of M and N, and if there is a remainder, determine the result of adding 1 to the quotient as X, so as to divide the M processing objects into X-1 sets including N processing objects and 1 set including the same number of processing objects as the remainder; If there is no remainder, the quotient is determined to be X, so that the M processing objects are divided into X sets containing N processing objects.
8. The device according to claim 6, wherein the first building unit is used for: For each type of processing module i among the several types of processing modules, the following operations are performed: Determine the number of processing modules of this type W i , so that W i The product of the processing capacity of the processing module of this type is greater than or equal to N; W i This type of processing module is added to the basic processing unit.
9. The device according to claim 6, further comprising: Independent processing unit: used to call one basic processing unit to process the M processing objects when the number of processing objects M in the task to be processed is less than or equal to N.
10. A task processing device, comprising: A second determining unit: used to determine several types of processing modules for processing the task according to the type of processing object and processing requirements in the task to be processed; A second division unit is used to determine, according to the processing capacity of each type of processing module, that the minimum value of the processing capacity of a single type of module in the plurality of types of processing modules is N; wherein the processing capacity of any type of processing module is used to characterize the upper limit of the number of objects that can be processed simultaneously by a single processing module of this type; when the number of processing objects M in the task to be processed is greater than N, the M processing objects are divided into X processing object sets, so that the number of processing objects contained in each set is less than or equal to N; The second construction unit is used to construct a basic processing unit; each basic processing unit includes the aforementioned several types of processing modules, and the number of each type of processing module is 1; the basic processing unit is used to simultaneously process all objects in any of the aforementioned processing object sets; The second parallel processing unit is used to call X basic processing units to perform parallel processing on the X processing object sets.
11. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Task parallel processing method and device
CN103677751A
General multiprocessor parallel calculation method and system
CN104598425A
Task scheduling method, device and system
CN105808328A
Risk group identification method and device
CN111738628A
Method of classification of an object and system thereof
US20190236415A1
