Pipeline configuration method, device, readable storage medium and electronic device
By analyzing tasks and determining pipeline configuration rules through the server, the pipeline is configured for different scenarios, which solves the problems of poor flexibility and lack of pertinence of the pipeline in the existing technology, and improves task execution efficiency and resource utilization.
Patent Information
- Application Number
- CN201911158581.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-22
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2039-11-22
AI Technical Summary
In the prior art, the pipelines applied to task processing have poor flexibility and are not highly targeted, making it difficult to effectively improve task execution efficiency and server resource utilization.
The server parses the tasks to be executed and determines the task type and attribute information, including scene information. Based on the algorithm set and available resource information, determine the pipeline configuration rules corresponding to each scenario information, including algorithms, connection relationships, and resource allocation. Then, configure the pipeline to process the tasks to be executed based on these rules.
It realizes targeted configuration pipelines for tasks in different scenarios, improves task execution efficiency, and enhances the utilization of server resources.
Smart Images

Figure CN112835626B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a pipeline configuration method, device, readable storage medium and electronic device. Background Art
[0002] When processing more complex tasks, such as tasks involving deep learning, in order to improve processing efficiency and speed and save server memory, the server usually uses a pipeline to string together the required functions or algorithms as processing links of the pipeline to obtain a pipeline for completing the application processing tasks to be executed. In the related art, the pipeline used for task processing has the disadvantages of poor flexibility and lack of pertinence. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure provide a pipeline configuration method, device, readable storage medium and electronic device to configure pipelines specifically for tasks in different scenarios and improve the execution efficiency of tasks.
[0004] In a first aspect, an embodiment of the present disclosure discloses a pipeline configuration method, the method comprising:
[0005] Identify tasks to be performed;
[0006] Parsing the task to be executed to obtain a task type and attribute information, wherein the attribute information includes at least one scene information;
[0007] Determine an algorithm set and available resource information according to the task type, wherein the available resource information includes at least one available processor information and available memory information;
[0008] Determine the pipeline configuration rules corresponding to each scenario information according to the algorithm set and the available resource information, wherein the pipeline configuration rules include algorithms, connection relationships between algorithms, and corresponding resources;
[0009] A pipeline for processing the task to be executed is configured according to the pipeline configuration rules.
[0010] Furthermore, the processor information includes a processor type and a processor quantity, wherein the processor type includes a central processing unit and a graphics processing unit.
[0011] Further, the determining of the pipeline configuration rules corresponding to each scene information according to the algorithm set and the available resource information includes:
[0012] Determining in the algorithm set an algorithm corresponding to each scene information and a connection relationship between the algorithms;
[0013] Corresponding available resources are allocated to each algorithm according to the available resource information.
[0014] Further, allocating corresponding available resources to each algorithm according to the available resource information includes:
[0015] Allocate corresponding memory to each algorithm respectively;
[0016] The processor information corresponding to each of the algorithms is determined respectively.
[0017] Further, the respectively determining the processor information corresponding to each algorithm includes:
[0018] respectively determining a reference processor type for processing each of the algorithms;
[0019] In response to the available resources including a reference processor type, the reference processor type is determined to be a processor type corresponding to the algorithm.
[0020] Further, the determining of the pipeline configuration rules corresponding to each scene information according to the algorithm set and the available resource information includes:
[0021] Determine processor information corresponding to each scene information;
[0022] Determining, according to the algorithm set and the processor information corresponding to the scene information, the algorithm corresponding to the scene information and the connection relationship between the algorithms;
[0023] Corresponding memory is allocated to each algorithm respectively.
[0024] Further, the determining the processor information corresponding to each scene information includes:
[0025] Determine the corresponding reference processor type according to the content of each scene information;
[0026] In response to the available resources including a reference processor type, the reference processor type is determined to be a processor type corresponding to the algorithm.
[0027] Further, configuring the pipeline for processing the task to be executed according to the pipeline configuration rules includes:
[0028] In response to there being only one pipeline configuration rule, a pipeline for processing the to-be-executed task is configured according to the pipeline configuration rule.
[0029] Further, configuring the pipeline for processing the task to be executed according to the pipeline configuration rules includes:
[0030] In response to there being more than one pipeline configuration rule, determining a pipeline order according to an order in which scene information corresponding to each pipeline configuration rule appears in the task to be executed;
[0031] Configure corresponding sub-pipelines according to the pipeline configuration rules;
[0032] The sub-pipelines are connected in sequence according to the pipeline to obtain a pipeline for processing the task to be executed.
[0033] Further, including a plurality of said task types,
[0034] Wherein, determining the algorithm set and available resource information according to the task type includes:
[0035] Determine the algorithm set and available resource information corresponding to each task type;
[0036] Wherein, determining the pipeline configuration rules corresponding to each scenario information according to the algorithm set and the available resource information includes:
[0037] According to the algorithm set and available resource information corresponding to each task type, the pipeline configuration rules corresponding to each scenario information are determined respectively.
[0038] In a second aspect, an embodiment of the present disclosure discloses a pipeline configuration device, the device comprising:
[0039] A task acquisition module is used to determine the tasks to be performed;
[0040] A feature extraction module, used for parsing the task to be executed to obtain a task type and attribute information, wherein the attribute information includes at least one scene information;
[0041] A resource determination module, which determines an algorithm set and available resource information according to the task type, wherein the available resource information includes at least one available processor information and available memory information;
[0042] A rule determination module, used to determine the pipeline configuration rules corresponding to each scenario information according to the algorithm set and the available resource information, wherein the pipeline configuration rules include algorithms, connection relationships between algorithms, and corresponding resources;
[0043] A pipeline configuration module is used to configure a pipeline for processing the task to be executed according to the pipeline configuration rules.
[0044] In a third aspect, an embodiment of the present disclosure discloses a computer-readable storage medium for storing computer program instructions, wherein the computer program instructions implement the method as described in any one of the first aspects when executed by a processor.
[0045] In a fourth aspect, an embodiment of the present disclosure discloses an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement a method as described in any one of the first aspects.
[0046] The present disclosure parses the tasks to be executed through a server to determine the attribute information including at least one scene information, and determines the pipeline configuration rules corresponding to each scene information according to the available algorithms and resources, and then configures the pipeline for processing the tasks to be executed according to each pipeline configuration rule. The present disclosure can automatically parse the tasks to be executed through a server, and configure the pipeline corresponding to the tasks to be executed, and configure the pipeline for tasks in different scenes in a targeted manner, thereby improving the execution efficiency of the tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0048] Figure 1 A flowchart of a pipeline configuration method according to an embodiment of the present disclosure;
[0049] Figure 2 A schematic diagram of the server structure of the pipeline configuration method according to an embodiment of the present disclosure;
[0050] Figure 3 is a schematic diagram of a pipeline according to an embodiment of the present disclosure;
[0051] Figure 4 A schematic diagram of a pipeline configuration device according to an embodiment of the present disclosure;
[0052] Figure 5 Schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0053] The present disclosure is described below based on embodiments, but the present disclosure is not limited to these embodiments. In the detailed description of the present disclosure below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present disclosure without the description of these details. In order to avoid confusing the essence of the present disclosure, known methods, processes, and procedures are not described in detail.
[0054] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.
[0055] Unless the context clearly requires otherwise, the words "include", "comprising" and similar words throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is "including but not limited to".
[0056] In the description of the present disclosure, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.
[0057] Figure 1 is a flow chart of the pipeline configuration method according to an embodiment of the present disclosure, such as Figure 1 As shown, the pipeline configuration method includes:
[0058] Step S100: Determine the task to be executed.
[0059] The tasks to be executed are determined by the server, and the server may receive the tasks to be executed sent by an external terminal or other device through a preset application program interface. The tasks to be executed may be files in the formats of video, audio, text, picture, code, etc.
[0060] Step S200: parsing the task to be executed to obtain a task type and at least one attribute information.
[0061] After receiving the task to be executed, the server analyzes the task to be executed to determine the type of the task to be executed, and the task type may be, for example, a voice recognition task, a face recognition task, a license plate recognition task, etc. The server presets the corresponding relationship between the task type and the result of the server analyzing the task to be executed. Taking the task to be executed received by the server as a video, the preset corresponding relationship is "face image-face recognition", "car image-license plate recognition", "highway scene-license plate recognition", "corridor scene-face recognition" as an example for explanation, and the server determines the task type of the task to be executed by identifying the information contained in the video. When the content of the video includes a face image, or the scene in the video is a scene in the corridor, the type of the task to be executed is determined to be a face recognition task according to the preset corresponding relationship; when the content of the video includes multiple cars, or the scene in the video is a highway scene, the task type of the task to be executed is determined to be a license plate recognition task according to the preset corresponding relationship.
[0062] In some optional embodiments, when the server parses the task to be executed, different contents or different scenes may be obtained. For example, when the server parses the video and obtains the video content including a face image and a car image, the regions of different scenes or contents in the video can be divided first, and then the corresponding task types can be determined according to the contents in the regions obtained after the division. That is, a task to be executed is divided into subtasks of different task types according to different regions, and the subtasks can be processed in parallel, that is, in parallel, according to the task type of each subtask, the algorithm set and available resource information for processing each subtask are determined respectively, and then the pipeline configuration rules corresponding to each scene information in each subtask are determined according to the algorithm set and available resource information corresponding to each subtask, and finally, the corresponding pipelines are configured according to the pipeline configuration rules corresponding to each subtask to process the subtasks in parallel. In this way, when parsing the task to be executed and determining that there are multiple task types, the pipelines corresponding to each task type can be configured respectively, and multiple pipelines can be processed in parallel, which can improve the execution efficiency.
[0063] Furthermore, when the task to be executed is parsed and no object to be processed is obtained, there is no need to perform subsequent operations of configuring the pipeline and applying the pipeline, thereby saving computing power and power consumption.
[0064] The server can also parse the content of the task to be performed, and determine the attribute information of the task to be performed according to the content of the task to be performed, wherein the attribute information includes at least one scene information. The scene information is used to characterize the scene characteristics of the video at this time, for example, it can be a night scene, a day scene, a high-speed motion scene, a low-speed motion scene, an occasional motion scene in a fixed area, an open scene, etc. In addition, the attribute information also includes other information used to characterize the characteristics of the task to be performed. For example, when the task type of the task to be performed is face recognition, the attribute information also includes attribute information such as the number of faces, video time, and video format determined by the server through parsing the task to be performed.
[0065] Step S300: Determine an algorithm set and available resource information according to the task type.
[0066] The algorithm set includes at least one algorithm, and the available resource information includes at least one available processor information and available memory information. After determining the task type of the task to be executed according to step S200, the server determines the algorithm currently available to the server and corresponding to the task type in the algorithm pool to obtain the algorithm set for processing the task to be executed. Each algorithm can take the output of the task to be executed or the previous algorithm as input, and convert it into a corresponding output after processing, so as to realize the file parsing, content recognition, content comparison, format conversion and other processing of the task to be executed. The available processor information includes the processor type and the number of processors, and the number of processors is the number of processors currently available to the server, and the processor type includes a central processing unit and a graphics processing unit. The central processing unit gives priority to processing tasks with high task complexity, low parallelism and for scheduling, and the graphics processing unit gives priority to processing tasks with large computational complexity and high parallelism. The available memory is the memory in the server that is currently unoccupied and can be allocated to each algorithm, and is used to provide cache space for data generated in the process of each algorithm processing the task to be executed.
[0067] Step S400: Determine the pipeline configuration rules corresponding to each scenario information according to the algorithm set and available resource information.
[0068] In an optional implementation of this embodiment, the pipeline configuration rule includes algorithms, connection relationships between algorithms, and corresponding resources. Therefore, the pipeline configuration rule corresponding to each scene information may include:
[0069] Step S410: Determine in the algorithm set the algorithms corresponding to the respective scene information and the connection relationship between the algorithms.
[0070] Among them, the correspondence between the scene information and the algorithm, and the connection relationship between the algorithms can be determined by the algorithm correspondence rules and algorithm sequence rules pre-set by the server. The algorithm correspondence rules are used to characterize the correspondence between the scene information and the available algorithms. For example, the scene information A can correspond to {algorithm a, algorithm b, algorithm c}. When the task type obtained by the server when parsing the task to be executed is a face recognition task, and the obtained attribute information contains the scene information of a night scene, the algorithms corresponding to the night scene include: fill light algorithm, video decoding algorithm, face feature extraction algorithm, face detection algorithm, and feature comparison algorithm. The algorithm sequence rule is used to characterize the execution order of the algorithms. For example, the algorithm execution order can be set to be algorithm a, algorithm b, and algorithm c in sequence. Still taking the example that the task type obtained by the server when parsing the task to be executed is a face recognition task, and the obtained attribute information contains the scene information of a night scene, the algorithm execution order is to execute the video decoding algorithm, fill light algorithm, face detection algorithm, face feature extraction algorithm, and feature comparison algorithm in sequence.
[0071] Step S420: Allocate corresponding available resources to each of the algorithms according to the available resource information.
[0072] For example, the available resources are determined and allocated according to the available resource information, and the available resource information includes available processor information and available memory information. Therefore, in this embodiment, the process of allocating corresponding resources may include:
[0073] Step S421, allocate corresponding memory to each algorithm.
[0074] For example, the server can predict the size of temporary data generated by each algorithm in the process of processing the task to be executed based on the algorithm determined in step S410 and the file size of the task to be executed included in the attribute information, and then allocate reasonable memory to each algorithm based on the predicted temporary data size and the available memory information in the available resource information, so as to prevent the memory allocated to some algorithms from being too small or some algorithms from occupying too much memory.
[0075] Step S422: assign corresponding processor information to each algorithm.
[0076] The processor information includes the type and number of processors for processing the algorithms, and the types of processors may include central processing units and graphics processing units. Due to the different performances of the processors, different processors may be assigned to different algorithms, thereby ensuring high processing efficiency during the operation of the pipeline and improving resource utilization of the server.
[0077] In this embodiment, the corresponding processor information is allocated to each algorithm respectively, including:
[0078] Step S423: Determine the reference processor type for processing each of the algorithms respectively.
[0079] Among them, the type of reference processor for processing each algorithm can be determined according to the attribute information. Furthermore, the server can also determine the number of reference processors required for each algorithm. The type of reference processor can be determined according to the computational complexity of the algorithm and the number of tasks to be performed. Taking face recognition as an example, when processing face recognition tasks, it is necessary to determine the face image in the video and compare whether the face image is a pre-stored standard face image. For videos containing multiple faces, a central processing unit can be used for processing when parsing the video, identifying face images in the video and counting the number; a graphics processor can be used to process the face images in parallel when extracting features from different faces and comparing the detected face images with standard face images. Optionally, the number of processors can be determined according to the number of face images in the tasks to be performed.
[0080] Step S424: In response to the available resources including a reference processor type, determining that the reference processor type is a processor type corresponding to the algorithm.
[0081] For example, for the reference processor type corresponding to each algorithm determined in step S421, when the available resources determined by the server in step S300 include the reference processor type, the reference processor type is determined to be the processor type corresponding to the algorithm. For example, when the reference processor type corresponding to the algorithm is a graphics processor, and the available resources of the server include available processor types of a central processing unit and a graphics processor, the processor type corresponding to the algorithm is determined to be a graphics processor.
[0082] Step S425: In response to the available resources not including the reference processor type, a processor type is determined in the available resources as the processor type corresponding to the algorithm.
[0083] For example, for the reference processor type corresponding to each algorithm determined in step S421, when the available processor types in the available resources determined by the server in step S300 do not include the reference processor type, or the number of reference processors in the available resources is less than the number of processors specified in the attribute information, a processor type is determined in the available resources as the processor type corresponding to the algorithm, and the corresponding number of processors is determined. For example, when the reference processor corresponding to the algorithm is a graphics processor, and the processor included in the available resources of the server is a central processing unit, the processor corresponding to the algorithm is determined to be a central processing unit.
[0084] Through the implementation method, the algorithm corresponding to each scene information can be determined first, and then the execution order of each algorithm can be further determined, and the corresponding processor and memory resources can be allocated to each algorithm according to the characteristics of each algorithm, which can improve the working efficiency of the final pipeline.
[0085] In another optional implementation of this embodiment, the determination of algorithms, connection relationships between algorithms, and corresponding resources may also include:
[0086] Step S410': determine the processor information corresponding to each scene information.
[0087] The process of determining the processor information may include:
[0088] Step S411': determine the corresponding reference processor type according to the content of each scene information.
[0089] Among them, the server can pre-set the correspondence between each scene information and the processor type. For example, for dense scenes, a graphics processor is selected because the amount of content to be processed is too large; for open scenes, a central processing unit is selected because the amount of content to be processed is small. For example, when the task type obtained by the server parsing the task to be executed is license plate recognition, and the attribute information obtained includes two scene information of open scenes and dense scenes, for open scenes, that is, scenes with a small number of objects to be processed, the corresponding reference processor can be determined to be a central processing unit, and for dense scenes, that is, scenes with a large number of objects to be processed, the corresponding reference processor can be determined to be a graphics processor. Optionally, the number of reference processors can also be determined by the attribute information content corresponding to the scene information.
[0090] Step S412': in response to the available resources including a reference processor type, determining that the reference processor type is a processor type corresponding to the algorithm.
[0091] For example, for the reference processor type corresponding to each algorithm determined in step S411', when the available resources determined by the server in step S300 include the reference processor type, the reference processor type is determined to be the processor type corresponding to the algorithm. For example, when the reference processor type corresponding to the algorithm is a graphics processor, and the available resources of the server include available processor types of a central processing unit and a graphics processor, the processor type corresponding to the algorithm is determined to be a graphics processor.
[0092] Step S413': in response to the available resources not including the reference processor type, determining a processor type in the available resources as the processor type corresponding to the algorithm.
[0093] For example, for the reference processor type corresponding to each algorithm determined in step S411', when the available processor types in the available resources determined by the server in step S300 do not include the reference processor type, or the number of reference processors in the available resources is less than the number of processors specified in the attribute information, a processor type is determined in the available resources as the processor type corresponding to the algorithm, and the corresponding number of processors is determined. For example, when the reference processor corresponding to the algorithm is a graphics processor, and the processor included in the available resources of the server is a central processing unit, the processor corresponding to the algorithm is determined to be a central processing unit.
[0094] Step S420': Determine the algorithms corresponding to the scene information and the connection relationship between the algorithms according to the algorithm set and the processor information corresponding to the scene information.
[0095] In a possible implementation, a target algorithm processed by a processor corresponding to the scene information can be determined from an algorithm set, and an algorithm corresponding to the scene information can be determined from the target algorithm according to an algorithm corresponding rule. And a connection relationship between the algorithms can be determined according to an algorithm sequence rule.
[0096] For example, the server pre-sets the algorithms corresponding to the processor types, for example, some algorithms are processed by the graphics processor and some algorithms are processed by the central processing unit. When it is determined that the processor corresponding to the scene information is a graphics processor, the server can determine the target algorithm corresponding to the graphics processor from the algorithm set, and the server can determine the algorithm corresponding to the scene information in the above target algorithm according to the pre-set algorithm correspondence rule, and determine the connection relationship between the algorithms according to the algorithm sequence rule.
[0097] Step S430': allocate corresponding memory to each algorithm.
[0098] For example, the server can predict the size of temporary data generated by each algorithm in the process of processing the task to be executed based on the algorithm determined in step S420' and the file size of the task to be executed, and then allocate reasonable memory to each algorithm based on the predicted temporary data size and the available memory information in the available resource information, so as to prevent the memory allocated to some algorithms from being too small or some algorithms from occupying too much memory.
[0099] Through the implementation method, the corresponding processor of the scene information can be determined first, and then the algorithms corresponding to each processor and the processing order of the algorithms can be further determined. Finally, corresponding resources can be allocated to each algorithm in a targeted manner according to the characteristics of each algorithm. This can reduce the amount of calculation in the process of determining the algorithm and selecting the processor, and improve the efficiency of the processing configuration pipeline.
[0100] Step S500: configuring a pipeline for processing the task to be executed according to the pipeline configuration rules.
[0101] For example, the server determines the pipeline configuration rules corresponding to each scene information according to step S400 and configures the corresponding pipeline, and the pipeline is used to process the task to be executed.
[0102] Among them, when the attribute information determined by the task to be executed includes only one kind of scene information, the pipeline is configured according to the pipeline configuration rules corresponding to the scene information to obtain the pipeline for processing the task to be executed. When the attribute information determined by the task to be executed includes multiple kinds of scene information, that is, the task to be executed is a task obtained by splicing tasks corresponding to multiple scene information, the pipeline sequence is determined according to the order in which the scene information corresponding to each pipeline configuration rule appears in the task to be executed. The corresponding sub-pipeline is configured according to each pipeline configuration rule, and the sub-pipeline is connected according to the pipeline sequence to obtain the pipeline for processing the task to be executed.
[0103] Optionally, when processing a task to be executed that contains information about multiple scenes, the sub-pipelines may not be spliced together, but the task to be executed may be divided according to the scenes, and the corresponding scenes may be processed in parallel by the sub-pipelines.
[0104] The method parses the task to be executed through a server to determine the attribute information including at least one scene information, and determines the pipeline configuration rules corresponding to each scene information according to the available algorithms and resources, and then configures the pipeline for processing the task to be executed according to each pipeline configuration rule. The present disclosure can automatically parse the task to be executed through a server, and configure the pipeline corresponding to the task to be executed, and configure the pipeline for tasks in different scenes in a targeted manner, thereby improving the execution efficiency of the task.
[0105] Figure 2 The server structure diagram of the pipeline configuration method of the embodiment of the present disclosure is as follows: Figure 2 As shown, the pipeline configuration method is implemented through a server 20, wherein the server 20 includes a task configuration module, a pipeline strategy construction module and a pipeline manager.
[0106] When the server 20 is used to configure a pipeline for face recognition, the task configuration module receives and analyzes the task to be executed, that is, analyzes the content of the video and picture waiting to be executed, and determines that the task to be executed is a face recognition task. Then, based on the face recognition task, the attribute information corresponding to the task to be executed is further determined, such as the length of the video to be recognized, the number of faces in the video, and at least one scene information.
[0107] After the task configuration module determines the task type of the task to be executed and the attribute information including at least one scene information, the pipeline strategy construction module of the server 20 determines the pipeline configuration rules corresponding to the scene information, that is, the algorithms corresponding to the scene information, the connection relationship between the algorithms and the corresponding available resources. For example, when it is determined that the task type of the task to be executed is a face recognition task, and the content contained in the determined attribute information is {daytime scene, number of people <30 people, long stay time, and face attributes are required}, the server can determine the corresponding pipeline configuration rule according to the daytime scene as {"workers":["WorkerDecoder","WorkerDetectFace","WorkerFaceFeature","WorkerComparisonVideo","WorkerSaveImage","WorkerFaceAttributes"],"connections":[{"WorkerDecoder":"WorkerDetectFace"},{"WorkerDetectFace":"WorkerFaceFeature"},{"WorkerDetectFace":"WorkerSaveImage"},{"WorkerFaceFeature":"WorkerFaceAttributes"},{"WorkerFaceAttributes":"WorkerComparisonVideo"}]}. Among them, the pipeline configuration rules for configuring the pipeline are: the configured algorithms include: decoding algorithm WorkerDecoder, face detection algorithm WorkerDetectFace, face feature extraction algorithm WorkerFaceFeature, video comparison algorithm WorkerComparisonVideo, image storage algorithm WorkerSaveImage and face attribute extraction algorithm WorkerFaceAttributes. The connection relationship between the algorithms includes: the decoding algorithm is connected to the face detection algorithm, the face detection algorithm is connected to the image storage algorithm, the image storage algorithm is connected to the face feature extraction algorithm, the face feature extraction algorithm is connected to the face attribute extraction algorithm, and the face attribute extraction algorithm is connected to the attribute comparison algorithm. Among them. The face detection algorithm passes the detected face data to the image storage algorithm for storage, and the image storage algorithm passes the stored image to the face feature extraction algorithm to extract face features from the face detection algorithm, and passes the extracted face features to the face attribute extraction algorithm for processing. Then the attributes extracted by the face attribute extraction algorithm are compared through the attribute comparison algorithm.
[0108] After the pipeline manager of the server 20 determines the pipeline configuration rules corresponding to each scenario information in the pipeline strategy construction module, the pipeline manager obtains the corresponding algorithms and resources from the algorithm library and resource pool according to the pipeline configuration rules to configure the pipeline for processing the task to be executed. Wherein, when the scenario information is one type, the pipeline configured by the pipeline configuration rules corresponding to the scenario information is determined to be the pipeline for processing the task to be executed. When the scenario information is multiple types, the pipeline configured by the pipeline configuration rules corresponding to each scenario information is determined to be a sub-pipeline, and the sub-pipelines are spliced in sequence to obtain the pipeline for processing the task to be executed. Optionally, when processing a task to be executed containing multiple scenario information, the sub-pipelines may not be spliced, and the task to be executed may be divided according to the scenario, and the corresponding scenario may be processed in parallel by the sub-pipelines.
[0109] Figure 3 is a schematic diagram of a pipeline according to an embodiment of the present disclosure, such as Figure 3 As shown, the pipeline passes Figure 2 The pipeline manager of the server 20 determines the algorithms to be executed in the following order: video stream acquisition algorithm 30, video decoding stream algorithm 31, face detection algorithm 32, feature extraction algorithm 33, feature comparison algorithm 34, and output result algorithm 35.
[0110] Among them, after the server determines the pipeline for processing the face recognition task to be executed, it first determines the video data to be executed through the video stream acquisition algorithm 30, decodes the video data through the video decoding stream algorithm 31 to obtain the video content, determines the face image in the video content through the face detection algorithm 32, extracts the feature information of the face image through the feature extraction algorithm 33, and then compares the extracted feature information with the feature information pre-stored in the server through the feature comparison algorithm 34 to obtain a comparison result, obtains the execution result of the face recognition task according to the comparison result, and finally outputs the execution result through the output result algorithm 35.
[0111] Figure 4 Schematic diagram of a pipeline configuration device according to an embodiment of the present invention, Figure 4 As shown, the pipeline configuration device includes a task acquisition module 40, a feature extraction module 4, a resource determination module 42, a rule determination module 43 and a pipeline configuration module 44.
[0112] Among them, the task acquisition module 40 is used to determine the task to be executed. The feature extraction module 41 is used to parse the task to be executed to obtain the task type and attribute information, and the attribute information includes at least one scene information. The resource determination module 42 determines the algorithm set and available resource information according to the task type, and the available resource information includes at least one available processor information and available memory information. The rule determination module 43 is used to determine the pipeline configuration rules corresponding to the various scene information according to the algorithm set and the available resource information, and the pipeline configuration rules include algorithms, connection relationships between algorithms, and corresponding resources. The pipeline configuration module 44 is used to configure the pipeline for processing the task to be executed according to the various pipeline configuration rules.
[0113] Furthermore, the processor information includes a processor type and a processor quantity, wherein the processor type includes a central processing unit and a graphics processing unit.
[0114] Furthermore, the rule determination module includes:
[0115] A first resource determination submodule, used to determine the algorithm corresponding to each scene information and the connection relationship between the algorithms in the algorithm set;
[0116] The second resource determination submodule is used to allocate corresponding available resources to each algorithm according to the available resource information.
[0117] Furthermore, the second resource determination submodule includes:
[0118] A first memory determination unit, used to allocate corresponding memory to each of the algorithms respectively;
[0119] The first processor determination unit is used to respectively determine the processor information corresponding to each of the algorithms.
[0120] Further, the first processor determining unit includes:
[0121] A first processor determination subunit, configured to respectively determine a reference processor type for processing each of the algorithms;
[0122] The second processor determination subunit is configured to, in response to the available resources including a reference processor type, determine that the reference processor type is a processor type corresponding to the algorithm.
[0123] Furthermore, the rule determination module includes:
[0124] A second processor determination submodule, used to determine processor information corresponding to each scene information;
[0125] A second algorithm determination submodule, used to determine the algorithm corresponding to the scene information and the connection relationship between the algorithms according to the algorithm set and the processor information corresponding to the scene information;
[0126] The memory determination submodule is used to allocate corresponding memory to each algorithm respectively.
[0127] Furthermore, the second processor determines that the submodule includes:
[0128] A second processor determination unit, configured to determine a corresponding reference processor type according to the content of each attribute information;
[0129] The third processor determining unit is configured to, in response to the available resources including a reference processor type, determine that the reference processor type is a processor type corresponding to the algorithm.
[0130] Furthermore, the pipeline configuration module includes:
[0131] The first pipeline configuration submodule is used for configuring the pipeline for processing the task to be executed according to the pipeline configuration rule in response to there being only one pipeline configuration rule.
[0132] Furthermore, the pipeline configuration module includes:
[0133] A pipeline sequence determination submodule, for determining the pipeline sequence according to the sequence in which the scene information corresponding to each pipeline configuration rule appears in the task to be executed in response to the pipeline configuration rule being more than one;
[0134] A second pipeline configuration submodule, configured to configure corresponding sub-pipelines according to the pipeline configuration rules;
[0135] The third pipeline configuration submodule is used to connect the sub-pipelines according to the pipeline sequence to obtain a pipeline for processing the task to be executed.
[0136] The device can parse the task to be executed through the server to determine the attribute information of the task to be executed, and determine the corresponding algorithm and resources according to the attribute information to generate a pipeline configuration rule to configure the pipeline for processing the task to be executed. Therefore, the pipeline configuration device can automatically generate a pipeline corresponding to the task to be executed through the server, configure the pipeline for different tasks in a targeted manner, and improve the execution efficiency of the task.
[0137] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present disclosure, such as Figure 5As shown, in this embodiment, the electronic device may be a server or a terminal, etc., and the terminal may be, for example, a smart device such as a mobile phone, a computer, or a tablet computer. As shown in the figure, the electronic device includes: at least one processor 51; a memory 50 connected to the at least one processor in communication; and a communication component 52 connected to the storage medium in communication, and the communication component 52 receives and sends data under the control of the processor; wherein the memory 50 stores instructions that can be executed by at least one processor 51, and the instructions are executed by at least one processor 51 to implement the pipeline configuration method described in the embodiment of the present disclosure.
[0138] The memory 50 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 51 executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory, that is, realizing the above-mentioned pipeline configuration method.
[0139] The memory 50 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store a list of options, etc. In addition, the memory 50 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 50 may optionally include a memory remotely arranged relative to the processor 51, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0140] One or more modules are stored in the memory 50, and when executed by one or more processors 51, the pipeline configuration method in any of the above method embodiments is executed.
[0141] The above-mentioned product can execute the method disclosed in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method disclosed in the embodiment of the present application.
[0142] The present disclosure also relates to a computer-readable storage medium for storing a computer-readable program, wherein the computer-readable program is used for a computer to execute part or all of the above method embodiments.
[0143] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0144] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A pipeline configuration method, characterized in that: The method comprises: Identify tasks to be performed; Parsing the task to be executed to obtain a task type and attribute information, wherein the attribute information includes at least one scene information; Determine an algorithm set and available resource information according to the task type, wherein the available resource information includes at least one available processor information and available memory information; Determine the pipeline configuration rules corresponding to each scene information according to the algorithm set and the available resource information, wherein the pipeline configuration rules include algorithms, connection relationships between algorithms, and corresponding resources, wherein the pipeline configuration rules are determined by the algorithms corresponding to each scene information, or by the processors corresponding to each scene information; A pipeline for processing the task to be executed is configured according to the pipeline configuration rules.
2. The method according to claim 1, characterized in that The processor information includes a processor type and a processor quantity, wherein the processor type includes a central processing unit and a graphics processing unit.
3. The method according to claim 1, characterized in that The step of determining the pipeline configuration rules corresponding to each scene information according to the algorithm set and the available resource information includes: Determining in the algorithm set an algorithm corresponding to each scene information and a connection relationship between the algorithms; Corresponding available resources are allocated to each algorithm according to the available resource information.
4. The method according to claim 1, characterized in that: The step of determining the pipeline configuration rules corresponding to each scene information according to the algorithm set and the available resource information includes: Determine processor information corresponding to each scene information; Determining, according to the algorithm set and the processor information corresponding to the scene information, the algorithm corresponding to the scene information and the connection relationship between the algorithms; Corresponding memory is allocated to each algorithm respectively.
5. The method according to any one of claims 1 to 4, characterized in that The configuring of the pipeline for processing the task to be executed according to the pipeline configuration rules includes: In response to there being only one pipeline configuration rule, a pipeline for processing the to-be-executed task is configured according to the pipeline configuration rule.
6. The method according to any one of claims 1 to 4, characterized in that The configuring of the pipeline for processing the task to be executed according to the pipeline configuration rules includes: In response to there being more than one pipeline configuration rule, determining a pipeline order according to an order in which scene information corresponding to each pipeline configuration rule appears in the task to be executed; Configure corresponding sub-pipelines according to the pipeline configuration rules; The sub-pipelines are connected in sequence according to the pipeline to obtain a pipeline for processing the task to be executed.
7. The method according to claim 1, characterized in that Including a plurality of the task types, wherein determining the algorithm set and available resource information according to the task type includes: Determine the algorithm set and available resource information corresponding to each task type; Wherein, determining the pipeline configuration rules corresponding to each scenario information according to the algorithm set and the available resource information includes: According to the algorithm set and available resource information corresponding to each task type, the pipeline configuration rules corresponding to each scenario information are determined respectively.
8. A pipeline configuration device, characterized in that: The device comprises: A task acquisition module is used to determine the tasks to be performed; A feature extraction module, used for parsing the task to be executed to obtain a task type and attribute information, wherein the attribute information includes at least one scene information; A resource determination module, which determines an algorithm set and available resource information according to the task type, wherein the available resource information includes at least one available processor information and available memory information; A rule determination module, used to determine the pipeline configuration rules corresponding to each scene information according to the algorithm set and the available resource information, wherein the pipeline configuration rules include algorithms, connection relationships between algorithms, and corresponding resources, wherein the pipeline configuration rules are determined by the algorithms corresponding to each scene information, or by the processors corresponding to each scene information; A pipeline configuration module is used to configure a pipeline for processing the task to be executed according to the pipeline configuration rules.
9. A computer-readable storage medium for storing computer program instructions, characterized in that: The computer program instructions implement the method according to any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data processing method and system, electronic device and computer readable storage medium
CN109886859A
Assembly line configuration method and device, readable storage medium and electronic equipment
CN112835625A
Computerized control of execution pipelines
US20190303207A1