CN114968271A - Model deployment method and device, electronic equipment and storage medium - Google Patents

Model deployment method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114968271A
CN114968271A CN202210581276.8A CN202210581276A CN114968271A CN 114968271 A CN114968271 A CN 114968271A CN 202210581276 A CN202210581276 A CN 202210581276A CN 114968271 A CN114968271 A CN 114968271A
Authority
CN
China
Prior art keywords
service
file
model
model file
service code
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.)
Withdrawn
Application number
CN202210581276.8A
Other languages
Chinese (zh)
Inventor
刘阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jindi Technology Co Ltd
Original Assignee
Beijing Jindi Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Jindi Technology Co Ltd filed Critical Beijing Jindi Technology Co Ltd
Priority to CN202210581276.8A priority Critical patent/CN114968271A/en
Publication of CN114968271A publication Critical patent/CN114968271A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the disclosure provides a model deployment method, a model deployment device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a service code file corresponding to a first service from a service code library, and storing the service code file in a first storage environment corresponding to an operating environment of the first service; according to the service code file, acquiring a corresponding model file from a model file library, and storing the model file in a second storage environment corresponding to the running environment of the first service; acquiring configuration information, and configuring the operating environment of the first service according to the configuration information so as to enable the operating environment to be adapted to the first service after the model file is loaded; in response to a start instruction for starting the first service, the model file is loaded into a runtime environment of the first service.

Description

Model deployment method and device, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to the technical field of model deployment, and in particular, to a model deployment method and apparatus, an electronic device, and a storage medium.
Background
With the continuous development of technologies, technologies such as deep learning models are applied more and more widely. For example, because enterprise business has a complex scene, the enterprise realizes the intellectualization of the business by more utilizing technologies such as a deep learning model, and the like, thereby bringing lower labor cost, higher efficiency and stronger business capability to the enterprise. Due to the diversity of business services, the corresponding models are also diverse, and in order to ensure the reliability of use, the models need to be deployed accurately and reasonably.
Nowadays, models including but not limited to business services still depend on manual work of workers during deployment, deployment efficiency is low, and deployment of the models is prone to errors caused by various human factors.
Disclosure of Invention
In order to solve the above problem, embodiments of the present disclosure provide a model deployment method, apparatus, electronic device, and storage medium, so as to at least partially solve the above problem.
According to an aspect of the present disclosure, there is provided a model deployment method, the method including:
acquiring a service code file corresponding to a first service from a service code library, and storing the service code file in a first storage environment corresponding to an operating environment of the first service;
according to the service code file, acquiring a corresponding model file from a model file library, and storing the model file in a second storage environment corresponding to the running environment of the first service;
acquiring configuration information, and configuring the operating environment of the first service according to the configuration information so as to enable the operating environment to be adapted to the first service after the model file is loaded;
and loading the model file into the running environment of the first service in response to a starting instruction for starting the first service.
In some optional embodiments, the configuration information comprises: in a case where the model file is loaded to the runtime environment of the first service, software resource configuration information required when the first service is run, and hardware resource configuration information required when the first service is run.
In some optional embodiments, the obtaining the configuration information and configuring the operating environment of the first service according to the configuration information includes: acquiring a configuration file according to software resource configuration information and hardware resource configuration information in the configuration information; installing software relied on by the first service runtime in the runtime environment based on the configuration file, and/or configuring software resource parameters relied on by the first service runtime and configuring hardware resource parameters relied on by the first service runtime.
In some optional embodiments, the obtaining, according to the service code file, a model file corresponding to a model file library includes: determining file fingerprints of the model files according to the service code files, wherein the service code files correspond to the file fingerprints of one model file, and different service code files correspond to different file fingerprints; and acquiring the model file from the model file library according to the file fingerprint.
In some optional embodiments, the obtaining a service code file corresponding to the first service from the service code library includes: acquiring a service code file of the latest version corresponding to the first service from the service code library; the obtaining of the corresponding model file from the model file library according to the service code file includes: and acquiring the model file of the latest version from the model file library according to the service code file.
In some optional embodiments, the obtaining, according to the service code file, a corresponding model file from a model file library, where the method further includes: uploading the model file to the model file repository in response to an optimization signal optimizing the first service.
In some optional embodiments, the obtaining a service code file corresponding to a first service from a service code library and storing the service code file in a first storage environment corresponding to an execution environment of the first service includes: and responding to the model file with the new version in the model file library, acquiring a service code file corresponding to the first service from a service code library, and storing the service code file in a first storage environment corresponding to the running environment of the first service.
In some optional embodiments, the model file is constructed by: acquiring a plurality of sample data, wherein the sample data comprises enterprise business data input by the first service in the historical operation process; performing word segmentation processing on the sample data to obtain at least one word segmentation; respectively carrying out vector conversion on each participle to obtain a word vector corresponding to each participle; obtaining training data comprising the word vector and sample labeling information, wherein the sample labeling information indicates a corresponding relationship between enterprise business data corresponding to the word vector and an output result after the first service is operated; and training a model to be trained through the training data to obtain a business model, and packaging the business model to obtain the model file.
According to another aspect of the embodiments of the present disclosure, there is provided a model deployment apparatus including:
the first acquisition module is used for acquiring a service code file corresponding to a first service from a service code library and storing the service code file in a first storage environment corresponding to the running environment of the first service;
the second acquisition module is used for acquiring a corresponding model file from a model file library according to the service code file and storing the model file in a second storage environment corresponding to the running environment of the first service;
the configuration module is used for acquiring configuration information and configuring the operating environment of the first service according to the configuration information so as to enable the operating environment to be adapted to the first service after the model file is loaded;
and the loading module is used for responding to a starting instruction for starting the first service and loading the model file into the running environment of the first service.
According to still another aspect of the embodiments of the present disclosure, there is provided an electronic device including: the electronic device includes a memory for storing a computer-executable program thereon and a processor for running the computer-executable program to implement the model deployment method of any of the preceding claims.
According to yet another aspect of the embodiments of the present disclosure, a computer storage medium is provided, wherein the computer storage medium stores computer instructions for causing a computer to execute the model deployment method according to any one of the preceding claims.
According to a further aspect of embodiments of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the model deployment method of any of the preceding claims.
In summary, in the model deployment scheme in the embodiment of the present disclosure, since the service code file corresponding to the first service can be obtained from the service code library, the service code file is stored in the first storage environment corresponding to the operating environment of the first service, the model file is obtained from the model file library according to the service code file, the model file is stored in the second storage environment corresponding to the operating environment of the first service, the configuration information is obtained, the operating environment of the first service is configured according to the configuration information, so that the operating environment is adapted to the first service after the model file is loaded in operation, and finally the model file is loaded into the operating environment of the first service in response to the start instruction for starting the first service, the model deployment scheme in the embodiment of the present disclosure does not need to be performed manually when performing model deployment, therefore, the model deployment efficiency can be ensured, the problem of model deployment error caused by various human factors is solved, the manual maintenance cost is reduced, and accurate and reasonable deployment is realized for models of different services.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 illustrates a flow chart of an exemplary model deployment method in accordance with the present disclosure.
FIG. 2 illustrates a flow chart of a method of building a model file according to one example of the present disclosure.
FIG. 3 illustrates a block diagram of an exemplary model deployment apparatus in accordance with the present disclosure.
Fig. 4 illustrates a block diagram of an exemplary electronic device in accordance with the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, but not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present disclosure should fall within the scope of protection of the embodiments in the present disclosure.
With the continuous development of technologies, technologies such as deep learning models are applied more and more widely. For example, because enterprise business has a complex scene, the enterprise realizes the intellectualization of the business by more utilizing technologies such as a deep learning model, and the like, thereby bringing lower labor cost, higher efficiency and stronger business capability to the enterprise. Due to the diversity of business services, the corresponding models are also diverse, and in order to ensure the reliability of use, the models need to be deployed accurately and reasonably. Nowadays, models including but not limited to business services still depend on manual work of workers during deployment, deployment efficiency is low, and deployment of the models is prone to errors caused by various human factors.
In view of this, the embodiments of the present disclosure provide a model deployment method, which may be executed by a model deployment apparatus, where the model deployment apparatus may be a computer device, a server, or the like capable of performing data processing, and is not limited herein.
Referring to the flowchart shown in fig. 1, the model deployment method includes the following steps S101, S102, S103, and S104, specifically:
step S101: and acquiring a service code file corresponding to the first service from the service code library, and storing the service code file in a first storage environment corresponding to the running environment of the first service.
In this embodiment, the first service may be a business service, and the function of the first service is not limited in this application, for example, as some examples, the function of the first service may be to determine an industry where a certain enterprise is located according to part of business data of the certain enterprise, or may also be to determine a competitor of the certain enterprise according to part of business data of the certain enterprise, and the like. For the convenience of describing the embodiment, the first service function is used as an example to determine the industry of an enterprise according to part of business data of the enterprise, but it should be understood that the first service function is not used as any limitation to the present application.
The service code library may be a database, and may be used to store code files corresponding to different business services. For each different business service, there may exist a plurality of different versions of service code files (e.g., V1, V2, etc.), and the service code files are updated continuously to generate different versions, and the plurality of versions of service code files are stored in the service code library. In this embodiment, the service code file corresponding to the first service code is stored in the service code library and can be obtained therefrom according to the requirement.
Illustratively, the service code file of the first service pair may be obtained from a service code library according to the service identification of the first service.
The first storage environment can be a service address which is specially used for storing the service code file when the first service is operated, the service code file of the first service is obtained from the service code library and stored in the service address, and the service code file is convenient to call when the first service is subsequently started and operated.
In some optional implementations, the "acquiring the service code file corresponding to the first service from the service code library" in step S101 may be acquiring a latest version of the service code file corresponding to the first service from the service code library.
In practice, the latest version of the service code file can best meet the requirements of the current business, so that the acquisition of the latest version of the service code file corresponding to the first service can be more convenient to meet the requirements of the current business.
Step S102: and acquiring a corresponding model file from the model file library according to the service code file, and storing the model file in a second storage environment corresponding to the running environment of the first service.
In this application, the model file library may be a database, and may be used to store model files of business models corresponding to different business services. For each different business service, there may exist a plurality of different versions of model files (e.g., version T1, version T2, etc.), and the model files are updated continuously to generate different versions, and the plurality of versions of model files are stored in the model file library. In this embodiment, the model file corresponding to the first service is stored in the model file library and can be obtained from the model file library as needed.
The second storage environment can be a storage address which is specially used for storing the model file when the first service is operated, the model file is obtained from the model file library and stored in the storage address, and the model file is convenient to call when the first service is subsequently started and operated.
In some alternative implementations, the step S102 of "obtaining the corresponding model file from the model file library according to the service code file" may be that the latest version of the model file is obtained from the model file library according to the service code file.
Similar to the service code file, in practice, the model file of the latest version can best meet the requirement of the current service, so that the embodiment can more conveniently meet the requirement of the current service by acquiring the model file of the latest version.
In this embodiment, the model file may be obtained from the model file library by using some features of the service code file of the first service, which have a corresponding relationship with the model file. For example, in some implementations, the identifier may be an identifier of a service code file, and the identifier may be in a corresponding relationship with some features of the model file, and the application is not particularly limited herein.
In some optional implementations, the "obtaining the corresponding model file from the model file library according to the service code file" in step S102 includes: determining file fingerprints of the model files according to the service code files, wherein the service code files correspond to the file fingerprints of one model file, and different service code files correspond to different file fingerprints; and obtaining the model file from the model file library according to the file fingerprint.
In the application, the file fingerprint is used as an important characteristic of the model file and can uniquely and certainly indicate the model file, so that the application establishes a one-to-one corresponding relationship between the service code file and the file fingerprint of the model file, then determines the file fingerprint of the model file according to the service code file by using the corresponding relationship, and then acquires the model file from the specified position of the model file library according to the file fingerprint, thereby ensuring the correctness of acquiring the model file from the model library.
For example, if the latest version of the service code file (e.g., the service code file of the V2 version) and the latest version of the model file (e.g., the model file of the T2 version) correspond to the file fingerprint of the model file of the T2 version and the file fingerprint of the model file of the T2 version, the file fingerprint of the model file of the T2 version is determined according to the service code file of the V2 version, the model file of the T2 version is obtained from the model file library according to the file fingerprint, and the model file of the T2 version is stored in the second storage path, so that the model file is convenient to be called when the first service is subsequently started and run.
In some optional implementations, the "obtaining a corresponding model file from a model file library according to the service code file" in step S102, where the previous model deployment method further includes: the model file is uploaded to a model file repository in response to an optimization signal optimizing the first service.
When the optimization signal for optimizing the first service is obtained, the corresponding model file is uploaded to the model file library, so that the first service is optimized without lacking the required model file, and the model file is conveniently deployed to better operate the first service in the follow-up process.
Alternatively, the model files may be stored in other storage units for storing the model files, such as in another database, before being uploaded to the model file library.
Optionally, the optimization signal may be sent manually by a worker, that is, the model file may be uploaded to the model file library in response to the optimization signal sent manually by the worker to optimize the first service.
In this embodiment, the model file may be trained in advance and constructed. Referring to the flowchart in fig. 2, in some possible implementations, the model file is built by the following steps S21, S22, S23, S24, S25, specifically:
step S21: the method comprises the steps of obtaining a plurality of sample data, wherein the sample data comprises enterprise business data input by a first service in the historical operation process.
Specifically, the plurality of sample data may be enterprise business data which is obtained and input from the internet through crawler software historically, or enterprise business data which is input by a worker according to actual conditions of an enterprise, and in the historical operation process of the first service, the function of the first service is completed through the enterprise business data, so that a corresponding output result is obtained.
The enterprise business data may include, for example, at least one of enterprise name data, enterprise profile data, enterprise product data, enterprise location data, enterprise competitor name data, enterprise auction data, business information for the enterprise, and the like.
For the convenience of describing the embodiment, the first service is exemplified by determining the industry of a certain company according to part of enterprise data of the certain company, and the deployed model file can be used to accurately determine the industry of the certain company when the first service is operated. For example, an example of sample data may be "business name: beijing XXXXXX real estate agency, Inc.; enterprise products: a house rental service; enterprise location: XXXX; name of the enterprise competitor: shenzhen XX House agency, Inc. ". It will be appreciated that in an actual scenario it may be more complex, as just a simple example, and not as a limitation on the present application.
Step S22: and performing word segmentation processing on the sample data to obtain at least one word segmentation.
Because in the context of Chinese, a single word often has difficulty in having actual semantics, in the embodiment, a sentence or a longer word can be segmented into words according to a certain rule, so as to more conveniently analyze and process the semantics.
In the sample data example above, "enterprise product: the house leasing service carries out word segmentation processing, and then words such as enterprises, products, houses, leasing and services can be segmented according to certain rules.
In this embodiment, any suitable word segmentation processing method in the related art may be adopted in the case of meeting the requirement, and is not limited herein. Illustratively, a JIEBA participle processing algorithm may be utilized, for example.
Step S23: and respectively carrying out vector conversion on each participle to obtain a word vector corresponding to each participle.
After at least one segmented word is obtained in the present embodiment, it may be converted into a word vector. For example, the word "product" in the above example is converted to a ═ a1, a2, a3, a4], the word "house" in the above example is converted to b ═ b1, b2, b3, b4], the word "lease" in the above example is converted to c ═ c1, c2, c3, c4], where a1, a2, a3, a4, b1, b2, b3, b4, c1, c2, c3, c4 are constants, and other words may be analogized.
The word vectors are obtained by carrying out vector conversion on the word segments, so that subsequent labeling in the steps is facilitated, and the feature relation and the vector distribution in the model learning sample data are provided during subsequent model training, so that the model training is facilitated to be carried out correctly.
In this embodiment, any suitable word vector conversion method in the related art may be adopted in the case of meeting the requirement, which is not limited herein. Illustratively, a WORD2VEC processing algorithm may be utilized, for example.
Step S24: and acquiring training data comprising word vectors and sample labeling information, wherein the sample labeling information indicates the corresponding relation between the enterprise business data corresponding to the word vectors and the output result after the first service is operated.
The model file in this embodiment may be, for example, a supervised model, the training data may be a word vector carrying sample labeling information, and the sample labeling information may indicate a correspondence between enterprise business data corresponding to the word vector and an output result after the first service is run.
The process of labeling the word vector using the sample labeling information may be manually labeled by a worker, or may be automatically labeled using a specific rule (for example, automatically labeled using another labeling model), which is not limited in this respect.
Step S25: and training the model to be trained through the training data to obtain a business model, and packaging the business model to obtain a model file.
Specifically, the model to be trained may be based on a formed model frame, which may be selected as required, and may be, for example: TensorFlow, Theano, PyTorch, Torch, Caffe, SciKit-lean, etc., which are not limited in the examples of the present disclosure. In addition, the specific information of the optional model framework may refer to related technologies, and is not described herein again.
The business model is a model that is trained by training data and is finally trained, and the model training can be ended when a loss value output by a loss function (which may be a conventional loss function, such as a linear function, a cosine similarity function, and the like) of the business model is within a preset loss value range. Or, it may be determined that the training iteration number satisfies the ending condition when the training iteration number reaches a preset value during training, so as to end the model training process.
In the business model, the input is enterprise business data, the output is an output result of running the first service, a model file is obtained after the trained business model is packaged, the model file is deployed in a running environment of the first service, and a corresponding result can be obtained through the model file when the first service is run.
Still by way of example, if at the first service run where its corresponding model file is deployed, assume the input "business name is Nanjing XXXX real estate agent, Inc.; the enterprise product is a house rental service; the business location is XXXX; name of the enterprise competitor: beijing XX house brokerage, Inc., the first service may be run to achieve the function of the first service by obtaining a result based on the model file, where the industry is the house agency industry. It should be understood that in an actual scenario, it may be more complex, and is only used as a simple example, and not as any limitation to the embodiment.
Therefore, in the embodiment, the model file corresponding to the first service is obtained in such a manner, so that after the model file is deployed, when the first service is operated, a correct result is obtained based on the model file to complete the function of the first service.
Step S103: and acquiring configuration information, and configuring the operating environment of the first service according to the configuration information so as to enable the operating environment to be adapted to the first service after the model file is loaded.
In this embodiment, the configuration information of the first service may include software and hardware resource data required for running the first service. For example, in some alternative embodiments, the configuration information includes: in the case where the model file is loaded to the runtime environment of the first service, software resource configuration information required when the first service is run, and hardware resource configuration information required when the first service is run.
In this embodiment, the operating environment of the first service is configured according to the configuration information, so that the operating environment is adapted to the operation of the model file, the model file can normally operate when being loaded in a subsequent deployment process, and the problem that deployment fails or normal operation is difficult to operate due to data loss of software and hardware resources is prevented.
In some optional implementations, the step S103 may include: acquiring a configuration file according to software resource configuration information and hardware resource configuration information in the configuration information; and installing software depended by the first service runtime in the running environment based on the configuration file, and/or configuring software resource parameters depended by the first service runtime and configuring hardware resource parameters depended by the first service runtime.
Specifically, the configuration file may be pre-established according to various software resource configuration information and hardware resource configuration information and stored in a storage unit (e.g., a database) so as to be obtained when needed.
After the configuration file is obtained, the running environment resource dependency can be configured based on the configuration file, that is, corresponding software can be automatically installed in the running environment, for example, the running of the first service depends on the B version of the a software, and the B version of the a software can be installed in the running environment of the first service, so that the problem that the first service calls a model file to run when running, and the running cannot be caused due to insufficient software programs is avoided; and/or automatically configuring software resource parameters depended by the first service runtime based on the configuration file, for example, assigning appropriate parameter values to software interfaces of the first service, and the like, so that the first service runtime calls the model file to run without the problem that the first service runtime cannot run due to software parameter errors; and the hardware resource parameters that the first service depends on when running can be configured, for example, the size of a memory resource and the size of a processor resource (for example, a CPU resource) that are suitable for the running of the first service are allocated, so that the problem that the model file is called when the first service runs and the running cannot be performed due to a hardware resource error does not occur, and thus the running environment is effectively adapted to the running of the model file, and the model deployment is more reasonable.
Optionally, after the configuration of the operating environment of the first service is finished according to the configuration information, a check process may be performed to determine whether the corresponding software and hardware resource configuration is ready, if so, finish the configuration of the operating environment, and if not, wait until the configuration of the operating environment is finished after being ready.
Step S104: in response to a start instruction for starting the first service, the model file is loaded into a runtime environment of the first service.
In this embodiment, the start instruction may be automatically issued by the model deployment apparatus or manually issued by a worker, which is not limited herein. And loading the model file into the running environment of the first service to complete the deployment process of the model.
In the model deployment method in the embodiment of the disclosure, since the service code file corresponding to the first service can be obtained from the service code library, the service code file is stored in the first storage path, the model file is obtained from the model file library according to the service code file, the model file is stored in the second storage path, the configuration information of the first service is obtained, the operating environment of the first service is configured according to the configuration information, so that the operating environment is adapted to the operation of the model file, and finally the model file is loaded into the operating environment of the first service in response to the start instruction for starting the first service, the model deployment scheme in the embodiment of the disclosure does not need to be performed manually when performing model deployment, thereby ensuring the model deployment efficiency, reducing the manual maintenance cost, and improving the problem of error in model deployment caused by various human factors, models for different services are accurately and reasonably deployed.
In some possible implementations, the step S101 (i.e., "obtaining a service code file corresponding to a first service from a service code library and storing the service code file in a first storage environment corresponding to an execution environment of the first service"), includes: and responding to the new version of the model file, acquiring a service code file corresponding to the first service from a service code library, and storing the service code file in a first storage environment corresponding to the running environment of the first service.
Based on this, in this embodiment, the model deployment method process may be automatically triggered after a new version of the model file appears in the model file library, so as to obtain the service code file of the first service, and obtain the new version of the model file according to the service code file, so as to facilitate deployment based on the new version of the model file, thereby facilitating to ensure that the first service operates better, and better adapt to the needs of the current service, thereby always keeping the first service operating normally.
In some optional implementations, S101 to S104 of the model deployment method in this embodiment may be performed automatically based on a pre-established automated deployment script. For example, the method may be implemented by acquiring the pre-established automation deployment script in response to a new version of the model file appearing in the model file library, and automatically implementing steps S101 to S104 based on the automation deployment script. The automatic deployment script can be a Shell script and can effectively ensure the reliability and rapidity of automatic operation as a mature automatic script technology. That is, the Shell script (i.e., the automated deployment script) may automatically implement that a service code file corresponding to a first service is obtained from a service code library, the service code file is stored in a first storage path, a model file is obtained from a model file library according to the service code file, the model file is stored in a second storage path, configuration information of the first service is obtained, an operating environment of the first service is configured according to the configuration information, so that the operating environment is adapted to the operation of the model file, and the model file is loaded into the operating environment of the first service in response to a start instruction for starting the first service, so that the automated deployment of the model and the first service is successful. Of course, the Shell script (i.e., the automated deployment script) can also automatically identify updates to the service code file and model file, automatically configure runtime environment resource dependencies for the first service runtime, and so forth.
It is understood that the above experimental examples are only examples of some of the embodiments of the present disclosure, and do not limit any model deployment scheme in the embodiments of the present disclosure.
From the above, it can be seen that, in the model deployment scheme in the embodiment of the present disclosure, since the service code file corresponding to the first service can be obtained from the service code library, the service code file is stored in the first storage environment corresponding to the operating environment of the first service, the model file is obtained from the model file library according to the service code file, the model file is stored in the second storage environment corresponding to the operating environment of the first service, the configuration information is obtained, the operating environment of the first service is configured according to the configuration information, so that the operating environment is adapted to the first service after the model file is loaded, and finally the model file is loaded into the operating environment of the first service in response to the start instruction for starting the first service, the model deployment scheme in the embodiment of the present disclosure does not need to be performed manually when performing model deployment, therefore, the model deployment efficiency can be ensured, the problem of model deployment error caused by various human factors is solved, the manual maintenance cost is reduced, and accurate and reasonable deployment is realized for models of different services.
Through the practical application of the scheme, compared with the traditional scheme, the model deployment scheme of the embodiment can improve the deployment efficiency by more than 80% through manual deployment, the accuracy rate is obviously higher than that of the traditional scheme, and the model deployment scheme has a good application effect in practice.
Based on the same inventive concept as the model deployment method, according to another aspect in the implementation of the present disclosure, referring to the block diagram of fig. 3, there is provided a model deployment apparatus 300, comprising:
a first obtaining module 301, configured to obtain a service code file corresponding to a first service from a service code library, and store the service code file in a first storage environment corresponding to an operating environment of the first service;
a second obtaining module 302, configured to obtain a corresponding model file from a model file library according to the service code file, and store the model file in a second storage environment corresponding to the operating environment of the first service;
a configuration module 303, configured to obtain configuration information, and configure an operating environment of the first service according to the configuration information, so that the operating environment is adapted to run the first service after the model file is loaded;
a loading module 304, configured to load the model file into an execution environment of the first service in response to a start instruction for starting the first service.
In some optional embodiments, the configuration information comprises: software resource configuration information required by the first service runtime, and hardware resource configuration information required by the first service runtime.
In some optional embodiments, the configuration module 303 is specifically configured to: acquiring a configuration file according to the software resource configuration information and the hardware resource configuration information in the configuration information; installing software relied on by the first service runtime in the runtime environment based on the configuration file, and/or configuring software resource parameters relied on by the first service runtime and configuring hardware resource parameters relied on by the first service runtime.
In some optional embodiments, the second obtaining module 302 is specifically configured to: determining file fingerprints of the model files according to the service code files, wherein the service code files correspond to the file fingerprints of one model file, and different service code files correspond to different file fingerprints; and acquiring the model file from the model file library according to the file fingerprint.
In some optional embodiments, the first obtaining module 301 is specifically configured to: acquiring a service code file of the latest version corresponding to the first service from the second service code library; the second obtaining module 302 is specifically configured to: and acquiring the model file of the latest version from the model file library according to the service code file.
In some optional embodiments, the model deployment apparatus 300 further comprises an upload module configured to: uploading the model file to the model file repository in response to an optimization signal optimizing the first service.
In some optional embodiments, the first obtaining module 301 is specifically configured to: and responding to the model file with the new version in the model file library, acquiring a service code file corresponding to the first service from a service code library, and storing the service code file in a first storage environment corresponding to the running environment of the first service.
In some optional embodiments, the model file is constructed by: acquiring a plurality of sample data, wherein the sample data comprises enterprise business data input by the first service in the historical operation process; performing word segmentation processing on the sample data to obtain at least one word segmentation; respectively carrying out vector conversion on each participle to obtain a word vector corresponding to each participle; obtaining training data comprising the word vector and sample labeling information, wherein the sample labeling information indicates a corresponding relationship between enterprise business data corresponding to the word vector and an output result after the first service is operated; and training a model to be trained through the training data to obtain a business model, and packaging the business model to obtain the model file.
The model deployment apparatus 300 in the embodiment of the present disclosure corresponds to the model deployment method in the foregoing embodiment, that is, the relevant content of the model deployment apparatus 300 can be understood with reference to the model deployment method mentioned above, and is not described herein again.
In the model deployment apparatus 300 in the embodiment of the present disclosure, since the first obtaining module 301 can obtain the service code file corresponding to the first service from the service code library, and store the service code file in the first storage environment corresponding to the operating environment of the first service, the second obtaining module 302 obtains the model file from the model file library according to the service code file, and stores the model file in the second storage environment corresponding to the operating environment of the first service, the configuration module 303 can obtain the configuration information, and configure the operating environment of the first service according to the configuration information, so that the operating environment is adapted to the first service after the model file is loaded, and the last loading module 304 can load the model file into the operating environment of the first service in response to the start instruction for starting the first service, the model deployment scheme in the embodiment of the present disclosure does not need to be performed manually when performing model deployment, therefore, the model deployment efficiency can be ensured, the manual maintenance cost is reduced, the problem that the model deployment is wrong due to various human factors is solved, and the model deployment is accurately and reasonably realized aiming at different services.
According to yet another aspect of the disclosed embodiments, referring to the block diagram in fig. 4, an electronic device 400 is provided by the disclosed embodiments. As shown in fig. 4, the electronic device 400 includes a memory 401 and a processor 402, the memory 401 is used for storing a computer executable program, and the processor 402 is used for running the computer executable program to implement the model deployment method of any one of the above embodiments.
According to yet another aspect of the embodiments of the present disclosure, a computer storage medium is provided, wherein the computer storage medium stores computer instructions for causing a computer to execute the model deployment method according to any one of the preceding claims.
According to a further aspect of embodiments of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the model deployment method of any of the preceding claims.
As for the embodiments of the model deployment apparatus, the electronic device, the computer storage medium, and the computer program product, since they are substantially similar to the embodiments of the model deployment method, the description is simple, and for the relevant points, reference may be made to the partial description of the embodiments of the model deployment method, which is not described herein again.
It is understood that the above embodiments are only experimental examples of some examples in the embodiments of the present disclosure, and do not limit any of the model deployment method, apparatus, electronic device, computer storage medium, and computer program product in the embodiments of the present disclosure.
It is to be understood that the term "includes" and variations thereof as used herein is intended to be open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description. It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present disclosure, and not for limiting the same; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.

Claims (12)

1. A model deployment method, comprising:
acquiring a service code file corresponding to a first service from a service code library, and storing the service code file in a first storage environment corresponding to an operating environment of the first service;
acquiring a corresponding model file from a model file library according to the service code file, and storing the model file in a second storage environment corresponding to the running environment of the first service;
acquiring configuration information, and configuring the operating environment of the first service according to the configuration information so as to enable the operating environment to be adapted to the first service after the model file is loaded;
and loading the model file into the running environment of the first service in response to a starting instruction for starting the first service.
2. The method of claim 1, wherein the configuration information comprises: in a case where the model file is loaded to the runtime environment of the first service, software resource configuration information required when the first service is run, and hardware resource configuration information required when the first service is run.
3. The method of claim 2, wherein the obtaining configuration information and configuring the runtime environment of the first service according to the configuration information comprises:
acquiring a configuration file according to the software resource configuration information and the hardware resource configuration information in the configuration information;
installing software relied on by the first service runtime in the runtime environment based on the configuration file, and/or configuring software resource parameters relied on by the first service runtime and configuring hardware resource parameters relied on by the first service runtime.
4. The method of claim 1, wherein the retrieving a corresponding model file from a library of model files according to the service code file comprises:
determining file fingerprints of the model files according to the service code files, wherein the service code files correspond to the file fingerprints of one model file, and different service code files correspond to different file fingerprints;
and acquiring the model file from the model file library according to the file fingerprint.
5. The method of claim 1, wherein the obtaining a service code file corresponding to the first service from a service code library comprises: acquiring a service code file of the latest version corresponding to the first service from the service code library;
the obtaining of the corresponding model file from the model file library according to the service code file includes: and acquiring the model file of the latest version from the model file library according to the service code file.
6. The method of claim 1, wherein the corresponding model file is obtained from a model file library according to the service code file, and the method further comprises:
uploading the model file to the model file repository in response to an optimization signal optimizing the first service.
7. The method of claim 1, wherein the obtaining a service code file corresponding to a first service from a service code library and storing the service code file in a first storage environment corresponding to an execution environment of the first service comprises:
and responding to the model file with the new version in the model file library, acquiring a service code file corresponding to the first service from a service code library, and storing the service code file in a first storage environment corresponding to the running environment of the first service.
8. The method of claim 1, wherein the model file is constructed by:
acquiring a plurality of sample data, wherein the sample data comprises enterprise business data input by the first service in the historical operation process;
performing word segmentation processing on the sample data to obtain at least one word segmentation;
respectively carrying out vector conversion on each participle to obtain a word vector corresponding to each participle;
obtaining training data comprising the word vector and sample labeling information, wherein the sample labeling information indicates a corresponding relationship between enterprise business data corresponding to the word vector and an output result after the first service is operated;
and training a model to be trained through the training data to obtain a business model, and packaging the business model to obtain the model file.
9. A model deployment apparatus comprising:
the system comprises a first acquisition module, a first storage module and a second acquisition module, wherein the first acquisition module is used for acquiring a service code file corresponding to a first service from a service code library and storing the service code file in a first storage environment corresponding to an operating environment of the first service;
the second acquisition module is used for acquiring a corresponding model file from a model file library according to the service code file and storing the model file in a second storage environment corresponding to the running environment of the first service;
the configuration module is used for acquiring configuration information and configuring the operating environment of the first service according to the configuration information so as to enable the operating environment to be adapted to the first service after the model file is loaded;
and the loading module is used for responding to a starting instruction for starting the first service and loading the model file into the running environment of the first service.
10. An electronic device, comprising a memory for storing a computer-executable program and a processor for executing the computer-executable program to implement the model deployment method of any one of claims 1-8.
11. A computer storage medium having stored thereon computer instructions for causing a computer to perform the model deployment method of any one of claims 1-8.
12. A computer program product, comprising a computer program, wherein the computer program realizes the model deployment method of any one of claims 1-8 when executed by a processor.
CN202210581276.8A 2022-05-26 2022-05-26 Model deployment method and device, electronic equipment and storage medium Withdrawn CN114968271A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210581276.8A CN114968271A (en) 2022-05-26 2022-05-26 Model deployment method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210581276.8A CN114968271A (en) 2022-05-26 2022-05-26 Model deployment method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114968271A true CN114968271A (en) 2022-08-30

Family

ID=82955627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210581276.8A Withdrawn CN114968271A (en) 2022-05-26 2022-05-26 Model deployment method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114968271A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118642720A (en) * 2024-08-09 2024-09-13 蒲惠智造科技股份有限公司 Automatic deployment method and system for platform software

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413294A (en) * 2019-08-06 2019-11-05 中国工商银行股份有限公司 Service delivery system, method, apparatus and equipment
CN111949514A (en) * 2020-07-13 2020-11-17 深圳地平线机器人科技有限公司 Model prediction method, device and storage medium
US20210019605A1 (en) * 2018-03-29 2021-01-21 The Regents Of The University Of California Digital watermarking of machine learning models
CN112329945A (en) * 2020-11-24 2021-02-05 广州市网星信息技术有限公司 Model deployment and reasoning method and device
CN113220308A (en) * 2021-06-11 2021-08-06 上海肇观电子科技有限公司 Method, electronic device, and storage medium for deploying and providing service
CN114239750A (en) * 2021-12-24 2022-03-25 中国建设银行股份有限公司 Alarm data processing method, device, storage medium and equipment
CN114265690A (en) * 2021-12-16 2022-04-01 阿里巴巴(中国)有限公司 Method and device for realizing remote training

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210019605A1 (en) * 2018-03-29 2021-01-21 The Regents Of The University Of California Digital watermarking of machine learning models
CN110413294A (en) * 2019-08-06 2019-11-05 中国工商银行股份有限公司 Service delivery system, method, apparatus and equipment
CN111949514A (en) * 2020-07-13 2020-11-17 深圳地平线机器人科技有限公司 Model prediction method, device and storage medium
CN112329945A (en) * 2020-11-24 2021-02-05 广州市网星信息技术有限公司 Model deployment and reasoning method and device
CN113220308A (en) * 2021-06-11 2021-08-06 上海肇观电子科技有限公司 Method, electronic device, and storage medium for deploying and providing service
CN114265690A (en) * 2021-12-16 2022-04-01 阿里巴巴(中国)有限公司 Method and device for realizing remote training
CN114239750A (en) * 2021-12-24 2022-03-25 中国建设银行股份有限公司 Alarm data processing method, device, storage medium and equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118642720A (en) * 2024-08-09 2024-09-13 蒲惠智造科技股份有限公司 Automatic deployment method and system for platform software

Similar Documents

Publication Publication Date Title
US20090183145A1 (en) Techniques for reducing down time in updating applications with metadata
CN111416821A (en) Internet of things equipment information acquisition method, system and device
CN108804215B (en) Task processing method and device and electronic equipment
CN110727575B (en) Information processing method, system, device and storage medium
CN111651352B (en) Warehouse code merging method and device
CN110673936A (en) Breakpoint continuous operation method and device for arranging service, storage medium and electronic equipment
CN110688305A (en) Test environment synchronization method, device, medium and electronic equipment
CN114968271A (en) Model deployment method and device, electronic equipment and storage medium
CN110716804A (en) Method and device for automatically deleting useless resources, storage medium and electronic equipment
CN116088846A (en) Processing method, related device and equipment for continuous integrated code format
CN111506393B (en) ARM-based virtualization device and use method thereof
CN113127357A (en) Unit testing method, device, equipment, storage medium and program product
CN112367205B (en) Processing method and scheduling system for HTTP scheduling request
CN114968823A (en) Automatic testing method, device, equipment and storage medium
CN111160583B (en) Data processing method and device
US11860769B1 (en) Automatic test maintenance leveraging machine learning algorithms
CN114003250A (en) Software deployment method and device
CN113240088A (en) Training method of text intention recognition model
CN117112498B (en) Application migration method, device, electronic equipment and storage medium
CN113986305B (en) B/S model upgrade detection method, device, equipment and storage medium
CN112907221B (en) Self-service method, device and system
CN113553097B (en) Model version management method and device
CN117251250B (en) Container management method based on cloud native platform and related equipment
CN112596887B (en) Analysis method for batch delay and related device
CN116185445A (en) Automatic deployment method and device based on pipeline

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20220830

WW01 Invention patent application withdrawn after publication