Model multi-terminal deployment method, system and device and electronic equipment

By receiving the target model file sent by the compiled module and determining the transmission method based on the device information, sending it to the target device in parallel, the problem of low model deployment efficiency is solved and efficient model deployment is achieved.

CN119847538APending Publication Date: 2025-04-18CHINA AUTOMOTIVE INNOVATION CORP
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411822420.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In the field of artificial intelligence, when the model is deployed to different device ends, multiple deployment operations are required for each device end, resulting in low deployment efficiency.

Method used

By receiving the target model file sent by the compilation module, the file contains the target model and the target script. The file transfer method is determined based on the device information of each target device, and the target model file is sent to the target device in parallel. After receiving the target device, the target device parses and deploys and runs the target model through the target script.

Benefits of technology

This improves the efficiency of model deployment, so that the target device can directly run the target script compiled by the compilation module, thereby running the target model according to the target script.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847538A_ABST
    Figure CN119847538A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-terminal deployment method, system and device of a model and electronic equipment. The method comprises the steps that a target model file sent by a compiling module is received, the target model file comprises a target model and a target script, and the target script is used for running the target model; target devices needing to deploy the target model are determined, M target devices are obtained, a file transmission mode is determined according to the device information of all the target devices, and M is a positive integer; the target model file is sent to M target devices according to the file transmission mode, after the M target devices receive the target model file, the target model file is analyzed, a target model and a target script are obtained, and the target model is deployed and operated through the target script. Through the method and the device, the problem of relatively low efficiency of performing model deployment on each equipment end in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and more specifically, to a multi-terminal deployment method, system, device, and electronic device for a model. Background Art

[0002] In the field of artificial intelligence, the models generated by algorithm training need to be deployed to different terminals for use after compilation, such as vehicle terminals, mobile terminals, cloud terminals, and even edge devices. In actual applications, the deployment environment is often diverse, including different operating systems, hardware platforms, network conditions, etc. In addition, different deployment terminals may have specific security, performance, compatibility, and other requirements. Therefore, for most models, multiple deployment operations may be required for different deployment terminals.

[0003] However, when the number of devices is large, deploying the model on different devices in sequence requires a lot of time and manpower, which greatly reduces the efficiency of model deployment.

[0004] Currently, no effective solution has been proposed to address the low efficiency of deploying models on each device separately in related technologies. Summary of the invention

[0005] The present application provides a multi-terminal deployment method, system, device and electronic device of a model to solve the problem of low efficiency in separately deploying the model on each device end in the related art.

[0006] According to one aspect of the present application, a multi-terminal deployment method of a model is provided. The method includes: receiving a target model file sent by a compilation module, wherein the target model file includes a target model and a target script, and the target script is used to run the target model; determining the target device on which the target model needs to be deployed, obtaining M target devices, and determining the file transmission method according to the device information of each target device, wherein M is a positive integer; sending the target model file to the M target devices respectively according to the file transmission method, wherein after receiving the target model file, the M target devices parse the target model file to obtain the target model and the target script, and deploy and run the target model through the target script.

[0007] Optionally, after receiving the target model file sent by the compilation module, the method also includes: obtaining file information of the target model file, wherein the file information includes a model name of the target model and a script name of the target script; storing the file information in a local database, and storing the target model file in a remote server; sending the target model file to M target devices respectively according to a file transfer method, including: determining the target model and the target script according to the file information, and obtaining the target model file from the remote server according to the model name and the script name, and sending the target model file to the M target devices.

[0008] Optionally, sending the target model file to M target devices respectively according to the file transfer method includes: determining the configuration strategy for the target model file according to the device information of each target device to obtain M configuration strategies; associating the configuration strategy and the target model file of each target device and sending them to the corresponding target device, wherein after receiving the target model file and the configuration strategy, the target device processes the target model file according to the configuration strategy.

[0009] Optionally, the target script is obtained by compiling an initial script by a compilation module according to a preset compilation method. Before sending the target model file to M target devices respectively according to a file transfer method, the method also includes: identifying in turn whether a preset operating environment corresponding to the preset compilation method is configured in each target device, wherein the preset operating environment is used to run the target script; when the preset operating environment does not exist in the target device, sending an environment configuration file to the target device, and upon receiving a first prompt message sent by the target device, executing the step of sending the target model file to the M target devices respectively according to the file transfer method, wherein the first prompt message indicates that the target device has completed the configuration operation of the environment configuration file, and the environment configuration file is used to configure the preset operating environment in the target device.

[0010] Optionally, the method also includes: when feedback information sent by the target device is received, parsing the feedback information to obtain feedback content; when the feedback content represents the normal operation of the target model, associating the operating status of the target model with the device name of the target device and storing it in a local database; when the feedback content represents the abnormal operation of the target model, obtaining operating parameters in the feedback content, and identifying the cause of the abnormal operation of the target model based on the operating parameters, combining the cause of the abnormal operation and the device name into an alarm message, and sending the alarm message to the operation and maintenance end.

[0011] Optionally, storing the file information in a local database and storing the target model file in a remote server includes: determining whether a model name or a script name exists in the local database; if a model name exists, determining a model version number of the target model, and storing the model version number in association with the model name in the local database, and using the target model in the target model file to replace the historical model in the remote server, wherein the historical model has the same model name as the target model; if a script name exists, determining a script version number of the target script, and storing the script version number in association with the script name in the local database, and using the target script in the target model file to replace the historical script in the remote server, wherein the historical script has the same script name as the target script.

[0012] Optionally, the target model file is obtained by compressing the target model and the target script by a compilation module using a preset compression method. After receiving the target model file, the target device decompresses the target model file using a preset decompression method corresponding to the preset compression method to obtain the target model and the target script.

[0013] According to another aspect of the present application, a multi-terminal deployment system of a model is provided. The system includes: a compilation module, which is used to compile the initial script according to a preset compilation method to obtain a target script, and to compress the target script and the target model in association to obtain a target model file, and to send the target model file to a management module; a management module, which is used to receive the target model file, and to determine the target device on which the target model needs to be deployed, to obtain M target devices, and to determine the file transmission method according to the device information of each target device, and to send the target model file to the M target devices respectively according to the file transmission method; a target device, which is used to decompress the target model file after receiving the target model file, to obtain the target model and the target script, and to deploy and run the target model through the target script.

[0014] According to another aspect of the present application, a multi-terminal deployment device of a model is provided. The device includes: a receiving unit, which is used to receive a target model file sent by a compilation module, wherein the target model file includes a target model and a target script, and the target script is used to run the target model; a determining unit, which is used to determine the target device on which the target model needs to be deployed, obtain M target devices, and determine the file transmission method according to the device information of each target device, wherein M is a positive integer; a first sending unit, which is used to send the target model file to the M target devices respectively according to the file transmission method, wherein after receiving the target model file, the M target devices parse the target model file to obtain the target model and the target script, and deploy and run the target model through the target script.

[0015] According to another aspect of the present invention, a computer program product is also provided, including a computer program, which, when executed by a processor, implements a multi-terminal deployment method of a model provided in the aforementioned embodiment of the present application.

[0016] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is used to run the computer-readable instructions, wherein when the computer-readable instructions are run, a multi-terminal deployment method of a model provided in the aforementioned embodiment is executed.

[0017] Through this application, the following steps are adopted: receiving the target model file sent by the compilation module, wherein the target model file includes the target model and the target script, and the target script is used to run the target model; determining the target device on which the target model needs to be deployed, obtaining M target devices, and determining the file transmission method according to the device information of each target device, wherein M is a positive integer; sending the target model file to the M target devices respectively according to the file transmission method, wherein the M target devices parse the target model file after receiving the target model file, obtain the target model and the target script, and deploy and run the target model through the target script. The problem of low efficiency of model deployment on each device end separately in the related technology is solved. The compiled target model file is sent by the compilation module, and the target model file is sent in parallel to the target device on which the target model needs to be deployed, so that the target device can directly run the target script compiled by the compilation module, thereby running the target model according to the target script, thereby achieving the technical effect of improving the efficiency of model deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 is a flowchart of a multi-terminal deployment method of a model provided in an embodiment of the present application;

[0020] Figure 2 is a schematic diagram of a multi-terminal deployment system according to a model provided in an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of the operation process of the compilation module provided according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of the operation process of the management module provided according to an embodiment of the present application;

[0023] Figure 5is a schematic diagram of a multi-terminal deployment device according to a model provided in an embodiment of the present application;

[0024] Figure 6 It is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] It should be noted that the multi-terminal deployment method, system, device and electronic device of the model determined in the present disclosure can be used in the computer field, and can also be used in any field other than the computer field. The application field of the multi-terminal deployment method, system, device and electronic device of the model determined in the present disclosure is not limited.

[0029] It should be noted that the collected information, user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) used in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated. Corresponding operation portals are provided for users to choose to authorize or refuse to use. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or organization.

[0030] The embodiments or examples of the present disclosure are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection of the present disclosure. In the absence of contradiction, each step in a certain embodiment or example can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.

[0031] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0032] WASM file: WASM file refers to WebAssembly file, the full name is WebAssembly Binary Format. It is a binary format for running high-performance code in a web browser. WASM files can be compiled from various programming languages ​​and then run in a web browser, providing more efficient performance than traditional JavaScript.

[0033] Brotli compression: Brotli compression is a data compression algorithm that can provide a higher compression ratio than traditional compression algorithms and has a faster decompression speed.

[0034] FaaS: Function as a Service. It is a cloud computing service model that allows developers to deploy separate functions or code snippets on the cloud platform and execute these functions through event triggers without considering the underlying server management and resource configuration.

[0035] Daemon: A special type of background process that runs in an operating system. It is usually started when the system starts and runs in the background of the system without relying on any user interaction. Daemons are usually used to perform system-level tasks, such as monitoring hardware devices, managing network services, and executing scheduled tasks.

[0036] WASM runtime: is a software system used to interpret and execute WebAssembly code. It is responsible for loading, parsing, and executing WebAssembly modules, providing access to the underlying hardware, and handling all runtime tasks related to WebAssembly.

[0037] According to an embodiment of the present application, a multi-terminal deployment method of a model is provided.

[0038] Figure 1 Flowchart of the multi-terminal deployment method of the model provided in the embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0039] Step S101, receiving a target model file sent by a compiling module, wherein the target model file includes a target model and a target script, and the target script is used to run the target model.

[0040] Specifically, the execution entity in the embodiment of the present application is a management module, which is connected to a compilation module and multiple target devices. When it is necessary to send a model to a target device, it is necessary to receive a target model file sent by the compilation module. The target model file includes a target model that needs to be configured in the target device, as well as a target script for configuring and running the target model. The management module then uniformly stores the target model files and sends them to the target devices in parallel.

[0041] It should be noted that the target model file can be a file compressed by the compilation module through the brotli compression method. The target model file is obtained by compressing the target script and the target model, and the target model file is transmitted, thereby improving the file transmission efficiency. When the compilation module generates the target script, it first obtains the initial script of the target model, and imports the model script into the compilation environment according to the model script type, thereby compiling the initial script into a WASM file to obtain the target script, thereby ensuring that each target device can directly run the target script without compiling the target script, thereby achieving one-time compilation based on the WASM executable binary file and the WASM runtime engine configured in the target device to support cross-platform and multi-terminal model deployment, thereby achieving the technical effect of improving the efficiency of model deployment.

[0042] Step S102, determining the target devices on which the target model needs to be deployed, obtaining M target devices, and determining the file transmission method according to the device information of each target device, wherein M is a positive integer.

[0043] Specifically, after receiving the target model file, it is necessary to determine the target device on which the target model in the file is to be deployed based on the target model file, thereby determining to which devices the target model file needs to be sent.

[0044] After the target device is determined, since different target devices receive the target model file in different ways, that is, the transmission methods are different, it is necessary to determine the file transfer method of each target device based on the device information, and perform file transfer according to the file transfer methods of different devices to ensure normal file transmission.

[0045] Step S103, sending the target model file to M target devices respectively according to the file transmission method, wherein after receiving the target model file, the M target devices parse the target model file to obtain the target model and the target script, and deploy and run the target model through the target script.

[0046] Specifically, after determining the file transfer method of each target device, the target model file can be directly sent to the target device according to the file transfer method, thereby completing the target model file transfer operation. After receiving the target model file, the target device first decompresses the target model file to obtain the target model and the target script. At this time, the target script can be directly configured and run, and the target model can be configured and run through the target script, thereby completing the configuration operation of the target model.

[0047] The multi-terminal deployment method of the model provided in the embodiment of the present application receives the target model file sent by the compilation module, wherein the target model file includes the target model and the target script, and the target script is used to run the target model; determines the target device on which the target model needs to be deployed, obtains M target devices, and determines the file transmission mode according to the device information of each target device, wherein M is a positive integer; sends the target model file to the M target devices respectively according to the file transmission mode, wherein the M target devices parse the target model file after receiving the target model file, obtain the target model and the target script, and deploy and run the target model through the target script. The problem of low efficiency of model deployment on each device end separately in the related technology is solved. The compiled target model file sent by the compilation module is sent in parallel to the target device on which the target model needs to be deployed, so that the target device can directly run the target script compiled by the compilation module, thereby running the target model according to the target script, thereby achieving the technical effect of improving the efficiency of model deployment.

[0048] Optionally, in the multi-terminal deployment method of the model provided in the embodiment of the present application, after receiving the target model file sent by the compilation module, the method also includes: obtaining file information of the target model file, wherein the file information includes the model name of the target model and the script name of the target script; storing the file information in a local database, and storing the target model file in a remote server; sending the target model file to M target devices respectively according to the file transfer method includes: determining the target model and the target script according to the file information, and obtaining the target model file from the remote server according to the model name and the script name, and sending the target model file to the M target devices.

[0049] Specifically, after receiving the target model file, the target model file needs to be stored. When storing the target model file, the file information of the target model file, that is, the model name and the script name, can be obtained first, and the model name and the script name can be further associated and stored in the local database of the management module, and the target model file can be stored in the remote server, thereby reducing the amount of data stored in the local database.

[0050] Optionally, after completing the file storage operation, if the target model file needs to be sent to the target device, the target model file to be sent can be obtained from the remote server according to the model name and script name in the target model file, and then the target model file can be sent to the target device.

[0051] It should be noted that when only the target script exists in the target model file, it means that only the target script is updated and the target model is not updated. At this time, the target name corresponding to the target script can be determined based on the correspondence between the script name and the model name in the local database, and the target script can be stored in the storage space of the target model file corresponding to the target script and the target model in the remote server, thereby completing the update operation of the target script.

[0052] This embodiment improves the data storage efficiency of the local database of the management module by storing the target model file in a remote server.

[0053] Optionally, in the multi-terminal deployment method of the model provided in the embodiment of the present application, sending the target model file to M target devices respectively according to the file transfer method includes: determining the configuration policy for the target model file according to the device information of each target device to obtain M configuration policies; associating the configuration policy and the target model file of each target device and sending them to the corresponding target device, wherein after receiving the target model file and the configuration policy, the target device processes the target model file according to the configuration policy.

[0054] Specifically, when transmitting the target model file to the target device, it is first necessary to obtain the device information of each target device, and determine the configuration strategy of each target device for the target model file based on the device information. For example, the configuration strategy of device A for the target model file can be to interrupt the model currently running in device A and immediately process the target model file when the target model file is received. The configuration strategy of device B for the target model file can be to process the target model file after completing the operation currently running in the device when the target model file is received. Since different devices have different file configuration strategies, when sending the target model file to the target device, it is necessary to associate the configuration strategy with the target model file and send it so that the target device can configure the target model file according to the corresponding configuration strategy when receiving the target model file.

[0055] It should be noted that when sending the target model file to the target device, due to the different receiving methods of different target devices, different file transfer methods are also needed to send the target model file to the target device. For example, the file transfer method of device C is active reception. It is necessary to send the target model file to device C only after receiving the file request sent by device C, or device C reads the target model file from the management module, so as to ensure the accurate transmission of the target model file.

[0056] This embodiment sends the target model file and the configuration policy to the target device according to the file transmission method, thereby ensuring the accurate transmission and accurate configuration of the target model file.

[0057] Optionally, in the multi-terminal deployment method of the model provided in the embodiment of the present application, the target script is obtained by compiling an initial script by a compilation module according to a preset compilation method. Before sending the target model file to M target devices respectively according to the file transfer method, the method also includes: identifying in turn whether a preset operating environment corresponding to the preset compilation method is configured in each target device, wherein the preset operating environment is used to run the target script; if the preset operating environment does not exist in the target device, sending an environment configuration file to the target device, and upon receiving a first prompt message sent by the target device, executing the step of sending the target model file to the M target devices respectively according to the file transfer method, wherein the first prompt message indicates that the target device has completed the configuration operation of the environment configuration file, and the environment configuration file is used to configure the preset operating environment in the target device.

[0058] Specifically, before sending the target model file to the target device, in order to ensure that the target device can run the target script, it is necessary to first determine whether the preset operating environment corresponding to the preset compilation method is configured in each target device, so as to determine whether the target device can run the target script compiled by the preset compilation method.

[0059] In the case where the preset operating environment does not exist in a certain target device, it is necessary to send an environment configuration file to the device, which contains all the instructions and data required to configure the preset operating environment. After sending the environment configuration file, it is necessary to wait for the feedback of the target device. When the target device completes the configuration operation of the environment configuration file, the target device will send a first prompt message to the management module, thereby indicating that the target device is now ready to receive and run the target script. After the management module receives the first prompt message sent by the target device, the management module can send the target model file (including the compiled target script) to the target device according to a predetermined file transfer method. The above identification process will be executed for all target devices in sequence until all M target devices have completed the environment configuration and received the target model file.

[0060] It should be noted that when the target model file is successfully transferred to the target device, these target devices can start running the target script. At this time, the management module needs to record and monitor the running status of these devices to ensure that the target script can be executed correctly and produce the expected results, thereby ensuring that the target script can run correctly on all target devices, even if these devices may not initially have all the environmental configurations required to run the script.

[0061] This embodiment greatly simplifies the complexity of configuring a deployment model in a multi-device environment through automatic environment configuration and file transfer steps.

[0062] Optionally, in the multi-terminal deployment method of the model provided in the embodiment of the present application, the method also includes: when feedback information sent by the target device is received, parsing the feedback information to obtain feedback content; when the feedback content represents the normal operation of the target model, associating the operating status of the target model with the device name of the target device and storing it in a local database; when the feedback content represents the abnormal operation of the target model, obtaining the operating parameters in the feedback content, and identifying the cause of the abnormal operation of the target model based on the operating parameters, combining the cause of the abnormal operation and the device name into an alarm message, and sending the alarm message to the operation and maintenance end.

[0063] Specifically, after sending the target model file to the target device, it is also necessary to obtain feedback content from the target device to determine whether the target device is normally configured to deploy the target model.

[0064] After receiving the feedback information sent by the target device, the management module first needs to perform an integrity check to ensure the accuracy and completeness of the feedback information. Then, the management module uses a preset parsing algorithm to parse the feedback information and extract the feedback content to provide a basis for subsequent judgment of the target model's operating status.

[0065] After receiving the feedback content, it is necessary to use the preset operation status judgment logic based on the parsed feedback content to determine whether the target model is in a normal operating state. If the feedback content indicates that the target model is operating normally, the management module will associate the operating status of the target model with the device name of the target device, and store this association information in the local database for subsequent query and tracking. If the feedback content indicates that the target model is operating abnormally, the management module will immediately enter the exception handling process. The management module extracts key operating parameters from the feedback content, and can identify the cause of the abnormal operation of the target model through the preset exception identification algorithm combined with the operating parameters.

[0066] It should be noted that when the cause of the abnormality is identified, the management module can combine the cause of the abnormal operation with the name of the device with the problem, generate an alarm message, and send the generated alarm message to the operation and maintenance end, so that after receiving the alarm message, the operation and maintenance end can take corresponding measures to solve the abnormal operation problem of the target model, thereby ensuring that the target models in each target device can be configured and run normally.

[0067] This embodiment ensures that the management module can obtain feedback information in a timely manner and determine the operating status of the target model through a preset parsing algorithm and operating status judgment logic, thereby improving monitoring efficiency and ensuring the normal configuration and operation of the target model.

[0068] Optionally, in the multi-terminal deployment method of the model provided in the embodiment of the present application, storing the file information in a local database and storing the target model file in a remote server includes: determining whether a model name or a script name exists in the local database; if a model name exists, determining the model version number of the target model, and storing the model version number in association with the model name in the local database, and using the target model in the target model file to replace the historical model in the remote server, wherein the historical model has the same model name as the target model; if a script name exists, determining the script version number of the target script, and storing the script version number in association with the script name in the local database, and using the target script in the target model file to replace the historical script in the remote server, wherein the script name of the historical script is the same as the script name of the target script.

[0069] Specifically, when storing the target model or script file, the management module first determines whether the corresponding model name or script name exists in the local database. If the model name exists, the management module further determines the model version number of the target model, and stores the model version number in association with the model name in the local database. This step ensures the accurate correspondence between the model name and the version number, which facilitates subsequent management and query. If the script name exists, the management module also determines the script version number of the target script, and stores the script version number in association with the script name in the local database. This step ensures the accurate correspondence between the script name and the version number.

[0070] After completing the storage and version association of the file information, the management module stores the target model or script file in the remote server. If the target model file is updated, the management module identifies the model name of the target model and searches for the historical model with the same model name in the remote server. Once found, the management module replaces the historical model with the target model in the target model file to ensure that the latest version of the model file is stored in the remote server. If the target script file is updated, the management module also identifies the script name of the target script and searches for the historical script with the same script name in the remote server. Once found, the management module replaces the historical script with the target script in the target model file to ensure that the latest version of the script file is stored in the remote server, so that the update and storage operations of the target model and target script can be completed in the case of full update (that is, both the target model and the target script are updated) and incremental update (that is, the target model or the target script is updated).

[0071] This embodiment determines whether the model name or script name exists in the local database and determines the corresponding version number, so that the management module can quickly complete the storage and version association of file information, thereby improving the storage efficiency of files.

[0072] Optionally, in the multi-terminal deployment method of the model provided in an embodiment of the present application, the target model file is obtained by compressing the target model and the target script by a compilation module using a preset compression method. After receiving the target model file, the target device uses a preset decompression method corresponding to the preset compression method to decompress the target model file to obtain the target model and the target script.

[0073] Specifically, the compilation module is pre-installed with multiple languages ​​(compilation and brotli compression environments for multiple languages ​​such as c / c++, JavaScript, go, and rust compiled into wasm binary files). Each language compilation environment supports adding third-party libraries according to user-specified requirements. In the built compilation environment, scripts in the specified language are compiled into wasm files, and then the wasm files are converted into brotli compressed files to complete the compilation and compression operations of the scripts. The compilation module first imports the model script and model into the compilation environment according to the model script type, and the compiled wasm file is converted into a .br file through the brotli library to obtain the target model file.

[0074] It should be noted that after receiving the target model file, the target device first identifies the compression format of the file. According to the identified compression format, the target device uses a preset decompression algorithm corresponding to the preset compression method to decompress the target model file. During the decompression process, the target device obtains the target model and target script based on key information such as the file name and version number retained during compression. After obtaining the target script and target model, the target model can be run on the target device through the target script, thereby completing the configuration operation of the target model.

[0075] This embodiment compiles and compresses the target script before transmission, thereby ensuring the file transmission efficiency and enabling different target devices to configure and run the target script, thereby improving the configuration efficiency of the target model.

[0076] In this embodiment, Figure 2 is a schematic diagram of a multi-terminal deployment system according to a model provided in an embodiment of the present application, such as Figure 2 As shown, an optional model multi-terminal deployment system is used as an execution subject to execute the multi-terminal deployment method of the aforementioned model. The multi-terminal deployment system of the model at least includes: a compilation module 21, a management module 22 and a target device 23, wherein:

[0077] The compiling module 21 is used to compile the initial script according to a preset compiling method to obtain a target script, associate and compress the target script and the target model to obtain a target model file, and send the target model file to the management module 22.

[0078] Specifically, Figure 3 is a schematic diagram of the operation process of the compilation module provided in an embodiment of the present application, such as Figure 3 As shown, the compilation module 21 is pre-installed with multiple languages ​​(compilation and brotli compression environment for multiple languages ​​such as c / c++, JavaScript, go and rust compiled into wasm binary files). Each language compilation environment supports adding third-party libraries according to user-specified requirements, and supports compiling the specified language into wasm files in the built compilation environment, and then converting the wasm files into brotli compressed files.

