CN114153525B - AI model servitization sharing method and system for power grid regulation and control service - Google Patents
AI model servitization sharing method and system for power grid regulation and control service Download PDFInfo
- Publication number
- CN114153525B CN114153525B CN202111447806.1A CN202111447806A CN114153525B CN 114153525 B CN114153525 B CN 114153525B CN 202111447806 A CN202111447806 A CN 202111447806A CN 114153525 B CN114153525 B CN 114153525B
- Authority
- CN
- China
- Prior art keywords
- model
- service
- characteristic value
- warehouse
- cluster
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000010276 construction Methods 0.000 claims description 6
- 238000012549 training Methods 0.000 claims description 4
- 230000005540 biological transmission Effects 0.000 abstract description 4
- 238000007726 management method Methods 0.000 description 30
- 230000006870 function Effects 0.000 description 10
- 238000004590 computer program Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000012360 testing method Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000012795 verification Methods 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002045 lasting effect Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/176—Support for shared access to files; File sharing support
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0631—Resource planning, allocation, distributing or scheduling for enterprises or organisations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/06—Energy or water supply
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/4557—Distribution of virtual machine instances; Migration and load balancing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y04—INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
- Y04S—SYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
- Y04S10/00—Systems supporting electrical power generation, transmission or distribution
- Y04S10/50—Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Business, Economics & Management (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Resources & Organizations (AREA)
- General Engineering & Computer Science (AREA)
- Economics (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- Health & Medical Sciences (AREA)
- Entrepreneurship & Innovation (AREA)
- Marketing (AREA)
- Data Mining & Analysis (AREA)
- General Business, Economics & Management (AREA)
- Evolutionary Computation (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Primary Health Care (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Public Health (AREA)
- Development Economics (AREA)
- Educational Administration (AREA)
- Water Supply & Treatment (AREA)
- Game Theory and Decision Science (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses an AI model service sharing method and system for power grid regulation and control service, comprising the following steps: acquiring an AI model warehouse, wherein the AI model warehouse comprises a plurality of model sets, and each model set stores a plurality of AI models of the same type; model online service of an AI model is established in a cluster system by taking a model set in an AI model warehouse as granularity; the AI model in the AI model warehouse is stored into a cluster system through starting model online service; the AI model is loaded from the clustered system according to an external request. The invention adopts a batch access AI model mode, reduces network transmission frequency, effectively improves access efficiency, provides AI model service integrated release based on Kubernetes, realizes quick and smooth upgrading and capacity expansion, improves hardware resource utilization rate, is convenient and quick, safe and reliable, has low cost, and builds an ecological environment which is commonly built and shared in a regulation and control system by applying AI model achievements.
Description
Technical Field
The invention relates to an AI model service sharing method and system for power grid regulation and control service, and belongs to the technical field of power grid regulation and control.
Background
At present, the artificial intelligence technology application in the technical field of power grid regulation obtains preliminary achievements, but various business applications mostly adopt an AI model independent management mode, so that the problems of repeated construction of bottom layer resources, insufficient compression and conversion capability of various algorithm framework models, incapability of tracing model sources and versions, weaker deployment and service release capability of heterogeneous system models and the like exist, and the ecological environment shared by co-construction is not formed by the application of the AI model achievements.
According to the development trend of the current power grid regulation and control service, the full life cycle management framework and system of the artificial intelligent model are urgently needed to be provided, and the purposes of artificial intelligent model storage, version control, model retrieval, cloud-side-end model on-demand deployment and model reasoning capacity servitization sharing are achieved.
Disclosure of Invention
In order to solve the problems that the AI model management is weak and the models cannot be shared in the prior art, the invention provides the AI model service sharing method and system for the power grid regulation and control service, which are used for carrying out unified storage and version management on the AI models, and carrying out model calling through a cluster system, so that the management cost of service application AI models is reduced, the management efficiency is improved, and the co-building sharing of the application AI model results in the power grid regulation and control system is realized.
In order to solve the technical problems, the invention adopts the following technical means:
in a first aspect, the present invention provides an AI model service sharing method for a power grid regulation service, including the following steps:
acquiring an AI model warehouse, wherein the AI model warehouse comprises a plurality of model sets, and each model set stores a plurality of AI models of the same type;
model online service of an AI model is established in a cluster system by taking a model set in an AI model warehouse as granularity;
the AI model in the AI model warehouse is stored into a cluster system through starting model online service;
the AI model is loaded from the clustered system according to an external request.
With reference to the first aspect, further, each model set in the AI model repository is configured with a unique model set ID, the same model set includes one or more model set versions, and each model version is configured with a unique model set version ID; each AI model in the AI model repository is configured with a unique model UID.
In combination with the first aspect, further, a model set information table, a model set version information table and an AI model information table are arranged in the AI model warehouse, and are all in a two-dimensional table form; the model set information table comprises a model set ID, a model set name, a model type and a model source; the model set version information table comprises a model set ID, a model set version ID and an update time; the AI model information table includes a model UID, a model set ID, a model set version ID, and an update time.
In combination with the first aspect, further, the method for constructing the AI model warehouse comprises the following steps:
acquiring a plurality of AI models through power grid regulation and control service training, and temporarily storing the acquired AI models in a memory block mode;
calculating the characteristic value of the memory block by using a checking algorithm, and marking the characteristic value as a first characteristic value;
the memory block and the first characteristic value are sent to file management service of the server together;
the file management service calculates the characteristic value of the memory block again by using a checking algorithm and marks the characteristic value as a second characteristic value;
and judging whether the first characteristic value is the same as the second characteristic value, if so, acquiring an AI model from the memory block, and storing the AI model into a model set corresponding to an AI model warehouse.
With reference to the first aspect, further, the method for creating the model online service includes:
acquiring a service name, an instance number, a CPU, a GPU and a memory;
setting the cluster label of the model online service as 'app=service name-cluster ID' according to the model set ID, the model set version ID and the service name;
calling a Kubernetes API to create a label of the Deployment, wherein the label of the Deployment is a cluster label;
creating ReplicaSet through reployment, and creating Pod with the number equal to the number of examples in a system background by using the ReplicaSet;
calling a Kubernetes API to create Service, and setting the selector of the Service to be consistent with the label of the Deployment;
invoking the Kubernetes API creates an entry and associates the entry with Service.
In combination with the first aspect, further, the method for saving the AI model in the AI model repository to the cluster system by starting the model online service includes:
acquiring a corresponding model UID list from an AI model warehouse according to the model set ID and the model set version ID;
according to the model UID list, acquiring AI models in batches from an AI model warehouse through a file management service, and temporarily storing the acquired AI models in a memory block mode;
calculating the characteristic value of the memory block by using a checking algorithm, and marking the characteristic value as a first characteristic value;
the first characteristic value and the memory block are sent to a cluster system through file management service;
the cluster system calculates the characteristic value of the memory block again by using a checking algorithm and marks the characteristic value as a second characteristic value;
judging whether the first characteristic value is the same as the second characteristic value, if so, storing the memory block into a cluster system.
In combination with the first aspect, further, in the cluster system, the blue-green cluster deployment upgrading of the model online service is performed by modifying the background configuration information of the Ingress object.
With reference to the first aspect, further, in the cluster system, the number of Pods is increased or decreased by calling the Kubernetes API to modify replicas parameters of the reployment; invoking the Kubernetes API modifies the requests and limits parameters of the deviyment, thereby modifying the CPU, GPU and memory of each Pod.
With reference to the first aspect, further, the method for loading the AI model from the cluster system according to the external request includes:
obtaining an http request in a URL format outside the cluster through the Ingress, and carrying out rule matching on the received http request according to a preset rule list;
after the rule matching is successful, the Ingress forwards the http request to Service according to the Service name and port number;
the Service agents the http request to the Pod of the corresponding Deployment according to the selector;
the model online service analyzes the http request, and loads the AI model in the cluster system by using a corresponding model loading mode of each AI algorithm frame according to the analyzed model UID.
In a second aspect, the present invention provides an AI model service sharing system for a power grid regulation service, including:
an AI model repository for storing AI models in the form of model sets, each model set storing AI models of the same type;
the model management module is used for accessing the AI model in batches, updating the AI model and managing model set information and model set versions in an AI model warehouse;
the model online service deployment module is used for deploying the model online service of the AI model in the cluster system by taking the model set in the AI model warehouse as granularity;
the service starting module is used for storing the AI model in the AI model warehouse into the cluster system through the starting model online service;
and the model loading module loads the AI model from the cluster system according to the external request.
The following advantages can be obtained by adopting the technical means:
the invention provides an AI model service sharing method and system for power grid regulation and control business, which realize the co-construction of AI models in the field of power grid regulation and control by converging, regulating and controlling application AI model achievements through an AI model warehouse; aiming at the characteristics of small AI model files and large quantity of the power grid regulation and control service application, the invention manages by taking the model set as granularity, supports batch persistent storage and acquisition of AI models, reduces network transmission frequency and effectively improves model access efficiency; the invention provides the integrated release of the AI model service based on the Kubernetes, can rapidly and smoothly upgrade and expand the model, improves the utilization rate of hardware resources, and realizes the AI model capacity sharing of a cross-dispatching mechanism and a business system; the online service of the model is deployed and upgraded in bluish green, so that uninterrupted external service is ensured, and as long as the service of the old version is not deleted, the online service of the model corresponding to the old version can be switched to at any time, and the risk of upgrading the AI model is effectively reduced.
The method and the system can obviously reduce the communication cost and the labor cost of the service application to the AI model management, effectively improve the model management efficiency and realize the co-establishment and sharing of the AI model application achievements in the regulation and control system.
Drawings
FIG. 1 is a flow chart of the steps of an AI model service sharing method for power grid regulation and control service;
FIG. 2 is a flow chart of AI model management and servicing shared data in an embodiment of the invention;
FIG. 3 is a flow chart of creating a modeled online service in an embodiment of the invention.
Detailed Description
The technical scheme of the invention is further described below with reference to the accompanying drawings:
in order to realize co-building sharing of AI models in a power grid dispatching system, the invention provides an AI model management method oriented to the power grid regulation field, which stores and manages AI models in the power grid regulation field by taking a model set as granularity, and constructs an AI model warehouse, and the specific operation is as follows:
s1, a plurality of model sets are created by a user according to the need, each model set is configured with a unique model set ID, each model set only stores AI models of the same type, and the correspondence between common artificial intelligence algorithm frames and model file types is shown in table 1.
TABLE 1
S2, acquiring a plurality of AI models through power grid regulation and control service training, wherein each AI model is configured with a unique model UID, and temporarily storing the acquired AI models in a memory block mode.
And S3, calculating the characteristic value of the memory block by using a verification algorithm, marking the characteristic value as a first characteristic value, and transmitting the memory block and the first characteristic value to file management service of the server.
S4, the file management service calculates the characteristic value of the memory block again by using a verification algorithm and marks the characteristic value as a second characteristic value.
S5, judging whether the first characteristic value is the same as the second characteristic value, if so, acquiring an AI model from the memory block, and storing the AI model into a model set corresponding to an AI model warehouse.
In an embodiment of the present invention, the verification algorithm includes, but is not limited to, CRC-32, CRC-64, SHA-1, SHA-256, MD5, and the like.
The invention may perform version control on model sets, and the same model set may include one or more model set versions, each model version configured with a unique model set version ID. When any one of the AI models in a model set is updated, a new version of the model set is generated, the AI model can be automatically updated or manually updated, that is, a new model set version can be automatically created or manually created, the AI model manual update process is generally that a user actively uploads the new AI model or modifies parameters of the existing AI model and retrains, and the AI model automatic update process is as follows: the AI model is retrained according to different periods of day, week, month, quarter, year and the like aiming at different applications of the power grid regulation and control service, and is updated in batches, and the manual maintenance is replaced by an internal automatic updating mode, so that the communication cost and the labor cost can be reduced, and the management efficiency is effectively improved.
In the AI model repository, model set information, model set version information, and AI model information are stored in the form of two-dimensional tables, which are respectively noted as a model set information table, a model set version information table, and an AI model information table. The model set information comprises a model set ID, a model set name, a model type, a model source and the like; the model source may be platform-customized or user-customized. The model set version information table comprises a model set ID, a model set version ID, version update time and the like; the AI model information includes model UID, model set ID, model set version ID, update time, and the like.
In the application of partial business in the field of power grid regulation, hundreds or thousands of AI models of the same type are required to be constructed aiming at different power grid equipment, the model files are relatively smaller but the number is relatively more, and the management is carried out by taking a model set as granularity, so that the communication cost and the labor cost can be effectively reduced, and the management efficiency is improved. In addition, the invention adopts a batch persistent storage AI model mode, reduces the network transmission frequency and effectively improves the transmission and storage efficiency
According to the constructed AI model warehouse, the invention provides an AI model service sharing method for power grid regulation and control service, as shown in figures 1 and 2, comprising the following steps:
and step A, acquiring an AI model warehouse.
Step B, establishing model online service of the AI model in the cluster system by taking a model set in the AI model warehouse as granularity; the model online service can be automatically created or manually created, and can provide functions of model prediction, manual or automatic updating and the like, as shown in fig. 3, and specifically comprises the following steps:
step B01, obtaining the service name, the number of instances, the CPU, the GPU, the memory and other needed machine resources, wherein the needed machine resources are generally set manually.
For any model set in the AI model warehouse, only one model online service with unique name exists, the service name corresponds to the model set ID, and the service name is stored in a two-dimensional table form. One model set version has and only has one cluster, and since one model set may include multiple versions, for any model online service, multiple clusters (i.e., model set versions) are supported, but only one cluster in the model online service is accessible outside the cluster through the URL, which is a green cluster, and the other clusters are blue clusters. The cluster ID belongs to UID, and is stored in a two-dimensional table form together with the model set ID, the model set version ID, the number of instances, the CPU, the GPU, the memory, the cluster state and the like, so that the integrity of the mapping relation is ensured.
In the embodiment of the invention, assuming that a model set is G1, a model set version is v1, setting a model online service name test, a cluster ID is d1, the number of instances is 2, the number of CPU cores is 2, the number of GPU cores is 0 and the memory size is 2G.
Step B02, setting the cluster label of the model online service as "app=service name-cluster ID" according to the model set ID, the model set version ID and the service name.
And B03, creating a Deployment. Yaml file, calling a Kubernetes API to create a Deployment, and enabling a label of the Deployment to be the cluster label in the step B02.
Kubernetes creates ReplicaSet, replicaSet using deviyment to create in the background the same number of Pod as the number of instances set. Each Pod corresponds to a container created based on the basic mirror image, the container can start the model on-line service, provide the functions of model prediction, manual or automatic updating and the like, and call the corresponding function each time an http request is received.
The base image is preloaded with Java/Python modules required by model online services such as Spark, tensorFlow, keras, scikit-learn and the like.
In the embodiment of the invention, the name of a depoyment object created by calling a Kubernetes API is "test-d1", the label is "app=test-d 1", the externally exposed port number of a model publishing service is assumed to be 12345, and an example of a depoyment. Yaml file is as follows:
and B04, creating a Service. Yaml file, calling a Kubernetes API to create Service, and setting the selector of the Service to be consistent with the label of the Deployment, so that the group of Pod created in the step B03 can be accessed by the Service.
In this embodiment, calling the Kubernetes API creates a Service name "test-d1", the Service's selector is "app=test-d 1", which will proxy the request to the Pod created in step B03, an example of a Service. Yaml file is as follows:
and step B05, creating an Ingress. Yaml file, calling a Kubernetes API to create the Ingress, and associating the Ingress with Service.
The Service and Pod can only be accessed through the IP address in the Kubernetes cluster internal network and can not be accessed by the outside of the cluster, so that the invention realizes the function of sending an http request to the appointed Pod through the URL outside the cluster through the Ingress. The Ingress has a rule list for inbound requests, which can be matched after receiving http requests, and forward traffic to Service names and port numbers.
In the embodiment of the present invention, an entry object named "test" is created that matches the http rule/modelService/test and forwards the traffic to the 12345 port of the Service object named "test-d1" created in step B04. An example of an entry. Yaml file is as follows:
and C, saving the AI model in the AI model warehouse into a cluster system through starting model online service, wherein the specific operation is as follows:
and C01, starting a model online service, and acquiring a corresponding model UID list from an AI model warehouse according to a model set ID and a model set version ID corresponding to the model online service.
And searching the model set information table, the model set version information table and the AI model information table in the AI model warehouse according to the model set ID and the model set version ID, so that all the AI models UIDs meeting the requirements can be obtained, and a model UID list is formed.
And step C02, acquiring AI models in batches from an AI model warehouse through a file management service according to the model UID list, and temporarily storing the acquired AI models in a memory block mode.
Step C03, calculating the characteristic value of the memory block by using a verification algorithm, and marking the characteristic value as a first characteristic value; and sending the first characteristic value and the memory block to the cluster system through the file management service.
And C04, the cluster system calculates the characteristic value of the memory block again by using a checking algorithm, marks the characteristic value as a second characteristic value, judges whether the first characteristic value is the same as the second characteristic value, and if so, stores the memory block into the cluster system. The AI model is temporarily stored in the cluster system, and machine resources are deleted and released when the model stops serving the clusters online.
After the model online service is started, the model online service is released externally, and the model online service can be requested externally.
And C01-C04 are repeated to realize that the user needs to automatically update the AI model through external URL request and inside, and support the updating of the full model set to any AI model of a designated version and any updated version. One-stop AI model upgrade, meet the manual updating of AI model under different scenes of business application at the same time, automatic periodic updating demand.
For the same model online service, if a new model set version appears or the model set version corresponding to the service needs to be replaced, the blue-green cluster deployment upgrading of the model online service can be performed by modifying the background configuration information of the input object. In the upgrading process, the model online service is always online, and uninterrupted external service provision can be ensured. Meanwhile, in the process of online the new version, any content of the old version is not modified, and during deployment, the state of the old version is not affected, so long as the service of the old version is not deleted, the service can be switched to the model online service corresponding to the old version at any time, and the AI model upgrading risk is reduced.
In the embodiment of the invention, assuming that the new model set version is v2 (corresponding to v1 above), the number of instances is 1, the number of CPU cores is 2, the number of GPU cores is 0, and the memory size is 2G, the specific operation of the cyan cluster deployment upgrade is as follows:
(1) According to the configuration information of a model set, a model set version, a service name, the number of instances, a CPU, a GPU, a memory and the like, a new cluster label of 'app=test-d 2' is set, a Deployment object name created by invoking a Kubernetes API is 'test-d 2', a label of 'app=test-d 2' is set, and Pods with the same number as the number of instances are utilized, wherein the Pods are blue clusters, and a group of Pods created in the step B03 are green clusters.
(2) Creating a Service. Yaml file, calling the Kubernetes API to create a Service name "test-d2", and setting the selector of Service to "app = test-d2", it will proxy the request to the Pod created in step (1).
(3) And (3) calling a Kubernetes API to modify the configuration information of the Ingress object created in the step B05, so as to realize service flow switching.
The back configuration information of the "test" entry object is modified, and the traffic is forwarded to the 12345 port of the Service object named "test-d2" created in step (2). After the handover, the set of Pod created in step (1) becomes a green cluster and the set of Pod created in step B03 becomes a blue cluster.
In the cluster system, when the load capacity of the model service has higher requirements, the Kubernetes API can be called to modify replicas parameters of the depoyments to increase the number of Pods, and the requests and limits parameters can be modified according to the cluster resource use condition to modify the resources such as CPU, GPU and memory of each Pod.
And D, loading an AI model from the cluster system according to an external request, completing model calling, and providing functions such as model prediction and the like.
And D01, acquiring an http request in a URL format outside the cluster through the Ingress, and performing rule matching on the received http request according to a preset rule list.
And D02, after the rule matching is successful, forwarding the http request to the Service according to the Service name and the port number by the Ingress.
And D03, the Service agents the http request to the Pod of the corresponding Deployment according to the selector, and the model online Service in the container on the Pod can receive the http request.
And D04, analyzing the http request by the model online service, loading the AI model in the cluster system by using a model loading mode corresponding to each AI algorithm frame according to the analyzed model UID, returning a model prediction result, and completing AI model calling.
An external accessible URL accesses a version of the model set, and multiple AI models in the version model set can be invoked simultaneously.
The method of the invention further comprises the following steps:
step E: according to the cluster ID, stopping the unused model online service cluster, and specifically, the method comprises the following steps:
step E01: the call Kubernetes API deletes the depoyment named "service name-cluster ID". In this embodiment, the Kubernetes API is called to delete the Deployment named "test-d 1".
Step E02: invoking the Kubernetes API delete tab is "app = service name-cluster ID" ReplicaSet. In this embodiment, the Kubernetes API is called to delete the ReplicaSet with label "app=test-d 1".
Step E03: the call Kubernetes API deletes the Pod labeled "app = service name-cluster ID". In this embodiment, the Kubernetes API is called to delete Pod with label "app=test-d 1".
Step E04: invoking the Kubernetes API deletes the name "Service name-cluster ID" Service. In this embodiment, invoking the Kubernetes API deletes Service named "test-d 1".
Step E05: and deleting the model online service cluster configuration information according to the cluster ID. In this embodiment, the model online service cluster configuration information with the cluster ID d1 is deleted.
Step F: the online service of the model is deleted according to the service name, and the specific operation is as follows:
step F01: and querying all cluster lists according to the service names.
Step F02: repeating the steps E01-E05, and deleting all clusters in sequence. In this embodiment, the Kubernetes API is called to delete the reployment named "test-d2", the ReplicaSet labeled "app=test-d 2", the Pod labeled "app=test-d 2", and the Service named "test-d2", and delete the model online Service cluster configuration information with cluster ID d 2.
Step F03: invoking the Kubernetes API deletes the name "service name" Ingress. In this embodiment, the Kubernetes API is called to delete the entry named "test".
Step F04: and deleting the model online service information according to the service name. In the present embodiment, the model online service information whose service name is test is deleted.
The invention provides the integrated release of the AI model service based on the Kubernetes, realizes the rapid smooth upgrading and capacity expansion, improves the utilization rate of hardware resources, realizes the AI model capacity sharing of a cross-dispatching mechanism and a business system, can obviously reduce the communication cost and the labor cost of business application to AI model management, effectively improves the management efficiency, and realizes the co-construction sharing of the application AI model result in the regulation and control system.
The invention also provides an AI model service sharing system facing the power grid regulation and control service, which mainly comprises an AI model warehouse, a model management module, a model online service deployment module, a service starting module and a model loading module.
The AI model repository is mainly used for storing AI models in the form of model sets, each model set storing AI models of the same type.
The model management module is mainly used for accessing the AI model in batches, updating the AI model and managing model set information and model set versions in an AI model warehouse.
The model management module comprises the following sub-modules:
module M101: the model set management submodule provides functions of adding, deleting, modifying and version control of the model set information.
Module M102: and the AI model batch access submodule is used for storing and acquiring the AI models in a batch lasting mode and generating characteristic values according to a verification algorithm.
Module M103: the AI model updating sub-module supports http requests and automatically and periodically updates the full model set to a specified version and updates any AI model of any version.
The model online service deployment module is mainly used for deploying the model online service of the AI model in the cluster system by taking the model set in the AI model warehouse as granularity, and the specific operation of the model online service deployment module is consistent with the step B of the method.
The model online service deployment module comprises the following sub-modules:
module M201: the Deployment creation submodule creates a Deployment. Yaml file according to the appointed model set and model set version, and sets the service name, the number of instances, the CPU, the GPU, the memory and other needed machine resources, and calls the Kubernetes API to create the Deployment.
Module M202: and a Service creation sub-module for creating a Service. Yaml file and calling a Kubernetes API to create Service.
Module M203: an Ingress creation sub-module creates an Ingress. Yaml file, and calls a Kubernetes API to create the Ingress.
Module M204: and the flow switching sub-module switches the blue-green cluster ID according to the requirement, and calls the Kubernetes API to modify the Ingress configuration information.
Module M205: the cluster state query submodule queries the states of all Pods in the cluster according to the cluster ID, and the common Pod states are shown in a table 2:
TABLE 2
Service state name | Service state description |
In the creation | ContainerCreating |
Operation | Running |
Stop of | Terminating |
Waiting for | Pending |
Failure of | Fail |
The service starting module is mainly used for storing the AI model in the AI model warehouse into the cluster system through the starting model online service, and the specific operation is consistent with the step C of the method.
The model loading module is mainly used for loading the AI model from the cluster system according to an external request, and the specific operation is consistent with the step D of the method.
The method and the system can obviously reduce the communication cost and the labor cost of the service application to the AI model management, effectively improve the model management efficiency and realize the co-establishment and sharing of the AI model application achievements in the regulation and control system.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and variations could be made by those skilled in the art without departing from the technical principles of the present invention, and such modifications and variations should also be regarded as being within the scope of the invention.
Claims (9)
1. An AI model service sharing method facing power grid regulation and control service is characterized by comprising the following steps:
acquiring an AI model warehouse, wherein the AI model warehouse comprises a plurality of model sets, and each model set stores a plurality of AI models of the same type;
model online service of an AI model is established in a cluster system by taking a model set in an AI model warehouse as granularity;
the AI model in the AI model warehouse is stored into a cluster system through starting model online service;
loading an AI model from the cluster system according to an external request;
the construction method of the AI model warehouse comprises the following steps:
acquiring a plurality of AI models through power grid regulation and control service training, and temporarily storing the acquired AI models in a memory block mode;
calculating the characteristic value of the memory block by using a checking algorithm, and marking the characteristic value as a first characteristic value;
the memory block and the first characteristic value are sent to file management service of the server together;
the file management service calculates the characteristic value of the memory block again by using a checking algorithm and marks the characteristic value as a second characteristic value;
and judging whether the first characteristic value is the same as the second characteristic value, if so, acquiring an AI model from the memory block, and storing the AI model into a model set corresponding to an AI model warehouse.
2. The AI model servitization sharing method for the power grid regulation and control service according to claim 1, wherein each model set in the AI model warehouse is configured with a unique model set ID, the same model set comprises one or more model set versions, and each model version is configured with a unique model set version ID; each AI model in the AI model repository is configured with a unique model UID.
3. The AI model servitization sharing method for the power grid regulation and control service according to claim 2, wherein a model set information table, a model set version information table and an AI model information table are arranged in an AI model warehouse and are all in a two-dimensional table form; the model set information table comprises a model set ID, a model set name, a model type and a model source; the model set version information table comprises a model set ID, a model set version ID and an update time; the AI model information table includes a model UID, a model set ID, a model set version ID, and an update time.
4. The AI model servitization sharing method for power grid regulation and control service according to claim 1 or 2, wherein the method for creating the model online service comprises the following steps:
acquiring a service name, an instance number, a CPU, a GPU and a memory;
setting the cluster label of the model online service as 'app=service name-cluster ID' according to the model set ID, the model set version ID and the service name;
calling a Kubernetes API to create a label of the Deployment, wherein the label of the Deployment is a cluster label;
creating ReplicaSet through reployment, and creating Pod with the number equal to the number of examples in a system background by using the ReplicaSet;
calling a Kubernetes API to create Service, and setting the selector of the Service to be consistent with the label of the Deployment;
invoking the Kubernetes API creates an entry and associates the entry with Service.
5. The method for sharing the AI model service oriented to the power grid regulation and control service according to claim 1, wherein the method for storing the AI model in the AI model warehouse into the cluster system by starting the model online service is as follows:
acquiring a corresponding model UID list from an AI model warehouse according to the model set ID and the model set version ID;
according to the model UID list, acquiring AI models in batches from an AI model warehouse through a file management service, and temporarily storing the acquired AI models in a memory block mode;
calculating the characteristic value of the memory block by using a checking algorithm, and marking the characteristic value as a first characteristic value;
the first characteristic value and the memory block are sent to a cluster system through file management service;
the cluster system calculates the characteristic value of the memory block again by using a checking algorithm and marks the characteristic value as a second characteristic value;
judging whether the first characteristic value is the same as the second characteristic value, if so, storing the memory block into a cluster system.
6. The AI model servitization sharing method for the power grid regulation service of claim 4, wherein in the cluster system, the blue-green cluster deployment upgrading of the model online service is performed by modifying the background configuration information of the Ingress object.
7. The AI model servitization sharing method for power grid regulation service according to claim 4, wherein in the cluster system, the Kubernetes API is called to modify replicas parameters of the reployment so as to increase and decrease the number of Pod; invoking the Kubernetes API modifies the requests and limits parameters of the deviyment, thereby modifying the CPU, GPU and memory of each Pod.
8. The method for sharing the AI model service oriented to the grid regulation service according to claim 4, wherein the method for loading the AI model from the cluster system according to the external request comprises the following steps:
obtaining an http request in a URL format outside the cluster through the Ingress, and carrying out rule matching on the received http request according to a preset rule list;
after the rule matching is successful, the Ingress forwards the http request to Service according to the Service name and port number;
the Service agents the http request to the Pod of the corresponding Deployment according to the selector;
the model online service analyzes the http request, and loads the AI model in the cluster system by using a corresponding model loading mode of each AI algorithm frame according to the analyzed model UID.
9. An AI model service sharing system for a power grid regulation service, comprising:
an AI model repository for storing AI models in the form of model sets, each model set storing AI models of the same type;
the model management module is used for accessing the AI model in batches, updating the AI model and managing model set information and model set versions in an AI model warehouse;
the model online service deployment module is used for deploying the model online service of the AI model in the cluster system by taking the model set in the AI model warehouse as granularity;
the service starting module is used for storing the AI model in the AI model warehouse into the cluster system through the starting model online service;
the model loading module loads an AI model from the cluster system according to an external request;
the construction method of the AI model warehouse comprises the following steps:
acquiring a plurality of AI models through power grid regulation and control service training, and temporarily storing the acquired AI models in a memory block mode;
calculating the characteristic value of the memory block by using a checking algorithm, and marking the characteristic value as a first characteristic value;
the memory block and the first characteristic value are sent to file management service of the server together;
the file management service calculates the characteristic value of the memory block again by using a checking algorithm and marks the characteristic value as a second characteristic value;
and judging whether the first characteristic value is the same as the second characteristic value, if so, acquiring an AI model from the memory block, and storing the AI model into a model set corresponding to an AI model warehouse.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111447806.1A CN114153525B (en) | 2021-11-30 | 2021-11-30 | AI model servitization sharing method and system for power grid regulation and control service |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111447806.1A CN114153525B (en) | 2021-11-30 | 2021-11-30 | AI model servitization sharing method and system for power grid regulation and control service |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114153525A CN114153525A (en) | 2022-03-08 |
CN114153525B true CN114153525B (en) | 2024-01-05 |
Family
ID=80455361
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111447806.1A Active CN114153525B (en) | 2021-11-30 | 2021-11-30 | AI model servitization sharing method and system for power grid regulation and control service |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114153525B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117675574B (en) * | 2022-12-07 | 2024-09-27 | 国电南瑞科技股份有限公司 | Remote batch upgrading method and system for equipment and distributed task scheduling method |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108764808A (en) * | 2018-03-29 | 2018-11-06 | 北京九章云极科技有限公司 | Data Analysis Services system and its on-time model dispositions method |
CN110413294A (en) * | 2019-08-06 | 2019-11-05 | 中国工商银行股份有限公司 | Service delivery system, method, apparatus and equipment |
CN110688539A (en) * | 2019-09-30 | 2020-01-14 | 北京九章云极科技有限公司 | Model management system and method |
CN111414233A (en) * | 2020-03-20 | 2020-07-14 | 京东数字科技控股有限公司 | Online model reasoning system |
CN111538563A (en) * | 2020-04-14 | 2020-08-14 | 北京宝兰德软件股份有限公司 | Event analysis method and device for Kubernetes |
CN112418438A (en) * | 2020-11-24 | 2021-02-26 | 国电南瑞科技股份有限公司 | Container-based machine learning procedural training task execution method and system |
CN112783646A (en) * | 2021-01-13 | 2021-05-11 | 中国工商银行股份有限公司 | Stateful application containerization deployment method and device |
CN113642948A (en) * | 2020-05-11 | 2021-11-12 | 腾讯科技(深圳)有限公司 | Model management method, device and storage medium |
-
2021
- 2021-11-30 CN CN202111447806.1A patent/CN114153525B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108764808A (en) * | 2018-03-29 | 2018-11-06 | 北京九章云极科技有限公司 | Data Analysis Services system and its on-time model dispositions method |
CN110413294A (en) * | 2019-08-06 | 2019-11-05 | 中国工商银行股份有限公司 | Service delivery system, method, apparatus and equipment |
CN110688539A (en) * | 2019-09-30 | 2020-01-14 | 北京九章云极科技有限公司 | Model management system and method |
CN111414233A (en) * | 2020-03-20 | 2020-07-14 | 京东数字科技控股有限公司 | Online model reasoning system |
CN111538563A (en) * | 2020-04-14 | 2020-08-14 | 北京宝兰德软件股份有限公司 | Event analysis method and device for Kubernetes |
CN113642948A (en) * | 2020-05-11 | 2021-11-12 | 腾讯科技(深圳)有限公司 | Model management method, device and storage medium |
CN112418438A (en) * | 2020-11-24 | 2021-02-26 | 国电南瑞科技股份有限公司 | Container-based machine learning procedural training task execution method and system |
CN112783646A (en) * | 2021-01-13 | 2021-05-11 | 中国工商银行股份有限公司 | Stateful application containerization deployment method and device |
Non-Patent Citations (1)
Title |
---|
基于Kubernetes的容器云平台设计与实现;胡晓亮;《中国优秀硕士学位论文全文数据库信息科技辑》(第2期);I139-198 * |
Also Published As
Publication number | Publication date |
---|---|
CN114153525A (en) | 2022-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10511506B2 (en) | Method and device for managing virtualized network function | |
US11979686B2 (en) | Method and system for software-defined camera and camera | |
CN110932912A (en) | Method for realizing unified management of configuration files under micro-service architecture | |
CN104158886A (en) | Flow-type performing method for applications | |
US20220413937A1 (en) | Node management method, device and apparatus, storage medium, and system | |
CN113765957B (en) | Model updating method and device | |
CN101876913A (en) | Software component management method and software component manager | |
CN113204368B (en) | Application processing method, server and storage medium | |
WO2009021412A1 (en) | A method, device and system for routing | |
WO2020124930A1 (en) | Method and apparatus for scheduling and processing resource | |
CN114153525B (en) | AI model servitization sharing method and system for power grid regulation and control service | |
CN113961346A (en) | Data cache management and scheduling method and device, electronic equipment and storage medium | |
CN114710549B (en) | Dynamic management method, system and service node for network card in container platform | |
CN115185679A (en) | Task processing method and device for artificial intelligence algorithm, server and storage medium | |
CN114020368A (en) | Information processing method and device based on state machine and storage medium | |
CN112199200B (en) | Resource scheduling method and device, computer equipment and storage medium | |
CN113037851A (en) | Method for achieving cloud mobile phone system overdivision based on storage | |
CN112905306A (en) | Multi-cluster container management method and device, electronic equipment and storage medium | |
CN114443059A (en) | Kubernets cluster deployment method, device and equipment | |
US20230289165A1 (en) | Data processing method and apparatus for application, device, and storage medium | |
CN104796465B (en) | Cloud platform method for processing business and system | |
CN111767126A (en) | System and method for distributed batch processing | |
CN111061723A (en) | Workflow implementation method and device | |
CN101989203A (en) | Software component management system | |
CN111767345B (en) | Modeling data synchronization method, modeling data synchronization device, computer equipment and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |