AI algorithm scheduling method and device, storage medium and electronic equipment
By generating an AI algorithm-device resource matching table, the problem of inaccurate AI algorithm scheduling in heterogeneous camera networks is solved, achieving full utilization of device performance and efficient use of resources.
Patent Information
- Application Number
- CN202510802556.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-16
- Publication Date
- 2025-11-25
AI Technical Summary
Existing technologies cannot fully account for chip differences in heterogeneous camera networks, resulting in inaccurate AI algorithm scheduling, inability to adapt to changes in video stream parameters, and thus waste of resources or task delays.
A pre-stored AI algorithm-device resource matching table is generated. Through feature extraction and nonlinear transformation encoder, the matching degree between device resources and AI algorithms is calculated, and AI algorithms are precisely scheduled.
This improves the accuracy of AI algorithm scheduling, fully utilizes equipment performance, and avoids resource waste and task delays.
Smart Images

Figure CN121008884A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, and in particular relates to an AI algorithm scheduling method and device, a storage medium and an electronic device. BACKGROUND
[0002] With the continuous development of high-definition, wireless and intelligent technologies, camera technology has undergone a major upgrade, giving rise to a heterogeneous camera network with various forms and different scales. This network is composed of cameras with different functions and manufactured by different manufacturers, such as high-definition cameras, infrared cameras, intelligent cameras, etc. In these complex and diverse camera networks, AI algorithms integrate computer vision technology, giving the system the ability to understand scene content, enabling traditional discriminative AI methods such as target detection and tracking, image classification, and region segmentation, as well as generative AI algorithms such as multi-modal large models that have gradually been involved with the popularization of large model technology.
[0003] In the related art, in the business field of a heterogeneous camera network, in order to meet the functional requirements of the business and improve the overall performance, AI algorithm scheduling has become a key link. Although the existing technology has made certain progress in AI algorithm scheduling, there are still the following defects: first, the chips (such as CPU, GPU, NPU, FPGA, etc. accelerators) carried by each camera have significant differences in computing power, and the existing scheduling method is difficult to fully consider such differences, resulting in inaccurate scheduling strategies and failing to fully utilize the performance advantages of each device. Second, the resolution, code rate, content complexity and other key parameters of the video stream in network transmission change at any time, making it impossible to adjust the algorithm allocation strategy in real time, difficult to adapt to the rapid changes of the business, and easy to cause resource waste or task delay. SUMMARY
[0004] The embodiments of the present application provide an AI algorithm scheduling method, device, storage medium and electronic device. In order to have a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This part is not a general review, nor does it determine the key / important elements or delineate the protection scope of these embodiments. Its only purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0005] In a first aspect, the embodiments of the present application provide an AI algorithm scheduling method, the method comprising:
[0006] In response to the AI algorithm scheduling instruction, a pre-stored AI algorithm-device resource matching degree table is acquired; the AI algorithm scheduling instruction carries a to-be-called AI algorithm identifier and a target device resource identifier, the pre-stored AI algorithm-device resource matching degree table stores a mapping relationship between a combination of a device resource identifier of each device resource and an AI algorithm identifier of each AI algorithm and an algorithm-resource matching degree, and the algorithm-resource matching degree is a matching degree between each device resource and each AI algorithm;
[0007] From the pre-stored AI algorithm-device resource matching degree table, a target algorithm-resource matching degree corresponding to the combination of the to-be-called AI algorithm identifier and the target device resource identifier is queried.
[0008] In a case where the target algorithm-resource matching degree is a preset value, a target AI algorithm corresponding to the to-be-called AI algorithm identifier is scheduled.
[0009] Optionally, the pre-stored AI algorithm-device resource matching degree table is generated according to the following steps, including:
[0010] Feature extraction is performed on a device resource parameter set of each device resource in a business scenario and an algorithm performance parameter set of each AI algorithm, to obtain an AI algorithm feature set and a device resource feature set;
[0011] According to the AI algorithm feature set and the device resource feature set, a resource feature representation vector and an algorithm feature representation vector are constructed.
[0012] According to the resource feature representation vector and the algorithm feature representation vector, an algorithm-resource matching degree corresponding to each device resource and each AI algorithm is generated.
[0013] A mapping relationship between a combination of a device resource identifier of each device resource and an AI algorithm identifier of each AI algorithm and an algorithm-resource matching degree is stored, to obtain the pre-stored AI algorithm-device resource matching degree table.
[0014] Optionally, according to the AI algorithm feature set and the device resource feature set, the resource feature representation vector and the algorithm feature representation vector are constructed, including:
[0015] The device resource parameter set is input into a preset resource feature encoder, and resource feature encoding is output.
[0016] The algorithm performance parameter set is input into a preset algorithm feature encoder, and algorithm feature encoding is output.
[0017] The resource feature encoding and the algorithm feature encoding are respectively subjected to nonlinear transformation, so that the resource feature encoding and the algorithm feature encoding are mapped to the same space for feature alignment, to obtain the resource feature representation vector and the algorithm feature representation vector.
[0018] Optionally, the resource feature code and the algorithm feature code are respectively subjected to nonlinear transformation, including:
[0019] The resource feature code and the algorithm feature code are input into a pre-trained nonlinear transformation encoder, so that the resource feature code and the algorithm feature code are mapped to the same space for feature alignment.
[0020] Optionally, the pre-trained nonlinear transformation encoder is generated according to the following steps, including:
[0021] In the operation and maintenance log of the business scene, a training sample is extracted;
[0022] From the training sample, a device resource set matched with the AI algorithm is labeled as a positive sample;
[0023] From the training sample, a device resource set not matched with the AI algorithm is labeled as a negative sample;
[0024] A nonlinear transformation encoder is created;
[0025] The nonlinear transformation encoder is subjected to machine learning using the positive sample and the negative sample, to obtain the pre-trained nonlinear transformation encoder.
[0026] Optionally, according to the resource feature representation vector and the algorithm feature representation vector, an algorithm-resource matching degree corresponding to each device resource and each AI algorithm is generated, including:
[0027] The cosine similarity between the resource feature representation vector and the algorithm feature representation vector is calculated;
[0028] In a case where the cosine similarity is greater than or equal to a preset threshold, the algorithm-resource matching degree corresponding to each device resource and each AI algorithm is set to 1, to obtain the algorithm-resource matching degree corresponding to each device resource and each AI algorithm; or,
[0029] In a case where the cosine similarity is less than the preset threshold, the algorithm-resource matching degree corresponding to each device resource and each AI algorithm is set to -1, to obtain the algorithm-resource matching degree corresponding to each device resource and each AI algorithm.
[0030] Optionally, the pre-trained nonlinear transformation encoder is obtained by subjecting the nonlinear transformation encoder to machine learning using the positive sample and the negative sample, including:
[0031] The positive sample and the negative sample are input into the nonlinear transformation encoder, and a model loss value is output;
[0032] In a case where the model loss value reaches a minimum, the pre-trained nonlinear transformation encoder is generated.
[0033] In a second aspect, the embodiments of the present application provide an AI algorithm scheduling device, the device comprising:
[0034] an acquisition module configured to acquire a pre-stored AI algorithm-device resource matching degree table in response to an AI algorithm scheduling instruction, the AI algorithm scheduling instruction carrying an AI algorithm to be invoked identifier and a target device resource identifier, the pre-stored AI algorithm-device resource matching degree table storing a mapping relationship between a combination of an AI algorithm identifier of each AI algorithm and a device resource identifier of each device resource and an algorithm-resource matching degree, the algorithm-resource matching degree being a matching degree between each device resource and each AI algorithm;
[0035] a query module configured to query a target algorithm-resource matching degree corresponding to the combination of the AI algorithm to be invoked identifier and the target device resource identifier from the pre-stored AI algorithm-device resource matching degree table;
[0036] a scheduling module configured to schedule a target AI algorithm corresponding to the AI algorithm to be invoked identifier in a case where the target algorithm-resource matching degree is a preset value.
[0037] In a third aspect, the embodiments of the present application provide a computer storage medium, the computer storage medium storing a plurality of instructions, the instructions being adapted to be loaded by a processor and executed to perform the method steps described above.
[0038] In a fourth aspect, the embodiments of the present application provide an electronic device, which can include a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded by the processor and executed to perform the method steps described above.
[0039] The technical solutions provided by the embodiments of the present application can include the following beneficial effects:
[0040] In the embodiments of the present application, by generating the pre-stored AI algorithm-device resource matching degree table, in the scheduling process, the system can determine whether the target device resource is suitable for executing the AI algorithm to be invoked according to the accurate matching degree information, thereby avoiding algorithm execution failure or performance degradation caused by resource mismatch, enhancing the accuracy of scheduling, and further giving full play to the performance advantages of the device while avoiding resource waste or task delay.
[0041] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0042] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.
[0043] Figure 1is a flowchart of an AI algorithm scheduling method provided by an embodiment of the present application.
[0044] Figure 2 is an architecture diagram of a heterogeneous camera network provided by the present application.
[0045] Figure 3 is a diagram of an algorithm-resource matching degree calculation process corresponding to each device resource and each AI algorithm provided by the present application.
[0046] Figure 4 is a diagram of an AI algorithm-device resource matching degree table stored in advance in the scenario of a heterogeneous camera network provided by the present application.
[0047] Figure 5 is a structural diagram of an AI algorithm scheduling device provided by the present application.
[0048] Figure 6 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following description and drawings are illustrative of the specific embodiments of the present application and are not intended to limit the generality of the present application.
[0050] It should be clear that the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0051] The following description refers to the accompanying drawings. In the drawings, like reference numbers indicate identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0052] In the description of the present application, it should be understood that the terms "first", "second", etc. are used only for the purpose of description, and cannot be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, "multiple" means two or more, unless otherwise specified. "And / or", which describes the relationship between the associated objects, means that there can be three relationships, for example, A and / or B can mean that there are three cases of A alone, A and B together, and B alone. The character " / " generally represents an "or" relationship between the associated objects.
[0053] The application provides an AI algorithm scheduling method and device, a storage medium and an electronic device to solve the problems in the related art. In the embodiment of the application, an AI algorithm-device resource matching degree table is generated, and in the scheduling process, the system can determine whether the target device resource is suitable for executing the AI algorithm to be called according to the accurate matching degree information, thereby avoiding algorithm execution failure or performance degradation caused by resource mismatch, enhancing the accuracy of scheduling, and fully exerting the performance advantage of the device while avoiding resource waste or task delay. The following will be described in detail with exemplary embodiments.
[0054] The following will be described in detail with exemplary embodiments in combination with the accompanying drawings. Figure 1 - The accompanying drawings Figure 4 The AI algorithm scheduling method provided in the embodiment of the application will be described in detail. The method can be realized by relying on a computer program and can run on an AI algorithm scheduling device based on the von Neumann architecture. The computer program can be integrated in an application or run as an independent tool application.
[0055] Please refer to Figure 1 A flowchart of the AI algorithm scheduling method provided in the embodiment of the application is shown in FIG. 1. As shown in FIG. 1, the method provided in the embodiment of the application can include the following steps: Figure 1
[0056] S101, in response to an AI algorithm scheduling instruction, an AI algorithm-device resource matching degree table stored in advance is acquired; the AI algorithm scheduling instruction carries an AI algorithm to be called and a target device resource identifier, and the AI algorithm-device resource matching degree table stored in advance stores the mapping relationship between the combination of the device resource identifier of each device resource and the AI algorithm identifier of each AI algorithm and the algorithm-resource matching degree, and the algorithm-resource matching degree is the matching degree between each device resource and each AI algorithm;
[0057] The AI algorithm scheduling instruction is an instruction triggering the AI algorithm scheduling operation and is automatically initiated in the process of executing a task by a business system. The AI algorithm-device resource matching degree table is a data table calculated and stored in advance and is used to record the matching degree information between each AI algorithm and each device resource. The device resource is a device in a heterogeneous network, for example, the device resource is various cameras in the network when the heterogeneous network is a heterogeneous camera network. The AI algorithm is used to process the data of the device resource, for example, an algorithm for image classification or an algorithm for target tracking in the heterogeneous camera network.
[0058] For example, the architecture of the heterogeneous camera network is as shown in FIG. 2. Figure 2 As shown, it includes three components: cloud, camera device end, and network connection. The basic layer of the cloud environment includes storage resources, computing resources, databases, network connections, etc. The AI algorithm layer covers various visual algorithm models applied to business scenarios. The information of the camera end includes device type, computing power, storage, network connection, etc.
[0059] For example, in a heterogeneous camera network, the scheduling of AI algorithms becomes a key factor in meeting business function requirements and improving overall performance. In the face of a complex network environment composed of multiple types of cameras such as high-definition cameras, infrared cameras, and intelligent cameras, it is necessary to accurately schedule AI algorithms for data processing according to different cameras.
[0060] It should be noted that in addition to the heterogeneous camera network, the present application can be extended to other types of heterogeneous networks (cloud-edge-end) that are not limited to the heterogeneous camera network, and can also be applied to any type of AI algorithm scheduling system. In terms of algorithm tasks, it is not limited to AI algorithms used in the heterogeneous camera network, but can also include other algorithms and other AI large model algorithms. The module division of DNN in the AI algorithm can also be applicable.
[0061] In some embodiments of the present application, during the processing of the business in the heterogeneous network, based on the actual business logic, an AI algorithm scheduling instruction can be automatically triggered. The system responds to the AI algorithm scheduling instruction to obtain a pre-stored AI algorithm-device resource matching degree table to schedule AI algorithms suitable for different device resources in the heterogeneous network.
[0062] In some embodiments of the present application, the specific process of generating the pre-stored AI algorithm-device resource matching degree table includes: performing feature extraction on the device resource parameter set of each device resource in the business scenario and the algorithm performance parameter set of each AI algorithm to obtain an AI algorithm feature set and a device resource feature set; constructing a resource feature representation vector and an algorithm feature representation vector according to the AI algorithm feature set and the device resource feature set; generating an algorithm-resource matching degree corresponding to each device resource and each AI algorithm according to the resource feature representation vector and the algorithm feature representation vector; storing the mapping relationship between the combination of the device resource identifier of each device resource and the AI algorithm identifier of each AI algorithm and the algorithm-resource matching degree to obtain the pre-stored AI algorithm-device resource matching degree table.
[0063] Specifically, the AI algorithm feature set is represented as: A=(a1, a2,..., a n As shown in Table 1, it contains information such as computing requirements, resource requirements, and delay requirements of AI algorithm tasks.
[0064] Table 1
[0065] Dimension Meaning [a1] Model case: network structure of the model, and the amount of parameters [a2] Computing power requirement: computational intensity [a3] Memory requirement: memory occupied by the model, and memory required for operation [a4] Network bandwidth requirement: bandwidth required for data transmission ... Real-time requirement: algorithm task delay a n ]]>
[0066] Specifically, the device resource feature set is represented as: R = (r1, r2,..., r m As shown in Table 2, the information includes the camera device and the computing resource, the storage resource, and the network bandwidth of the cloud.
[0067] Table 2
[0068]
[0069]
[0070] In some embodiments of the present application, according to the AI algorithm feature set and the device resource feature set, the specific process of constructing the resource feature representation vector and the algorithm feature representation vector includes: inputting the device resource parameter set into a preset resource feature encoder to output resource feature encoding; inputting the algorithm performance parameter set into a preset algorithm feature encoder to output algorithm feature encoding; and respectively performing nonlinear transformation on the resource feature encoding and the algorithm feature encoding to map the resource feature encoding and the algorithm feature encoding to the same space for feature alignment, so as to obtain the resource feature representation vector and the algorithm feature representation vector.
[0071] In some embodiments of the present application, the specific process of respectively performing nonlinear transformation on the resource feature encoding and the algorithm feature encoding includes: inputting the resource feature encoding and the algorithm feature encoding into a pre-trained nonlinear transformation encoder to map the resource feature encoding and the algorithm feature encoding to the same space for feature alignment.
[0072] Specifically, the specific process of generating the pre-trained nonlinear transformation encoder includes: extracting training samples from the operation and maintenance log of the business scenario; labeling the device resource set matched with the AI algorithm from the training samples as positive samples; labeling the device resource set not matched with the AI algorithm from the training samples as negative samples; creating a nonlinear transformation encoder; and performing machine learning on the nonlinear transformation encoder by using the positive samples and the negative samples to obtain the pre-trained nonlinear transformation encoder.
[0073] Specifically, the specific process of performing machine learning on the nonlinear transformation encoder by using the positive samples and the negative samples to obtain the pre-trained nonlinear transformation encoder includes: inputting the positive samples and the negative samples into the nonlinear transformation encoder to output a model loss value; and generating the pre-trained nonlinear transformation encoder in the case that the model loss value reaches a minimum.
[0074] In some embodiments of the present application, the specific process of generating the algorithm-resource matching degree corresponding to each device resource and each AI algorithm according to the resource feature representation vector and the algorithm feature representation vector includes: calculating the cosine similarity between the resource feature representation vector and the algorithm feature representation vector; in the case that the cosine similarity is greater than or equal to a preset threshold, setting the algorithm-resource matching degree corresponding to each device resource and each AI algorithm as 1 to obtain the algorithm-resource matching degree corresponding to each device resource and each AI algorithm; or in the case that the cosine similarity is less than the preset threshold, setting the algorithm-resource matching degree corresponding to each device resource and each AI algorithm as -1 to obtain the algorithm-resource matching degree corresponding to each device resource and each AI algorithm.
[0075] For example Figure 3 As shown in the figure, Figure 3 is a schematic diagram of a process for calculating the algorithm-resource matching degree corresponding to each device resource and each AI algorithm provided by the present application, and the AI algorithm feature set A u and the device resource feature set R v The algorithm feature encoding and the resource feature encoding are obtained by the algorithm feature encoder and the resource feature encoder (using Transformer) respectively: h u and h v . Further mapping to the same space through nonlinear transformation g u and g v , the final resource feature representation vector and algorithm feature representation vector U and V (U ∈ R d , V ∈ R d ) are obtained. The similarity between U and V can be calculated by using the similarity between vectors (such as Euclidean distance, Mahalanobis distance, cosine distance, Hamming distance, etc.). The cosine distance is used to calculate the similarity, so the algorithm-resource matching degree can be calculated as follows: similarity(A u , R v ) = cos(U, V). If the conditions of the algorithm and the resource match, the matching degree is equal to 1, and if they do not match, the matching degree is equal to -1.
[0076] S102, querying the target algorithm-resource matching degree corresponding to the combination of the to-be-called AI algorithm identifier and the target device resource identifier from the pre-stored AI algorithm-device resource matching degree table;
[0077] In the scenario of a heterogeneous camera network, the pre-stored AI algorithm-device resource matching degree table is assumed to be Figure 4, assuming that the system receives an AI algorithm scheduling instruction, the content is as follows: (to-be-called AI algorithm identifier: algorithm 2, target device resource identifier: camera B), the system receives the scheduling instruction and parses that the to-be-called AI algorithm identifier is "algorithm 2" and the target device resource identifier is "camera B". The system finds the matching degree corresponding to the combination of "camera B" and "algorithm 2" from the pre-stored matching degree table. According to the data in the table, the system finds that the matching degree of "camera B" and "algorithm 2" is 1. At this time, the target algorithm-resource matching degree corresponding to the combination of the target device resource identifier is 1.
[0078] S103, in the case where the target algorithm-resource matching degree is a preset value, scheduling a target AI algorithm corresponding to the to-be-called AI algorithm identifier.
[0079] The preset value can be 1, that is, the conditional matching of the algorithm and the resource.
[0080] In a possible implementation, in the case where the target algorithm-resource matching degree is 1, it is indicated that the AI algorithm and the device resource match, and at this time, the system can schedule a target AI algorithm corresponding to the to-be-called AI algorithm identifier.
[0081] In the embodiment of the application, by generating the pre-stored AI algorithm-device resource matching degree table, in the scheduling process, the system can determine whether the target device resource is suitable for executing the to-be-called AI algorithm according to the accurate matching degree information, thereby avoiding algorithm execution failure or performance decline caused by resource mismatch, enhancing the accuracy of scheduling, and further giving full play to the performance advantage of the device, while avoiding resource waste or task delay.
[0082] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the apparatus embodiments of the present application, please refer to the method embodiments of the present application.
[0083] Please refer to Figure 5 , which shows a structure schematic diagram of an AI algorithm scheduling apparatus provided by an example embodiment of the present application. The AI algorithm scheduling apparatus can be realized by software, hardware or a combination of both to become all or part of an electronic device. The apparatus 1 includes an acquisition module 10, a query module 20 and a scheduling module 30.
[0084] The acquisition module 10 is configured to acquire a pre-stored AI algorithm-device resource matching degree table in response to an AI algorithm scheduling instruction. The AI algorithm scheduling instruction carries an AI algorithm to be invoked and a target device resource identifier. The pre-stored AI algorithm-device resource matching degree table stores a mapping relationship between a combination of an AI algorithm identifier of each AI algorithm and a device resource identifier of each device resource and an algorithm-resource matching degree. The algorithm-resource matching degree is a matching degree between each device resource and each AI algorithm.
[0085] The query module 20 is configured to query, from the pre-stored AI algorithm-device resource matching degree table, a target algorithm-resource matching degree corresponding to a combination of the AI algorithm to be invoked and the target device resource identifier.
[0086] The scheduling module 30 is configured to schedule a target AI algorithm corresponding to the AI algorithm to be invoked in a case where the target algorithm-resource matching degree is a preset value.
[0087] It should be noted that the AI algorithm scheduling device provided in the above embodiments is only used as an example for the division of the above functional modules in the execution of the AI algorithm scheduling method. In actual applications, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the electronic device is divided into different functional modules to complete all or part of the functions described above. In addition, the AI algorithm scheduling device and the AI algorithm scheduling method provided in the above embodiments belong to the same concept, and the implementation process is detailed in the method embodiments. Here, it is not repeated.
[0088] The serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0089] In the embodiments of the present application, by generating a pre-stored AI algorithm-device resource matching degree table, in the scheduling process, the system can determine whether the target device resource is suitable for executing the AI algorithm to be invoked according to the accurate matching degree information, thereby avoiding algorithm execution failure or performance degradation caused by resource mismatch, enhancing the accuracy of scheduling, and fully exerting the performance advantages of the device, while avoiding resource waste or task delay.
[0090] The present application also provides a computer readable medium having program instructions stored thereon, which, when executed by a processor, implement the AI algorithm scheduling method provided by each of the above method embodiments.
[0091] The present application also provides a computer program product containing instructions, which, when executed on a computer, cause the computer to perform the AI algorithm scheduling method of each of the above method embodiments.
[0092] Please refer to Figure 6A structural schematic diagram of an electronic device is provided for the embodiments of the present application. As shown in Figure 6 The electronic device 1000 can include at least one processor 1001, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002.
[0093] The communication bus 1002 is configured to realize the connection and communication between the components.
[0094] The user interface 1003 can include a display, a camera, and optionally a standard wired interface and a wireless interface.
[0095] The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0096] The processor 1001 can include one or more processing cores. The processor 1001 connects various parts of the electronic device 1000 through various interfaces and lines, executes various functions of the electronic device 1000 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Optionally, the processor 1001 can be implemented in at least one of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1001 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU is mainly used to process operations, user interfaces, and application programs; the GPU is used to render and draw the content to be displayed on the display; and the modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1001, but can be realized by a separate chip.
[0097] The memory 1005 can include a random access memory (RAM) and can also include a read-only memory (ROM). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1005 can include a program storage area and a data storage area, where the program storage area can store instructions for implementing an operating device, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 1005 can also be at least one storage device located away from the aforementioned processor 1001. As shown in Figure 6 The memory 1005 as a computer storage medium can include an operating device, a network communication module, a user interface module, and an AI algorithm scheduling application.
[0098] In Figure 6 In the electronic device 1000 shown, the user interface 1003 is mainly used to provide an interface for user input and obtain user input data; and the processor 1001 can be used to call the AI algorithm scheduling application stored in the memory 1005 and specifically perform the following operations:
[0099] In response to the AI algorithm scheduling instruction, a pre-stored AI algorithm-device resource matching degree table is obtained; the AI algorithm scheduling instruction carries a to-be-called AI algorithm identifier and a target device resource identifier, the pre-stored AI algorithm-device resource matching degree table stores a mapping relationship between a combination of an AI algorithm identifier of each AI algorithm and a device resource identifier of each device resource and an algorithm-resource matching degree, and the algorithm-resource matching degree is a matching degree between each device resource and each AI algorithm;
[0100] From the pre-stored AI algorithm-device resource matching degree table, a target algorithm-resource matching degree corresponding to the combination of the to-be-called AI algorithm identifier and the target device resource identifier is queried;
[0101] In a case where the target algorithm-resource matching degree is a preset value, a target AI algorithm corresponding to the to-be-called AI algorithm identifier is scheduled.
[0102] In one embodiment, when the processor 1001 executes to generate the pre-stored AI algorithm-device resource matching degree table, it specifically performs the following operations:
[0103] extracting feature from a device resource parameter set of each device resource in a business scenario and an algorithm performance parameter set of each AI algorithm, to obtain an AI algorithm feature set and a device resource feature set;
[0104] constructing a resource feature representation vector and an algorithm feature representation vector according to the AI algorithm feature set and the device resource feature set;
[0105] generating an algorithm-resource matching degree corresponding to each device resource and each AI algorithm according to the resource feature representation vector and the algorithm feature representation vector;
[0106] storing a mapping relationship between a combination of a device resource identifier of each device resource, an AI algorithm identifier of each AI algorithm and the algorithm-resource matching degree, to obtain a pre-stored AI algorithm-device resource matching degree table.
[0107] In an embodiment, the processor 1001, when constructing the resource feature representation vector and the algorithm feature representation vector according to the AI algorithm feature set and the device resource feature set, specifically performs the following operations:
[0108] inputting the device resource parameter set into a preset resource feature encoder, and outputting a resource feature code;
[0109] inputting the algorithm performance parameter set into a preset algorithm feature encoder, and outputting an algorithm feature code;
[0110] performing nonlinear transformation on the resource feature code and the algorithm feature code respectively, so that the resource feature code and the algorithm feature code are mapped to the same space for feature alignment, to obtain the resource feature representation vector and the algorithm feature representation vector.
[0111] In an embodiment, the processor 1001, when performing nonlinear transformation on the resource feature code and the algorithm feature code, specifically performs the following operations:
[0112] inputting the resource feature code and the algorithm feature code into a pre-trained nonlinear transformation encoder, so that the resource feature code and the algorithm feature code are mapped to the same space for feature alignment.
[0113] In an embodiment, the processor 1001, when generating the pre-trained nonlinear transformation encoder, specifically performs the following operations:
[0114] extracting training samples from the operation and maintenance log of the business scenario;
[0115] labeling a device resource set matched with the AI algorithm from the training samples as a positive sample;
[0116] labeling a device resource set not matched with the AI algorithm from the training samples as a negative sample;
[0117] creating a nonlinear transformation encoder;
[0118] adopting positive samples and negative samples to machine learn the nonlinear transformation encoder to obtain a pre-trained nonlinear transformation encoder.
[0119] In an embodiment, the processor 1001, when performing the generation of the algorithm-resource matching degree corresponding to each device resource and each AI algorithm according to the resource feature representation vector and the algorithm feature representation vector, specifically performs the following operations:
[0120] calculating the cosine similarity between the resource feature representation vector and the algorithm feature representation vector;
[0121] in a case where the cosine similarity is greater than or equal to a preset threshold, setting the algorithm-resource matching degree corresponding to each device resource and each AI algorithm as 1 to obtain the algorithm-resource matching degree corresponding to each device resource and each AI algorithm; or
[0122] in a case where the cosine similarity is less than the preset threshold, setting the algorithm-resource matching degree corresponding to each device resource and each AI algorithm as -1 to obtain the algorithm-resource matching degree corresponding to each device resource and each AI algorithm.
[0123] In an embodiment, the processor 1001, when performing the adoption of positive samples and negative samples to machine learn the nonlinear transformation encoder to obtain a pre-trained nonlinear transformation encoder, specifically performs the following operations:
[0124] inputting the positive samples and the negative samples into the nonlinear transformation encoder to output a model loss value;
[0125] in a case where the model loss value reaches a minimum, generating the pre-trained nonlinear transformation encoder.
[0126] In the embodiments of the present application, by generating the pre-stored AI algorithm-device resource matching degree table, in the scheduling process, the system can determine whether the target device resource is suitable for executing the to-be-called AI algorithm according to the accurate matching degree information, thereby avoiding algorithm execution failure or performance degradation caused by resource mismatch, enhancing the accuracy of scheduling, and further giving full play to the performance advantages of the device while avoiding resource waste or task delay.
[0127] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and an AI algorithm scheduling program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiment methods. The storage medium of the AI algorithm scheduling program can be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
[0128] The above disclosure is only the preferred embodiment of the present application, and of course cannot limit the scope of the rights of the present application, so the equivalent changes made according to the claims of the present application still fall within the scope of the present application.
Claims
1. An AI algorithm scheduling method, characterized by, The method comprises: In response to an AI algorithm scheduling instruction, an AI algorithm-device resource matching degree table stored in advance is acquired; the AI algorithm scheduling instruction carries an AI algorithm to be called and a target device resource identifier, and the AI algorithm-device resource matching degree table stored in advance stores a mapping relationship between a combination of a device resource identifier of each device resource, an AI algorithm identifier of each AI algorithm and an algorithm-resource matching degree; the algorithm-resource matching degree is a matching degree between each device resource and each AI algorithm; From the AI algorithm-device resource matching degree table stored in advance, a target algorithm-resource matching degree corresponding to the combination of the AI algorithm to be called and the target device resource identifier is queried; In the case that the target algorithm-resource matching degree is a preset value, a target AI algorithm corresponding to the AI algorithm to be called is scheduled.
2. The method of claim 1, wherein, The AI algorithm-device resource matching degree table stored in advance is generated according to the following steps, comprising: Feature extraction is performed on a device resource parameter set of each device resource in a business scenario and an algorithm performance parameter set of each AI algorithm to obtain an AI algorithm feature set and a device resource feature set; According to the AI algorithm feature set and the device resource feature set, a resource feature representation vector and an algorithm feature representation vector are constructed; According to the resource feature representation vector and the algorithm feature representation vector, an algorithm-resource matching degree corresponding to each device resource and each AI algorithm is generated; A mapping relationship between a combination of a device resource identifier of each device resource, an AI algorithm identifier of each AI algorithm and the algorithm-resource matching degree is stored to obtain the AI algorithm-device resource matching degree table stored in advance.
3. The method of claim 2, wherein, The construction of the resource feature representation vector and the algorithm feature representation vector according to the AI algorithm feature set and the device resource feature set comprises: The device resource parameter set is input into a preset resource feature encoder to output resource feature encoding; The algorithm performance parameter set is input into a preset algorithm feature encoder to output algorithm feature encoding; The resource feature encoding and the algorithm feature encoding are respectively subjected to nonlinear transformation so that the resource feature encoding and the algorithm feature encoding are mapped to the same space for feature alignment to obtain the resource feature representation vector and the algorithm feature representation vector.
4. The method of claim 3, wherein, The nonlinear transformation of the resource feature encoding and the algorithm feature encoding comprises: The resource feature encoding and the algorithm feature encoding are input into a pre-trained nonlinear transformation encoder so that the resource feature encoding and the algorithm feature encoding are mapped to the same space for feature alignment.
5. The method of claim 4, wherein, The pre-trained nonlinear transformation encoder is generated according to the following steps, comprising: In the operation and maintenance log of the business scenario, a training sample is extracted; From the training sample, a device resource set matched with an AI algorithm is labeled as a positive sample; From the training sample, a device resource set not matched with an AI algorithm is labeled as a negative sample; A nonlinear transformation encoder is created; The positive sample and the negative sample are used to machine learn the nonlinear transformation encoder, to obtain a pre-trained nonlinear transformation encoder.
6. The method of claim 2, wherein, The algorithm-resource matching degree corresponding to each device resource and each AI algorithm is generated according to the resource feature representation vector and the algorithm feature representation vector, including: The cosine similarity between the resource feature representation vector and the algorithm feature representation vector is calculated. In a case where the cosine similarity is greater than or equal to a preset threshold, the algorithm-resource matching degree corresponding to each device resource and each AI algorithm is set to 1, to obtain the algorithm-resource matching degree corresponding to each device resource and each AI algorithm; or, In a case where the cosine similarity is less than a preset threshold, the algorithm-resource matching degree corresponding to each device resource and each AI algorithm is set to -1, to obtain the algorithm-resource matching degree corresponding to each device resource and each AI algorithm.
7. The method of claim 5, wherein, The positive sample and the negative sample are used to machine learn the nonlinear transformation encoder, to obtain a pre-trained nonlinear transformation encoder, including: The positive sample and the negative sample are input into the nonlinear transformation encoder, to output a model loss value. In a case where the model loss value reaches a minimum, a pre-trained nonlinear transformation encoder is generated.
8. An AI algorithm scheduling apparatus, characterized by, The device includes: An acquisition module is configured to acquire a pre-stored AI algorithm-device resource matching degree table in response to an AI algorithm scheduling instruction, wherein the AI algorithm scheduling instruction carries a to-be-invoked AI algorithm identifier and a target device resource identifier, and the pre-stored AI algorithm-device resource matching degree table stores a mapping relationship between a combination of a device resource identifier of each device resource, an AI algorithm identifier of each AI algorithm, and an algorithm-resource matching degree, and the algorithm-resource matching degree is a matching degree between the each device resource and the each AI algorithm. A query module is configured to query a target algorithm-resource matching degree corresponding to a combination of the to-be-invoked AI algorithm identifier and the target device resource identifier from the pre-stored AI algorithm-device resource matching degree table. A scheduling module is configured to schedule a target AI algorithm corresponding to the to-be-invoked AI algorithm identifier in a case where the target algorithm-resource matching degree is a preset value.
9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, which are suitable for being loaded and executed by a processor to implement the method in any one of claims 1-7.
10. An electronic device, comprising: The device includes: A processor and a memory, wherein the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor to implement the method in any one of claims 1-7. The device includes: A processor and a memory, wherein the memory stores a computer program, and the computer program is suitable for being loaded and executed by the processor to implement the method in any one of claims 1-7.