[0079] The compilation module 21 first imports the model script and model into the compilation environment according to the model script type. The compiled wasm file is converted into a .br file (that is, the target model file) through the brotli library, and then the br and the corresponding model are saved in the same directory location. At the same time, the model management database records the association between the .br file and the model file, and records the model version and script version. This module supports the update of existing model records, that is, the compiled model is updated and compiled after uploading the new model file and the model running script again. At the same time, according to the user's specification, a compressed package .br file containing the .br file of the model and the model script wasm is generated.

[0080] The management module 22 is used to receive the target model file, determine the target device 23 where the target model needs to be deployed, obtain M target devices 23, and determine the file transfer method according to the device information of each target device 23, and send the target model file to the M target devices 23 respectively according to the file transfer method.

[0081] Specifically, Figure 4 is a schematic diagram of the operation process of the management module provided according to an embodiment of the present application, such as Figure 4As shown, the management module 22 maintains the basic device information of multiple devices, and supports the remote push model multi-device access address. It also maintains the association relationship between the model and the model running script .br file and the full model .br package and the incremental model and script .br file address. When the model is deployed, remote deployment push is performed according to whether the model supports remote deployment, and the model running daemon is notified to perform .br file parsing and model deployment. If the device does not set the remote push address, the user is provided with the full or incremental model file and script .br file download path. For devices that support remote deployment, the management module provides automatic remote push capabilities. Each model record that supports remote deployment in the module provides an automatic push switch. When the switch is turned on, the latest .br file is automatically pushed to the remote device when the model and script compile a new version, and the device FaaS is called to execute the model deployment. The model management module supports custom deployment strategies. In the model record that supports remote deployment, deployment strategies are allowed to be set, such as immediate deployment, stopping the running model, deploying the latest model immediately, or deploying the model after the current reasoning is completed. The model management module supports command operations during model deployment and operation, such as stopping deployment of the latest version, restoring the previous version, or specifying the command line operation of the version during deployment or operation.

[0082] The target device 23 is used to decompress the target model file after receiving the target model file, obtain the target model and the target script, and deploy and run the target model through the target script.

[0083] Specifically, the target device 23 is mainly deployed with the following three parts: model daemon, wasm runtime and FaaS runtime. The model daemon is responsible for receiving and processing the target model file, and starts the device-side wasm function to parse the .br file to deploy the parsed target model file, obtain the deployment status information and push the model deployment status information to the management module 22, exchange information with the wasm runtime during the model operation, and push the exchanged information to the management module 22; the wasm runtime executes the model script, records the status information during the model operation, and executes the model daemon to push command line information, such as stopping the model operation, preparing to update, etc.; during the FaaS runtime, the model full and incremental deployment .br parsing function and model deployment function are stored. After the parsing and model deployment functions are started, the function will push the model deployment status information to the model daemon, and at the same time execute the command line information pushed by the daemon, such as stopping the update, re-updating, etc.

[0084] The multi-terminal deployment system based on the above model can compile the model script file into a smaller binary file, reducing the storage occupancy on the device side. At the same time, the .br format file is used in the management module storage and transmission process, which not only reduces the storage pressure of the management module but also improves the transmission efficiency during the deployment process. The faster startup speed of wasm effectively improves the system responsiveness; based on the multi-language support capability of wasm, model scripts in multiple languages ​​can be mixed and deployed; through the wasm runtime, easy cross-platform porting is achieved, so that the model running script can be compiled once and deployed on multiple terminals, reducing the script code maintenance cost and improving the efficiency of multi-terminal model deployment; the deployment mode configuration and model command line functions implemented based on the cooperation of the management module and the target device realize flexible and efficient model operation and deployment operations, improve deployment efficiency, and reduce deployment time costs.

[0085] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0086] The embodiment of the present application also provides a multi-terminal deployment device of a model. It should be noted that the multi-terminal deployment device of the model in the embodiment of the present application can be used to execute the multi-terminal deployment method for the model provided in the embodiment of the present application. The multi-terminal deployment device of the model provided in the embodiment of the present application is introduced below.

[0087] Figure 5 Schematic diagram of a multi-terminal deployment device according to a model provided in an embodiment of the present application. Figure 5 As shown, the device includes: a receiving unit 51, a determining unit 52, and a first sending unit 53.

[0088] The receiving unit 51 is used to receive a target model file sent by the compiling module, wherein the target model file includes a target model and a target script, and the target script is used to run the target model.

[0089] The determination unit 52 is used to determine the target device on which the target model needs to be deployed, obtain M target devices, and determine the file transmission mode according to the device information of each target device, where M is a positive integer.

[0090] The first sending unit 53 is used to send the target model file to M target devices respectively according to the file transmission method, wherein after receiving the target model file, the M target devices parse the target model file to obtain the target model and the target script, and deploy and run the target model through the target script.

[0091] The multi-terminal deployment device of the model provided in the embodiment of the present application receives the target model file sent by the compilation module through the receiving unit 51, wherein the target model file includes the target model and the target script, and the target script is used to run the target model; the determination unit 52 determines the target device on which the target model needs to be deployed, obtains M target devices, and determines the file transmission mode according to the device information of each target device, wherein M is a positive integer; the first sending unit 53 sends the target model file to the M target devices respectively according to the file transmission mode, wherein the M target devices parse the target model file after receiving the target model file, obtain the target model and the target script, and deploy and run the target model through the target script. The problem of low efficiency of model deployment on each device end separately in the related technology is solved. The compiled target model file sent by the compilation module is sent in parallel to the target device on which the target model needs to be deployed, so that the target device can directly run the target script compiled by the compilation module, thereby running the target model according to the target script, thereby achieving the technical effect of improving the efficiency of model deployment.

[0092] Optionally, in the multi-terminal deployment device of the model provided in the embodiment of the present application, after receiving the target model file sent by the compilation module, the device also includes: a first acquisition unit, used to obtain file information of the target model file, wherein the file information includes the model name of the target model and the script name of the target script; a first storage unit, used to store the file information in a local database, and store the target model file in a remote server; the first sending unit 53 includes: a first determination module, used to determine the target model and the target script according to the file information, and obtain the target model file from the remote server according to the model name and the script name, and send the target model file to M target devices.

[0093] Optionally, in the multi-terminal deployment device of the model provided in the embodiment of the present application, the first sending unit 53 includes: a second determination module, used to determine the configuration strategy for the target model file according to the device information of each target device, and obtain M configuration strategies; a sending module, used to associate the configuration strategy and target model file of each target device and send them to the corresponding target device, wherein after receiving the target model file and the configuration strategy, the target device processes the target model file according to the configuration strategy.

[0094] Optionally, in the multi-terminal deployment device of the model provided in the embodiment of the present application, the target script is obtained by compiling an initial script by a compilation module according to a preset compilation method. Before the target model file is sent to M target devices respectively according to the file transfer method, the device also includes: an identification unit, used to identify in turn whether a preset operating environment corresponding to the preset compilation method is configured in each target device, wherein the preset operating environment is used to run the target script; a second sending unit, used to send an environment configuration file to the target device when the preset operating environment does not exist in the target device, and upon receiving a first prompt message sent by the target device, execute the step of sending the target model file to the M target devices respectively according to the file transfer method, wherein the first prompt message indicates that the target device completes the configuration operation of the environment configuration file, and the environment configuration file is used to configure the preset operating environment in the target device.

[0095] Optionally, in the multi-terminal deployment device of the model provided in the embodiment of the present application, the device also includes: a parsing unit, which is used to parse the feedback information sent by the target device to obtain feedback content when the feedback information is received; a second storage unit, which is used to associate the operating status of the target model with the device name of the target device and store it in a local database when the feedback content represents the normal operation of the target model; a second acquisition unit, which is used to obtain the operating parameters in the feedback content when the feedback content represents the abnormal operation of the target model, and identify the cause of the abnormal operation of the target model based on the operating parameters, combine the cause of the abnormal operation and the device name into an alarm message, and send the alarm message to the operation and maintenance end.

[0096] Optionally, in the multi-terminal deployment device of the model provided in the embodiment of the present application, the file information is stored in the local database, and the target model file is stored in the remote server, including: a judgment module, used to judge whether there is a model name or a script name in the local database; a third determination module, used to determine the model version number of the target model if the model name exists, and store the model version number in association with the model name in the local database, and use the target model in the target model file to replace the historical model in the remote server, wherein the historical model has the same model name as the target model; a fourth determination module, used to determine the script version number of the target script if the script name exists, and store the script version number in association with the script name in the local database, and use the target script in the target model file to replace the historical script in the remote server, wherein the script name of the historical script is the same as the script name of the target script.

[0097] Optionally, in the multi-terminal deployment device of the model provided in the embodiment of the present application, the target model file is obtained by compressing the target model and the target script by the compilation module through a preset compression method. After receiving the target model file, the target device uses a preset decompression method corresponding to the preset compression method to decompress the target model file to obtain the target model and the target script.

[0098] The multi-terminal deployment device of the above-mentioned model includes a processor and a memory. The above-mentioned receiving unit 51, determination unit 52, first sending unit 53, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0099] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of low efficiency of model deployment on each device end in related technologies is solved by adjusting kernel parameters.

[0100] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0101] An embodiment of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the multi-terminal deployment method of the model.

[0102] An embodiment of the present invention provides a processor, which is used to run a program, wherein the multi-terminal deployment method of the model is executed when the program is running.

[0103] Figure 6 is a schematic diagram of an electronic device provided according to an embodiment of the present application, such as Figure 6 As shown, an embodiment of the present invention provides an electronic device, the electronic device 60 includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor executes the program to implement the steps of the multi-terminal deployment method of the above model. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0104] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing the steps of initializing the multi-terminal deployment method with the above-mentioned model.

[0105] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0106] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0107] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0109] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0110] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0111] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0112] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0113] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A multi-terminal deployment method of a model, characterized in that: include: Receive a target model file sent by a compiling module, wherein the target model file includes a target model and a target script, and the target script is used to run the target model; Determine the target device on which the target model needs to be deployed, obtain M target devices, and determine the file transmission method according to the device information of each target device, where M is a positive integer; The target model file is sent to the M target devices respectively according to the file transfer method, wherein after receiving the target model file, the M target devices parse the target model file to obtain the target model and the target script, and deploy and run the target model through the target script.

2. The method according to claim 1, characterized in that: After receiving the target model file sent by the compiling module, the method further includes: Acquire file information of the target model file, wherein the file information includes a model name of the target model and a script name of the target script; The file information is stored in a local database, and the target model file is stored in a remote server; Sending the target model file to the M target devices respectively according to the file transmission method includes: The target model and the target script are determined according to the file information, and the target model file is obtained from the remote server according to the model name and the script name, and the target model file is sent to the M target devices.

3. The method according to claim 1, characterized in that Sending the target model file to the M target devices respectively according to the file transmission method includes: Determine a configuration strategy for the target model file according to the device information of each target device, and obtain M configuration strategies; The configuration policy of each target device and the target model file are associated and sent to the corresponding target device, wherein after receiving the target model file and the configuration policy, the target device processes the target model file according to the configuration policy.

4. The method according to claim 1, characterized in that The target script is obtained by compiling the initial script by the compilation module according to a preset compilation method. Before sending the target model file to the M target devices respectively according to the file transmission method, the method further includes: sequentially identifying whether a preset operating environment corresponding to the preset compilation method is configured in each target device, wherein the preset operating environment is used to run the target script; When the preset operating environment does not exist in the target device, an environment configuration file is sent to the target device, and when a first prompt message sent by the target device is received, the step of sending the target model file to the M target devices respectively according to the file transfer method is performed, wherein the first prompt message indicates that the target device has completed the configuration operation of the environment configuration file, and the environment configuration file is used to configure the preset operating environment in the target device.

5. The method according to claim 1, characterized in that The method further comprises: When receiving feedback information sent by the target device, parsing the feedback information to obtain feedback content; In a case where the feedback content indicates that the target model is operating normally, the operating state of the target model is associated with the device name of the target device and stored in a local database; In the case that the feedback content represents abnormal operation of the target model, the operating parameters in the feedback content are obtained, and the cause of the abnormal operation of the target model is identified according to the operating parameters, the cause of the abnormal operation and the device name are combined into alarm information, and the alarm information is sent to the operation and maintenance end.

6. The method according to claim 2, characterized in that Storing the file information in a local database and storing the target model file in a remote server includes: Determine whether the model name or the script name exists in the local database; In the case where the model name exists, determining a model version number of the target model, and storing the model version number in association with the model name in the local database, and replacing a historical model in the remote server with the target model in the target model file, wherein the historical model has the same model name as the target model; In the case where the script name exists, the script version number of the target script is determined, and the script version number is associated with the script name in the local database and stored, and the target script in the target model file is used to replace the historical script in the remote server, wherein the historical script has the same script name as the target script.

7. The method according to claim 1, characterized in that The target model file is obtained by the compilation module compressing the target model and the target script in a preset compression method. After receiving the target model file, the target device decompresses the target model file in a preset decompression method corresponding to the preset compression method to obtain the target model and the target script.

8. A multi-terminal deployment system of a model, characterized in that: include: A compiling module is used to compile the initial script according to a preset compiling method to obtain a target script, associate and compress the target script and the target model to obtain a target model file, and send the target model file to the management module; The management module is used to receive the target model file, determine the target device on which the target model needs to be deployed, obtain M target devices, determine a file transmission method according to device information of each target device, and send the target model file to the M target devices respectively according to the file transmission method; The target device is used to decompress the target model file after receiving the target model file to obtain the target model and the target script, and deploy and run the target model through the target script.

9. A multi-terminal deployment device of a model, characterized in that: include: A receiving unit, configured to receive a target model file sent by a compiling module, wherein the target model file includes a target model and a target script, and the target script is used to run the target model; A determination unit, configured to determine a target device on which the target model needs to be deployed, obtain M target devices, and determine a file transmission method according to device information of each target device, wherein M is a positive integer; A first sending unit is used to send the target model file to the M target devices respectively according to the file transfer method, wherein after receiving the target model file, the M target devices parse the target model file to obtain the target model and the target script, and deploy and run the target model through the target script.

10. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein when the program is run, the multi-terminal deployment method of the model described in any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Model deployment method and device, storage medium and electronic equipment

    CN111240698A

  • Model deployment method and device, storage medium and electronic equipment

    CN112395072A

  • Model deployment system, method and device and storage medium

    CN113961199A

  • Model deployment method and device, storage medium and electronic equipment

    CN116028069A

  • Model service method and device

    CN116450157A