WO2020088681A1 - 模型文件的管理方法和终端设备 - Google Patents
模型文件的管理方法和终端设备 Download PDFInfo
- Publication number
- WO2020088681A1 WO2020088681A1 PCT/CN2019/115166 CN2019115166W WO2020088681A1 WO 2020088681 A1 WO2020088681 A1 WO 2020088681A1 CN 2019115166 W CN2019115166 W CN 2019115166W WO 2020088681 A1 WO2020088681 A1 WO 2020088681A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- model file
- parameters
- file package
- terminal device
- server
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2379—Updates performed during online database operations; commit processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/35—Creation or generation of source code model driven
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/34—Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters
Definitions
- the embodiments of the present application relate to the field of communication technologies, and in particular, to a method and terminal device for managing model files.
- model files are usually packaged in APP file packages.
- the APP has a change request or the model file has a change request, the entire APP package file will be changed together.
- the model file is usually large, which results in a large APP package file and wastes terminal resources.
- Embodiments of the present application provide a method and terminal device for managing model files, which reduces redundant storage of model files on terminal devices and saves resources of terminal devices.
- an embodiment of the present application provides a method for managing a model file, including: a terminal device receives a storage address of a target model file package from a server, and obtains the target model file package according to the storage address of the target model file package Wherein the target model file package is determined based on the parameters of the model file package stored locally by the terminal device and the parameters of the model file package managed by the server.
- the method before the terminal device receives the storage address of the target model file package from the server, the method further includes: the terminal device obtains the parameters of the target model file package, and The server sends a first request, and the first request is used to request the target model file package.
- the terminal device acquiring parameters of the target model file package includes: the terminal device receiving parameters of K model file packages sent by the server, where K is a positive integer and is stored locally
- the parameters of the model file package, the parameters of the target model file package are determined from the parameters of the K model file packages.
- the parameters of the target model file package include the identification of the target model file package
- the first request includes the identification of the target model file package
- the identification of the target model file package is used Obtain the storage address of the target model file package from the server.
- the parameters of the model file package include parameters of the first type and parameters of the second type; wherein, the matching priority of the first type parameter is higher than the matching priority of the second parameter.
- the terminal device determines the parameters of the target model file package from the parameters of the K model file packages according to the parameters of the locally stored model file package, including: When the first type parameters of the N model file packages in the K model file packages match, the terminal device according to the second type parameters of the locally stored model file package and the first model parameters of the N model file packages Two types of parameters determine the parameters of the target model file package, and N is a positive integer less than or equal to K.
- the second type of parameters includes multiple sub-parameters, and the matching priority of each sub-parameter is different.
- the terminal device determines the parameters of the target model file package according to the second type parameters of the locally stored model file package and the second type parameters of the N model file packages, including: the terminal device according to each sub-parameter In order of matching priority, the second-type parameters of the locally stored model file package and the second-type parameters of N model file packages are matched to determine the parameters of the target model file package.
- the method before the terminal device receives the storage address of the target model file package from the server, the method further includes: the terminal device obtains parameters of the target model file; if the terminal device If the target model file is not found in the locally stored model file, the terminal device obtains the parameters of the model file package to which the target model file belongs according to the parameters of the target model file; The server sends a second request, the second request includes parameters of the model file package to which the target model file belongs, and parameters of the model file package to which the target model file belongs are used by the server to determine the target The storage address of the model file package.
- the method before the terminal device receives the storage address of the target model file package from the server, the method further includes: the terminal device sends parameters of the locally stored model file package to the server.
- the parameters of the locally stored model file package are used by the server to determine the storage address of the target model file package.
- the terminal device sends the parameters of the locally stored model file package to the server, including: the terminal device receives a third request sent by the server, and the terminal device uses the third request To send the parameters of the locally stored model file package to the server. Or, when the terminal device determines that the parameter sending condition of the model file package is satisfied, it sends the locally stored parameters of the model file package to the server.
- an embodiment of the present application provides a method for managing a model file, including: a server acquiring a storage address of a target model file package, and sending a storage address of the target model file package to a terminal device, where the storage address is used for the terminal The device obtains the target model file package.
- the target model file package is determined according to the parameters of the model file package stored locally by the terminal device and the parameters of the model file package managed by the server.
- the method before the server obtains the storage address of the target model file package, the method further includes: the server receives a first request sent by the terminal device, and the first request is used to request the target model File package.
- the method before the server receives the first request sent by the terminal device, the method further includes: the server sends parameters of the K model file packages managed by the server to the terminal device, the K is a positive integer.
- the parameters of the K model file packages are used by the terminal device to determine the parameters of the target model file package from the parameters of the K model file packages.
- the parameters of the target model file package include the identification of the target model file package
- the first request includes the identification of the target model file package.
- the server acquiring the storage address of the target model file package includes: the server acquiring the storage address of the target model file package according to the identifier of the target model file package.
- the method before the server obtains the storage address of the target model file package, the method further includes: the server receives a second request sent by the terminal device, and the second request includes a model to which the target model file belongs Parameters of the file package.
- the server acquiring the storage address of the target model file package includes: the server determining the target file from the parameters of the K model file packages managed by the server according to the parameters of the model file package to which the target model file belongs Parameters of the package; the server obtains the storage address of the target model file package according to the parameters of the target file package.
- the method before the server obtains the storage address of the target model file package, the method further includes: the server receiving parameters of the model file package stored locally by the terminal device and sent by the terminal device.
- the server acquiring the storage address of the target model file package includes: the server determining the target file package from the parameters of the K model file packages managed by the server according to the parameters of the locally stored model file package parameter;
- the server obtains the storage address of the target model file package according to the parameters of the target file package.
- the method before the server receives the parameters of the model file package stored locally by the terminal device and sent by the terminal device, the method further includes: the server receives the third request sent by the terminal device, The third request is used to request the parameters of the model file package stored locally by the terminal device.
- the parameters of the model file package include parameters of the first type and parameters of the second type; wherein, the matching priority of the first type parameter is higher than the matching priority of the second parameter.
- the server determines the parameters of the target model file package from the parameters of the K model file packages according to the parameters of the model file package received from the terminal device, including: the model file received from the terminal device When the first type parameter of the package matches the first type parameter of the N model file packages in the K model file packages, the server according to the second type parameter of the model file package received from the terminal device and all The second type parameters of the N model file packages are used to determine the parameters of the target model file package, and N is a positive integer less than or equal to K.
- the second type of parameters includes multiple sub-parameters, and the matching priority of each sub-parameter is different.
- the server determines the parameters of the target model file package according to the second type parameters of the model file package received from the terminal device and the second type parameters of the N model file packages, including: The order of matching priority of the sub-parameters matches the second-type parameters of the model file package and the second-type parameters of the N model file packages received from the terminal device to determine the parameters of the target model file package.
- an embodiment of the present application provides a terminal device, including:
- the transceiver module is used to receive the storage address of the target model file package from the server;
- a processing module configured to obtain the target model file package according to the storage address of the target model file package
- the target model file package is determined according to the parameters of the model file package stored locally by the terminal device and the parameters of the model file package managed by the server.
- the processing module is further configured to acquire the parameters of the target model file package before receiving the storage address of the target model file package from the server;
- the transceiver module is further configured to send a first request to the server according to the parameters of the target model file package, and the first request is used to request the target model file package.
- the transceiver module also uses parameters of K model file packages sent by the receiving server, where K is a positive integer;
- the processing module is specifically configured to determine the parameters of the target model file package from the parameters of the K model file packages according to the parameters of the locally stored model file packages.
- the parameters of the target model file package include the identification of the target model file package
- the first request includes the identification of the target model file package
- the identification of the target model file package is used Obtain the storage address of the target model file package from the server.
- the parameters of the model file package include parameters of the first type and parameters of the second type; wherein, the matching priority of the first type parameter is higher than the matching priority of the second parameter.
- the processing module is specifically configured to: when the first-type parameters of the locally stored model file package match the first-type parameters of the N model file packages in the K model file packages, the terminal device The second type parameters of the locally stored model file package and the second type parameters of the N model file packages determine the parameters of the target model file package, and N is a positive integer less than or equal to K.
- the second type of parameters includes multiple sub-parameters, and the matching priority of each sub-parameter is different.
- the processing module is specifically configured to match the second-type parameters of the locally stored model file package and the second-type parameters of the N model file packages according to the matching priority order of each sub-parameter to determine The parameters of the target model file package.
- the processing module is further used to obtain the parameters of the target model file before the transceiver module receives the storage address of the target model file package from the server; If the target model file is not found in the locally stored model file, the parameters of the model file package to which the target model file belongs are obtained according to the parameters of the target model file;
- the transceiver module is further configured to send a second request to the server, where the second request includes parameters of the model file package to which the target model file belongs, and parameters of the model file package to which the target model file belongs It is used by the server to determine the storage address of the target model file package.
- the transceiver module is further configured to send the locally stored model file package parameters to the server before receiving the storage address of the target model file package from the server.
- the parameters of the locally stored model file package are used by the server to determine the storage address of the target model file package.
- the transceiver module is specifically configured to: receive a third request sent by the server, and send the parameters of the locally stored model file package to the server according to the third request; or, when When it is determined that the parameter sending conditions of the model file package are satisfied, the parameters of the model file package stored locally are sent to the server.
- an embodiment of the present application provides a server, including:
- Processing module used to obtain the storage address of the target model file package
- the transceiver module is used to send the storage address of the target model file package to the terminal device, and the storage address is used by the terminal device to obtain the target model file package;
- the target model file package is determined according to the parameters of the model file package stored locally by the terminal device and the parameters of the model file package managed by the server.
- the transceiver module is further configured to receive the first request sent by the terminal device before the processing module obtains the storage address of the target model file package, and the first request is used to request The target model file package.
- the transceiver module is further configured to send the parameters of the K model file packages managed by the server to the terminal device before receiving the first request sent by the terminal device, the K is a positive integer;
- the parameters of the K model file packages are used by the terminal device to determine the parameters of the target model file package from the parameters of the K model file packages.
- the parameters of the target model file package include the identification of the target model file package, and the first request includes the identification of the target model file package;
- the processing module is specifically configured to obtain the storage address of the target model file package according to the identifier of the target model file package.
- the transceiver module is further configured to receive a second request sent by the terminal device before the processing module obtains the storage address of the target model file package, the second request includes the target model Parameters of the model file package to which the file belongs.
- the processing module is specifically configured to determine the parameters of the target file package from the parameters of the K model file packages managed by the server according to the parameters of the model file package to which the target model file belongs; The parameter of the file package obtains the storage address of the target model file package.
- the transceiver module is further configured to receive the parameters of the model file package stored locally by the terminal device and sent by the terminal device before the processing module obtains the storage address of the target model file package ;
- the processing module is specifically configured to: according to the parameters of the locally stored model file package, determine the parameters of the target file package from the parameters of the K model file packages managed by the server; according to the target file package The parameter of obtains the storage address of the target model file package.
- the transceiver module is further configured to receive a third request sent by the terminal device before receiving the parameters of the model file package stored locally by the terminal device and sent by the terminal device.
- the third request is used to request the parameters of the model file package stored locally by the terminal device.
- the parameters of the model file package include parameters of the first type and parameters of the second type; wherein, the matching priority of the first type parameter is higher than the matching priority of the second parameter.
- the processing module is specifically configured to: when the first type parameters of the model file package received from the terminal device match the first type parameters of the N model file packages of the K model file packages, according to The second type parameters of the model file package received by the terminal device and the second type parameters of the N model file packages determine the parameters of the target model file package, and N is a positive integer less than or equal to K.
- the second type of parameters includes multiple sub-parameters, and the matching priority of each sub-parameter is different.
- the processing module is specifically configured to match the second-type parameters of the model file package and the second-type parameters of the N model file packages received from the terminal device according to the matching priority order of each sub-parameter, To determine the parameters of the target model file package.
- an embodiment of the present application provides a terminal device, including:
- a module, component or circuit for implementing the management method of the model file of the first aspect is a module, component or circuit for implementing the management method of the model file of the first aspect.
- an embodiment of the present application provides a server, including:
- a module, component or circuit for implementing the management method of the model file of the first aspect is a module, component or circuit for implementing the management method of the model file of the first aspect.
- an embodiment of the present application provides a chip, including: a memory and a processor, the memory is used to store program instructions, and the processor is used to call the program instructions in the memory to perform the first aspect or the second aspect described in the embodiments of the present application Model file management method.
- an embodiment of the present application provides a readable storage medium on which a computer program is stored; when the computer program is executed, the first or second aspect of the present application is implemented The management method of the model file mentioned above.
- an embodiment of the present application provides a program product, the program product includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of a terminal device can be read from the readable storage medium Taking the computer program, the at least one processor executes the computer program to cause the terminal device to implement the first aspect or the second aspect or the model file management method described in any of the embodiments of the present application.
- an embodiment of the present application provides a program product, the program product includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of a server can be read from the readable storage medium In the computer program, the at least one processor executes the computer program to cause the server to implement the model file management method described in any one of the embodiments in the first aspect or the second aspect.
- an embodiment of the present application provides a model file management system, including the foregoing terminal device and the foregoing server.
- the method and terminal device for managing a model file provided by the embodiments of the present application, by decoupling the application program and the model file, the terminal device can locally store a common model file and centrally manage the model file, and the common model file can be multiple
- the application program call reduces the redundant storage of model files on the terminal device and saves the resources of the terminal device.
- FIG. 1 is a schematic diagram of an interface of a terminal device provided by an embodiment of this application.
- Figure 2 is a schematic diagram of the existing application package file
- FIG. 3 is a schematic diagram of a principle of model file management provided by an embodiment of the present application.
- FIG. 5 is another schematic diagram of model file management provided by an embodiment of the present application.
- FIG. 6 is another schematic diagram of principle of model file management provided by an embodiment of the present application.
- FIG. 7 is a flowchart of a method for managing a model file provided by an embodiment of this application.
- FIG. 8 is a schematic diagram of an internal software framework of a terminal device provided by an embodiment of this application.
- FIG. 9 is another flowchart of a method for managing a model file provided by an embodiment of this application.
- FIG. 10 is another flowchart of a method for managing a model file provided by an embodiment of this application.
- FIG. 11 is another flowchart of a method for managing a model file provided by an embodiment of this application.
- FIG. 13 is another flowchart of a method for managing a model file provided by an embodiment of this application.
- 15 is a structural diagram of a device provided by an embodiment of this application.
- 16 is another structural diagram of a device provided by an embodiment of this application.
- FIG. 17 is a hardware structure diagram of a terminal device provided by an embodiment of the present application.
- APPs Multiple applications
- the application depends on the hardware resources and software resources of the terminal device to run.
- hardware resources may include, but are not limited to, at least one of the following: chips, processors, memories, etc.
- software resources may include, but are not limited to, at least one of the following: versions of terminal operating systems, languages, and so on.
- the chip may include, but is not limited to, a central processing unit (CPU), a network processor (neural-network processing unit, NPU), a graphics processor (graphics processing unit, GPU), and so on.
- Languages can include Chinese, English, French, Japanese, Korean, etc. Exemplarily, FIG.
- FIG. 1 is a schematic diagram of an interface of a terminal device provided by an embodiment of the present application. As shown in Figure 1, nine applications are installed on the terminal device, with the names APP1 to APP9 in this order. The embodiments of the present application do not limit the number, name, and functions of the application programs installed on the terminal device.
- the model file refers to a related file that can be used by different applications, is related to hardware resources and / or software resources, and can provide algorithm support for specific functions.
- the specific function may be an AI feature or not.
- the name of the model file is not limited.
- the model file may also be called an algorithm support file, an AI algorithm model file, and so on.
- model files related to specific functions can be packaged as a model file package.
- the embodiment of the present application does not limit the name of the model file package, for example, it may be called an algorithm support file package, an AI algorithm model file package, and so on.
- model file there are 15 model files related to the voice recognition function, and the names of the model files are model files 1 to 15, respectively.
- the model files 1-7 can run on the NPU, and the model files 8-15 can run on the CPU.
- the model files 21 to 35 can run on the CPU, and the model files 36 to 40 can run on the NPU.
- the model files 1 to 7 and the model files 21 to 35 can be packaged as the model file package 1
- the model files 8 to 15 and the model Files 36-40 can be packaged as model file package 2. It should be noted that this application does not limit the number of features involved in the model file package.
- model file When the software resources and / or hardware resources involved in the model file are different, the model file is different. Even if the model files achieve the same function, if the software resources and / or hardware resources involved are different, they are different model files.
- the model files that implement the face recognition function may include but are not limited to: model files running on the CPU 1, model files running on the NPU 2, model files running on the GPU 3, and the language used is Chinese Model file 4. Model file 5 in English.
- the model file may also be related to the usage area of the terminal device, the user's skin color, and so on. It can be seen that the number of model files and model file packages is large.
- FIG. 2 is a schematic diagram of an existing application package file.
- APP1 package file includes model file 1, model file 2, model file 3 and other files
- APP2 package file includes model file 1, model file 2, model file 4 and other files
- APP3 package file Including model file 1, model file 3, model file 5 and other files 3.
- APP1 to APP3 include model file 1
- APP1 and APP2 include model file 2
- APP1 and APP3 include model file 3.
- different application package files may include common model files. In this way, when the model file changes or the application program changes, the entire application package file needs to be updated together, resulting in a larger application package file and redundant model files, and it occupies the limited resources of the terminal device and reduces the resource utilization of the terminal device rate.
- the method for managing model files provided by the embodiments of the present application, by decoupling the model file from the application program, centrally managing the general model file, reduces the size of the application package file, and reduces the model file The occupied storage resources of the terminal device.
- the principle of model file management provided by the present application will be described below with reference to FIG. 3.
- the left side in FIG. 3 is similar to FIG. 2, and the right side in FIG. 3 shows the contents of the application package file in this application.
- the APP1 package file includes other files 1
- the APP2 package file includes other files 2
- the APP3 package file includes other files 3.
- the centralized management of the common model files greatly reduces the redundancy of the model files on the terminal equipment and saves the resources of the terminal equipment.
- the change of the model file is relatively independent of the change of the application program, which improves the management efficiency and effect of the model file.
- FIGS. 2 and 3 are only examples, and the embodiments of the present application do not limit the specific content included in the model file used by the application program and the application package file.
- the application package file may also include a model file, but the number of included model files is greatly reduced compared to the number of model files in the prior art.
- FIG. 4 is a system architecture diagram applicable to an embodiment of the present application.
- the system may include the terminal device 100 and the server 200.
- the embodiments of the present application do not limit the number and types of terminal devices and servers.
- the terminal device may be a mobile phone with a wireless connection function, a tablet computer, a handheld device, a vehicle-mounted device, a wearable device, a computing device, and the like.
- the server can be a computer, stand-alone server, cloud server, etc. Wireless communication or wired communication can be performed between the terminal device and the server.
- an application program is installed on the terminal device.
- an application uses a model file, it can be obtained from multiple model files that are centrally managed.
- multiple centrally managed model files can be stored in the terminal device and / or server.
- the terminal device can communicate with the server to actively or passively obtain model files through the server.
- the terminal device updates the locally stored model file in units of model file packages.
- the user can log in to the server through the account password, and publish the newly developed model file package, modified model file package, etc. to the server.
- the server can communicate with the terminal device to provide the model file package update for the terminal device.
- the model file management framework may include a model file management module provided on the server, which may enable the server to realize centralized management of the model files.
- the model file management framework may further include a model file management module provided on the terminal device, which may enable the terminal device to realize centralized management of the model file.
- the model file management framework can be implemented through software programs and / or hardware.
- the model file management framework may include a model file management module provided on the server and a model file management module provided on the terminal device.
- multiple model files may be stored on the terminal device, for example, at least including model files 1 to 5.
- the application (APP) and the model file management module can communicate across processes.
- the model file management module on the terminal device can first search in the locally stored model file. If a model file matching the application is stored locally, it is directly provided to the application. If the model file matching the application program is not stored locally, you can communicate with the server and obtain the corresponding model file from the server.
- the model files stored locally by the terminal device may be stored using the model file as the basic unit or the model file package as the basic unit.
- the model file management framework may include a model file management module provided on the server and a model file management module provided on the terminal device.
- this implementation is different in that the model file management module on the terminal device is implemented through the model management APP.
- the model management APP is similar to other APPs installed on the terminal device, and can be downloaded, updated, and deleted.
- the icon of the model management APP may be displayed on the display screen of the terminal device, for example, the “model management” icon shown on the right in FIG. 6.
- the model file has parameters, and the parameters of the model file are used to describe the model file and the environment in which the model file is used, for example, including software resources and / or hardware resources that the model file depends on when it runs.
- the embodiments of the present application do not limit the number of parameters of the model file, the name, the meaning of the parameter, the value of the parameter, the meaning of the different value of the parameter, the field type of the parameter in the software program, and whether it must be set.
- the parameters of the model file may include at least one of the parameters shown in Table 1.
- the model file package also has parameters.
- the parameters of the model file package are used to describe the model file package and the software resources and / or hardware resources related to the model file package.
- the embodiments of the present application do not limit the number of parameters, names, meanings of parameters, values of parameters, meanings of different values of parameters, types of parameters in software programs, and whether they must be set, etc.
- the parameters of the model file may include at least one of the parameters shown in Table 2.
- the execution subject may be a terminal device.
- the method for managing model files provided in this embodiment may include:
- S701 Obtain a file query request triggered by an application program.
- the file query request may include parameters of the model file to be queried.
- the model file to be queried may also be called a target model file.
- the application scenario of this embodiment may be: when an application runs a service, a model file needs to be loaded, thereby triggering query and acquisition of the model file.
- the business may be an AI business.
- the terminal device starts the application program. Log in by face recognition after the application is launched.
- the application needs to run a model file related to the face recognition function.
- the terminal device can obtain the file query request triggered by the application program.
- the parameters of the model file to be queried may include, but are not limited to, the model file identification and version number.
- the number of parameters of the model file to be queried is not limited.
- S702 Search in the model file stored locally in the terminal device according to the parameters of the model file to be queried.
- the terminal device can locally store a general model file to centrally manage the model file.
- the terminal device first searches in the locally stored model file. If the locally stored model file includes the model file to be queried, the local storage address of the model file to be queried is provided to the application program.
- the common model file stored locally in the terminal device is used by multiple applications, which reduces the redundant storage of the model file on the terminal device and saves the terminal Equipment resources.
- the method for managing model files provided in this embodiment may further include:
- the application program can read the model file to be queried from the local storage address of the model file to be queried, and load the model file to be queried by calling the model file loading interface, thereby realizing the specific function of the application program.
- the model file stored locally by the terminal device may be encrypted storage or non-encrypted storage. This embodiment does not limit the encryption method used for encrypted storage.
- Encrypted storage of model files improves the security of centralized management of model files.
- the model file stored locally by the terminal device is encrypted storage, before the application loads the model file to be queried, it may further include:
- FIG. 8 is a schematic diagram of an internal software framework of a terminal device provided by an embodiment of this application.
- the software framework of the terminal device may include an application program (APP), a model file management software development kit (software development kit, SDK), and a model file management module.
- APP application program
- SDK software development kit
- the application program can be integrated with a model file management SDK.
- cross-process communication can be performed between the application program and the model file management module, and between the model file management SDK and the model file management module.
- the model file management SDK can support query, read and decrypt functions of model files.
- the application program can realize the function of querying, reading and decrypting model files through the integrated model file management SDK.
- the application program searches through the model file interface provided by the model file management SDK in the model file stored locally in the terminal device. If the model file to be queried can be found locally, and the model file stored locally on the terminal device is encrypted storage, the application can use the model file management SDK to load the model file interface within the application's own process to be queried for the model file Decrypt and load. Since the application decrypts and reads the model file in its own process, it ensures the loading efficiency of the model file.
- FIG. 9 is another flowchart of a model file management method provided by an embodiment of the present application.
- the main body of execution relates to a terminal device and a server.
- the method for managing model files provided by this embodiment may include:
- the terminal device obtains a file query request triggered by an application program.
- the file query request may include parameters of the model file to be queried.
- the terminal device searches the model file stored locally in the terminal device according to the parameters of the model file to be queried.
- S901-S902 can refer to the description of S701-S702, which will not be repeated here.
- model file package to be updated may also be referred to as a target model file package.
- the application scenario of this embodiment may be: when an application runs a service, a model file needs to be loaded to trigger query and acquisition of the model file.
- the terminal device first looks in the locally stored model file. If there is no model file to be queried in the locally stored model file, you need to obtain it from the server.
- the model file package can be used as the basic unit for updating between the terminal device and the server.
- the terminal device may obtain the parameters of the model file package to be updated according to the parameters of the model file to be queried.
- mapping relationship between the parameters of the model file and the parameters of the model file package there is a mapping relationship between the parameters of the model file and the parameters of the model file package, and the mapping relationship is not limited in this embodiment.
- Table 1 there is a mapping relationship between the origin_id of the model file and the identity of the model file package.
- the number of parameters of the model file package to be updated in this embodiment is not limited.
- the parameters of the model file package to be updated may include but are not limited to the parameters shown in Table 2.
- the terminal device sends a first request to the server.
- the first request includes parameters of the model file package to be updated.
- the first request is used to request the model file package to be updated.
- the server receives the first request sent by the terminal device.
- the server matches the parameters of the model file package to be updated with the parameters of the model file package managed by the server to determine the model file package to be updated.
- the server sends the storage address of the model file package to be updated to the terminal device.
- the terminal device receives the storage address of the model file package to be updated sent by the server.
- an application program on a terminal device can trigger query of a model file.
- the model file package including the model file to be queried may be further obtained from the server.
- the method for managing model files provided in this embodiment may further include:
- the terminal device obtains the model file package to be updated according to the storage address of the model file package to be updated.
- the terminal device can access the storage address of the model file package to be updated, thereby storing the model file package to be updated locally. Since the model file package to be updated includes the model file to be searched by the application, the storage address of the model file to be found in the terminal device can be provided to the application later, so that the application can load the model to be queried Files to achieve specific functions of the application.
- model files in the model file package managed by the server may be stored in the memory in the server or in a memory other than the server.
- model files in the model file package managed by the server may be stored encrypted or unencrypted. This embodiment does not limit the storage method of encrypted storage.
- FIG. 10 is another flowchart of a method for managing a model file provided by an embodiment of this application.
- the main body of execution relates to a terminal device and a server.
- the model file management method provided in this embodiment may include:
- the terminal device determines that the parameter sending condition of the model file package is satisfied, the terminal device sends a second request to the server, where the second request includes the parameters of the model file package stored locally by the terminal device.
- the server receives the second request sent by the terminal device.
- the application scenario of this embodiment may be: when the terminal device determines that the update conditions of the locally stored model file package or the parameters of the model file package are satisfied, the terminal device may actively obtain the updated model file package from the server.
- This embodiment does not limit the parameter transmission conditions of the model file package or the update conditions of the model file package.
- the parameter transmission cycle or update cycle that satisfies the model file package or the terminal device detects that the current wireless network connection is a wireless local area network (WLAN), Bluetooth, etc. connection method, or the terminal device determines the current remaining power When it is greater than the preset percentage, you can actively trigger the update of the locally stored model file package.
- WLAN wireless local area network
- the terminal device may send the parameters of the locally stored model file package to the server, so that the server matches the parameters of the locally stored model file package with the parameters of the model file package managed by the server to determine whether The model file package stored locally in the terminal device needs to be updated.
- this embodiment does not limit the parameters of which model file packages are sent by the terminal device.
- the terminal device may obtain the usage time of the application program within the latest preset time period, determine the application program frequently used by the user, and send the parameters of the model file package to which the model file called by the application program frequently used by the user belongs to the server.
- the terminal device may obtain the priority of the application program, and send the parameters of the model file package to which the model file called by the application program with a higher priority belongs to the server.
- the priority may be a security priority.
- the server matches the parameters of the model file package stored locally in the terminal device included in the second request with the parameters of the model file package managed by the server, and determines the model file package to be updated.
- the server sends the storage address of the model file package to be updated to the terminal device.
- the terminal device receives the storage address of the model file package to be updated sent by the server.
- the terminal device can actively trigger the update of the locally stored model file package, the terminal device sends the parameters of the locally stored model file package to the server, and the server determines the model file to be updated Package, so that the terminal device can complete the update of the locally stored model file package.
- the update operation can be completed only for the model file, which not only reduces the redundant storage of the model file on the terminal device, saves the resources of the terminal device, and ensures The validity of the model file is improved, and the update efficiency and effect of the model file are improved.
- the method for managing model files provided in this embodiment may further include:
- the terminal device obtains the model file package to be updated according to the storage address of the model file package to be updated.
- FIG. 11 is another flowchart of a method for managing a model file provided by an embodiment of this application.
- the main body of execution relates to a terminal device and a server.
- the method for managing model files provided in this embodiment may include:
- the server sends a third request to the terminal device.
- the third request includes the parameters of the model file package managed by the server.
- the terminal device receives the third request sent by the server.
- the application scenario of this embodiment may be: the server actively triggers the update of the model file package stored locally in the terminal device.
- This embodiment does not limit the trigger condition for the server to send the third request.
- it may be similar to the trigger condition for the terminal device to send the second request in the embodiment shown in FIG.
- the server when the server detects that the developer logs in to the server and uploads a new model file package, it may send a third request to the terminal device.
- the server can send the parameters of the managed model file package to the terminal device, so that the terminal device matches the parameters of the model file package stored locally on the terminal device with the parameters of the model file package managed by the server, to determine whether The model file package stored locally in the terminal device needs to be updated.
- this embodiment does not limit the parameters of which model file packages are sent by the server.
- the server may send the parameters of the latest version of the model file package that achieves the same function to the terminal device.
- the server may send the detected parameters of the newly uploaded model file package to the terminal device.
- the terminal device matches the parameters of the model file package included in the third request with the parameters of the model file package stored locally by the terminal device, and determines the model file package to be updated.
- the terminal device sends the identifier of the model file package to be updated to the server.
- the server receives the identifier of the model file package to be updated sent by the terminal device.
- the terminal device may also send other parameters of the model file package to be updated to the server, for example, at least one parameter other than the identifier of the model file package in Table 2, which is not limited in this embodiment.
- the server sends the storage address of the model file package to be updated to the terminal device.
- the terminal device receives the storage address of the model file package to be updated sent by the server.
- the server can actively trigger the update of the model file package stored locally in the terminal device.
- the server sends the parameters of the model file package it manages to the terminal device.
- the terminal device determines the local model file package to be updated, so that the terminal device can obtain the updated model file package from the server to complete the update of the locally stored model file package .
- the update operation can be completed only for the model file, which not only reduces the redundant storage of the model file on the terminal device, saves the terminal device resources, and ensures The validity of the model file is improved, and the update efficiency and effect of the model file are improved.
- the method for managing model files provided in this embodiment may further include:
- the terminal device obtains the model file package to be updated according to the storage address of the model file package to be updated.
- FIG. 12 is another flowchart of a method for managing a model file provided by an embodiment of this application.
- the main body of execution relates to a terminal device and a server.
- the method for managing model files provided in this embodiment may include:
- the server sends a fourth request to the terminal device.
- the fourth request is used to instruct the terminal device to update the locally stored model file package.
- the terminal device receives the fourth request sent by the server.
- the application scenario of this embodiment may be: the server actively triggers the update of the model file package stored locally in the terminal device.
- This embodiment does not limit the trigger condition for the server to send the fourth request, and reference may be made to the trigger condition for the third request in the embodiment shown in FIG. 11. I won't repeat them here.
- the terminal device sends a second request to the server according to the fourth request, where the second request includes parameters of the model file package stored locally by the terminal device.
- the server receives the second request sent by the terminal device.
- the second request may refer to the second request in S1001 in the embodiment shown in FIG. 10, the principle is similar, and will not be repeated here.
- the server matches the parameters of the model file package stored locally in the terminal device included in the second request with the parameters of the model file package managed by the server, and determines the model file package to be updated.
- the server sends the storage address of the model file package to be updated to the terminal device.
- the terminal device receives the storage address of the model file package to be updated sent by the server.
- S1203 to S1204 reference may be made to S1002 to S1003 in the embodiment shown in FIG. 10, and the principles are similar, which will not be repeated here.
- the method for managing model files provided in this embodiment may further include:
- the terminal device obtains the model file package to be updated according to the storage address of the model file package to be updated.
- the server can actively trigger the update of the model file package stored locally in the terminal device.
- the server sends a request message to the terminal device to indicate that the terminal device can update the locally stored model file package.
- the terminal device sends the parameters of the locally stored model file package to the server, and the server determines the model file package to be updated, so that the terminal device can complete the update of the locally stored model file package.
- the update operation can be completed only for the model file, which not only reduces the redundant storage of the model file on the terminal device, saves the resources of the terminal device, and ensures The validity of the model file is improved, and the update efficiency and effect of the model file are improved.
- both this embodiment and the embodiment shown in FIG. 11 can be applied to the server actively triggering the update of the model file package stored locally on the terminal device.
- the fourth request sent by the server to the terminal device instead of carrying the parameters of the model file package, the terminal device sends the parameters of the locally stored model file package to the server, and the server determines the model file package to be updated.
- the third request sent by the server to the terminal device carries the parameters of the model file package managed by the server, and the terminal device determines the model file package to be updated.
- FIG. 13 is another flowchart of a method for managing a model file provided by an embodiment of this application.
- the execution subject may be a terminal device or a server.
- the first model file package and the second model file package are involved, and the number of second model file packages is at least one.
- the model file package to be updated corresponding to the first model file package can be determined.
- the method for managing model files provided in this embodiment may include:
- S1301 Match the first type parameters of the first model file package with the first type parameters of at least one second model file package.
- the parameters of the first model file package and the second model file package include parameters of the first type and parameters of the second type, and the matching priority of the parameters of the first type is higher than that of the parameters of the second type.
- the number of parameters included in the first type parameter and the second type parameter is not limited.
- Table 2 shows 12 parameters. Assume that the parameters of the model file package include these 12 parameters. Among them, the first type of parameters can include four, respectively: the resid (identification of the model file package), version (the version number of the model file package), appVersion (the characteristic version applicable to the model file package), interfaceVersion (applicable to the model file package Algorithm version), the second type of parameters includes the remaining 8 parameters.
- the matching priority of the parameters of the first type is higher than that of the parameters of the second type, the parameters with the high matching priority are matched first.
- the matching order of the multiple parameters is not limited in this embodiment.
- the matching order of the first type of parameters can be: resid> version> appVersion> interfaceVersion, or appVersion> interfaceVersion> resid> version, etc.
- model file package to be updated can be accurately obtained by matching the parameters of different matching priorities of the model file package respectively.
- the matching conditions of the parameters of the model file package are not limited, and may be different according to the meaning of the parameters. Among them, the matching priority of the first type of parameters is higher, and it can accurately match the preset matching conditions of the parameters. The matching priority of the second type of parameters is lower, and can be fuzzy matched with the preset matching conditions of the parameters.
- the preset matching conditions are exemplarily described below.
- the preset matching condition of the parameter "resid” may be “equal”
- the preset matching condition of the parameter “version” may be “greater than”
- the preset matching condition of the parameter “appVersion” may be “ "Equal”
- the preset matching condition of the parameter “interfaceVersion” may be “equal”.
- the identification, applicable feature version and algorithm version of the second model file packages A and C are the same as the values of the relevant parameters of the first model file package, and the version numbers of the second model file packages A and C are higher than The version number of the first model file package, therefore, the second model file packages A and C are successfully matched with the first model file package for the first type of parameters.
- the algorithm version applicable to the second model file package B is different from the first model file package.
- the version number of the second model file package C is lower than that of the first model file package, so the matching is not successful.
- the second model file package with the value of "universal" can be selected.
- the values of the parameter xpu of the second model file package A and the first model file package are different. Therefore, the second model file package A does not match the first model file package.
- the parameters "product" and “district” of the second model file package B cannot be matched exactly, but the value is "universal”. Therefore, the second model file package B matches the first model file package.
- the second model file package C and the first model file package have different values for the parameter chipset. Therefore, the second model file package C does not match the first model file package.
- the values of the parameters of the second model file package D are all "universal", therefore, the second model file package D matches the first model file package.
- the second type of parameters includes multiple sub-parameters, and the matching priority of each sub-parameter is different.
- determining the model file package to be updated corresponding to the first model file package according to the second type parameter of the first model file package and the second type parameter of the N second model file packages may include:
- the second type parameters of the first model file package and the second type parameters of the N second model file packages are matched to determine the model file package to be updated.
- the second type of parameters includes 8 parameters
- the matching priority is productModel> product> chipset> chipsetVendor> xpu> productFamily> district> emuiFamily, and the preset matching conditions are the same.
- the second model file package B is successfully matched with the first model file package.
- the second model file package A matches the first model file package successfully.
- the second model file package B matches the first model file package successfully.
- the second model file package A matches the first model file package successfully.
- the embodiments of the present application may provide a method for managing a model file, and the execution subject may be a terminal device.
- the management method of the model file may include:
- the terminal device receives the storage address of the target model file package from the server;
- the terminal device obtains the target model file package according to the storage address of the target model file package
- the target model file package is determined according to the parameters of the model file package stored locally by the terminal device and the parameters of the model file package managed by the server.
- the method before the terminal device receives the storage address of the target model file package from the server, the method further includes:
- the terminal device obtains the parameters of the target model file package
- the terminal device sends a first request to the server according to the parameters of the target model file package, and the first request is used to request the target model file package.
- the terminal device acquiring the parameters of the target model file package includes:
- the terminal device receives the parameters of the K model file packages sent by the server, where K is a positive integer;
- the terminal device determines the parameters of the target model file package from the parameters of the K model file packages according to the parameters of the locally stored model file packages.
- the parameters of the target model file package include the identification of the target model file package
- the first request includes the identification of the target model file package
- the identification of the target model file package is used for the server Obtain the storage address of the target model file package.
- the parameters of the model file package include parameters of the first type and parameters of the second type; wherein, the matching priority of the first type parameter is higher than that of the second parameter;
- the terminal device determines the parameters of the target model file package from the parameters of the K model file packages according to the parameters of the locally stored model file packages, including:
- the terminal device When the first-type parameters of the locally stored model file package match the first-type parameters of the N model file packages in the K model file packages, the terminal device The second type parameters and the second type parameters of the N model file packages determine the parameters of the target model file package, and N is a positive integer less than or equal to K.
- the second type of parameters includes multiple sub-parameters, and the matching priority of each sub-parameter is different;
- the terminal device determines the parameters of the target model file package according to the second type parameters of the locally stored model file package and the second type parameters of the N model file packages, including:
- the terminal device matches the second-type parameters of the locally stored model file package and the second-type parameters of the N model file packages according to the order of matching priority of each sub-parameter to determine the target model file Package parameters.
- the method before the terminal device receives the storage address of the target model file package from the server, the method further includes:
- the terminal device obtains the parameters of the target model file
- the model file package to which the target model file belongs is obtained according to the parameters of the target model file Parameters of
- the terminal device sends a second request to the server, where the second request includes parameters of the model file package to which the target model file belongs, and parameters of the model file package to which the target model file belongs are used for the
- the server determines the storage address of the target model file package.
- the method before the terminal device receives the storage address of the target model file package from the server, the method further includes:
- the terminal device sends the parameters of the locally stored model file package to the server;
- the parameters of the locally stored model file package are used by the server to determine the storage address of the target model file package.
- the terminal device sending the locally stored model file package parameters to the server includes:
- the terminal device receives the third request sent by the server, and the terminal device sends the parameters of the locally stored model file package to the server according to the third request; or,
- the terminal device determines that the parameter transmission condition of the model file package is satisfied, it sends the locally stored parameters of the model file package to the server.
- the embodiments of the present application may provide a method for managing a model file, and the execution subject may be a server.
- the management method of the model file may include:
- the server obtains the storage address of the target model file package
- the server sends the storage address of the target model file package to the terminal device, and the storage address is used by the terminal device to obtain the target model file package.
- the target model file package is determined according to the parameters of the model file package stored locally by the terminal device and the parameters of the model file package managed by the server.
- the server obtains the storage address of the target model file package, it further includes:
- the server receives a first request sent by the terminal device, where the first request is used to request the target model file package.
- the server before the server receives the first request sent by the terminal device, the server further includes:
- the server sends the parameters of the K model file packages managed by the server to the terminal device, where K is a positive integer; the parameters of the K model file packages are used by the terminal device from the K models The parameters of the target model file package are determined among the parameters of the file package.
- the parameters of the target model file package include the identification of the target model file package
- the first request includes the identification of the target model file package.
- the server acquiring the storage address of the target model file package includes: the server acquiring the storage address of the target model file package according to the identifier of the target model file package.
- the server obtains the storage address of the target model file package, it further includes:
- the server receives a second request sent by the terminal device, where the second request includes parameters of the model file package to which the target model file belongs;
- the server obtaining the storage address of the target model file package includes:
- the server determines the parameters of the target file package from the parameters of the K model file packages managed by the server according to the parameters of the model file package to which the target model file belongs;
- the server obtains the storage address of the target model file package according to the parameters of the target file package.
- the server obtains the storage address of the target model file package, it further includes:
- the server receives the parameters of the model file package stored locally by the terminal device and sent by the terminal device;
- the server obtaining the storage address of the target model file package includes:
- the server determines the parameters of the target file package from the parameters of the K model file packages managed by the server according to the parameters of the locally stored model file packages;
- the server obtains the storage address of the target model file package according to the parameters of the target file package.
- the method before the server receives the parameters of the model file package stored locally by the terminal device and sent by the terminal device, the method further includes:
- the server receives a third request sent by the terminal device, where the third request is used to request parameters of a model file package stored locally by the terminal device.
- the parameters of the model file package include parameters of the first type and parameters of the second type; wherein, the matching priority of the first type parameter is higher than that of the second parameter;
- the server determines the parameters of the target model file package from the parameters of the K model file packages according to the parameters of the model file package received from the terminal device, including:
- the server When the first-type parameters of the model file package received from the terminal device match the first-type parameters of the N model file packages of the K model file packages, the server The second type parameters of the model file package and the second type parameters of the N model file packages determine the parameters of the target model file package, and N is a positive integer less than or equal to K.
- the second type of parameters includes multiple sub-parameters, and the matching priority of each sub-parameter is different;
- the server determines the parameters of the target model file package according to the second type parameters of the model file package received from the terminal device and the second type parameters of the N model file packages, including:
- the server matches the second-type parameters of the model file package received from the terminal device and the second-type parameters of the N model file packages according to the order of matching priorities of the sub-parameters to determine the target model Parameters of the file package.
- the device provided in this embodiment can perform the operations performed by the terminal device or the server in the above method embodiments of the present application. As shown in FIG. 15, the device provided in this embodiment may include a transceiver module 1501 and a processing module 1502.
- the device is a terminal device
- the transceiver module 1501 is used to receive the storage address of the target model file package from the server;
- the processing module 1502 is configured to obtain the target model file package according to the storage address of the target model file package;
- the target model file package is determined according to the parameters of the model file package stored locally by the terminal device and the parameters of the model file package managed by the server.
- the device is a server
- the processing module 1502 is used to obtain the storage address of the target model file package
- the transceiver module 1501 is configured to send a storage address of a target model file package to a terminal device, and the storage address is used by the terminal device to obtain the target model file package;
- the target model file package is determined according to the parameters of the model file package stored locally by the terminal device and the parameters of the model file package managed by the server.
- the transceiver module 1501 and the processing module 1502 can also perform other operations performed by the terminal device or the server in the above method embodiments of the present application.
- the technical principles and technical effects are similar, and are not described here.
- FIG. 16 is another structural diagram of the device provided by the embodiment of the present application.
- the device provided in this embodiment can perform the operations performed by the terminal device or the server in the above method embodiments of the present application.
- the device provided in this embodiment may include a processor 1601, a memory 1602, and a transceiver 1603.
- the transceiver 1603 is used to receive data or send data.
- the memory 1602 is used to store instructions.
- the processor 1601 is used to execute the instructions stored in the memory 1602, and is used to perform the operations performed by the terminal device or the server in the above method embodiments of the present application.
- the technical principles and technical effects are similar, and are not repeated here.
- FIG. 17 is a hardware structure diagram of a terminal device provided by an embodiment of the present application.
- the terminal device 3000 includes but is not limited to: a radio frequency unit 301, a network module 302, an audio output unit 303, an input unit 304, a sensor 305, a display unit 306, a user input unit 307, an interface unit 308, a memory 309, Processor 340, power supply 341 and other components.
- the structure of the terminal device shown in FIG. 17 does not constitute a limitation on the terminal device, and the terminal device 3000 may include more or less components than the illustration, or combine some components, or different Parts layout.
- the terminal device includes but is not limited to a mobile phone, a tablet computer, a palmtop computer, and the like.
- the user input unit 307 is used to receive user input; the display unit 306 is used to display content according to the input in response to the input received by the user input unit 307.
- the radio frequency unit 301 may be used to receive and send signals during sending and receiving information or during a call.
- the radio frequency unit 301 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
- the radio frequency unit 301 can also communicate with the network and other devices through a wireless communication system.
- the terminal device 3000 provides users with wireless broadband Internet access through the network module 302, such as helping users to send and receive e-mails, browse web pages, and access streaming media.
- the audio output unit 303 may convert the audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into an audio signal and output as sound. Moreover, the audio output unit 303 may also provide audio output related to a specific function performed by the terminal device 3000 (for example, call signal reception sound, message reception sound, etc.).
- the audio output unit 303 includes a speaker, a buzzer, a receiver, and the like.
- the input unit 304 is used to receive audio or video signals.
- the input unit 304 may include a graphics processor (Graphics Processing Unit, GPU) 3043 and a microphone 3042.
- the graphics processor 3043 is used to process image data of pictures or videos captured by a camera or the like.
- the processed image frame may be displayed on the display unit 306.
- the image frame processed by the graphics processor 3043 may be stored in the memory 309 (or other storage medium) or sent via the radio frequency unit 301 or the network module 302.
- the microphone 3042 can receive sound, and can process such sound into audio data.
- the processed audio data can be converted into a format that can be sent to the mobile communication base station via the radio frequency unit 301 in the case of a telephone call mode and output.
- the terminal device 3000 further includes at least one sensor 305, such as a light sensor, a motion sensor, and other sensors.
- the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 3063 according to the brightness of the ambient light, and the proximity sensor can close the display panel 3063 and the display panel 3063 when the terminal device 3000 moves to the ear / Or backlight.
- the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when at rest, and can be used to identify the posture of terminal devices (such as horizontal and vertical screen switching, related games , Magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc .; sensor 305 can also include fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, Infrared sensors, etc. will not be repeated here.
- the display unit 306 is used to display information input by the user or information provided to the user.
- the display unit 306 may include a display panel 3063, and the display panel 3063 may be configured in the form of a liquid crystal display (Liquid Crystal) (LCD), an organic light-emitting diode (Organic Light-Emitting Diode, OLED), or the like.
- LCD Liquid Crystal
- OLED Organic Light-Emitting Diode
- the user input unit 307 can be used to receive input numeric or character information, and generate key signal input related to user settings and function control of the terminal device.
- the user input unit 307 includes a touch panel 3073 and other input devices 3072.
- the touch panel 3073 also known as a touch screen, can collect user's touch operations on or near it (such as the user using any finger, stylus, or any other suitable object or accessory on the touch panel 3073 or near the touch panel 3073 operating).
- the touch panel 3073 may include a touch detection device and a touch controller.
- the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into contact coordinates, and then sends To the processor 340, the command sent by the processor 340 is received and executed.
- the touch panel 3073 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
- the user input unit 307 may also include other input devices 3072.
- other input devices 3072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which are not repeated here.
- the touch panel 3073 may be overlaid on the display panel 3063. After the touch panel 3073 detects a touch operation on or near it, it is transmitted to the processor 340 to determine the type of touch event, and then the processor 340 according to the touch The type of event provides corresponding visual output on the display panel 3063.
- the touch panel 3073 and the display panel 3063 are implemented as two independent components to realize the input and output functions of the terminal device, in some embodiments, the touch panel 3073 and the display panel 3063 may be integrated The input and output functions of the terminal device are not specifically limited here.
- the interface unit 308 is an interface for connecting an external device to the terminal device 3000.
- the external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, audio input / output (I / O) port, video I / O port, headphone port, etc.
- the interface unit 308 may be used to receive input from external devices (eg, data information, power, etc.) and transmit the received input to one or more elements within the terminal device 3000 or may be used between the terminal device 3000 and external Transfer data between devices.
- the memory 309 can be used to store software programs and various data.
- the memory 309 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required by at least one function (such as a sound playback function, an image playback function, etc.), etc .; the storage data area may store Data created by the use of mobile phones (such as audio data, phone books, etc.), etc.
- the memory 309 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
- the processor 340 is the control center of the terminal device, and uses various interfaces and lines to connect the various parts of the entire terminal device, by running or executing the software programs and / or modules stored in the memory 309, and calling the data stored in the memory 309 , Perform various functions and process data of the terminal device, so as to monitor the terminal device as a whole.
- the processor 340 may include one or more processing units; optionally, the processor 340 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, and application programs, etc.
- the modulation processor mainly handles wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 340.
- a computer program is stored in the memory 309, wherein the processor 340 runs the computer program, so that the terminal device performs the operations performed by the terminal device in the foregoing method embodiment.
- the processor may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, which may be implemented or Perform the disclosed methods, steps, and logical block diagrams in the embodiments of the present application.
- the general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied and executed by a hardware processor, or may be executed and completed by a combination of hardware and software modules in the processor.
- the memory may be a non-volatile memory, such as a hard disk (HDD) or a solid-state drive (SSD), etc., or a volatile memory (volatile memory), for example Random access memory (random-access memory, RAM).
- the memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
- the memory in the embodiment of the present application may also be a circuit or any other device capable of realizing a storage function, which is used to store program instructions and / or data.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Telephonic Communication Services (AREA)
Abstract
本申请实施例提供一种模型文件的管理方法和终端设备,其中,模型文件的管理方法包括:终端设备从服务器接收目标模型文件包的存储地址;终端设备根据目标模型文件包的存储地址,获取目标模型文件包;其中,目标模型文件包是根据终端设备本地存储的模型文件包的参数与服务器管理的模型文件包的参数确定的。在AI领域中,应用程序可以通过AI模型文件实现特定的功能。通过将应用程序与AI模型文件解耦合,终端设备对通用的模型文件进行集中管理,减小了模型文件在终端设备上的冗余存储,节省了终端设备的资源。
Description
本申请要求于2018年11月01日提交中国专利局、申请号为201811298105.4的中国专利申请以及于2019年04月24日提交中国专利局、申请号为201910336055.2的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请实施例涉及通信技术领域,尤其涉及一种模型文件的管理方法和终端设备。
随着智能终端的普及和应用,大量解决生活、工作问题的计算机应用程序(Application,APP)被开发出来。APP运行在智能终端的硬件和软件环境中。而且,随着人工智能(Artificial Intelligence,AI)技术的不断发展,深度学习越来越成为AI领域成熟可靠的方法。在深度学习算法中,构建深层的网络结构,训练网络参数,这些网络参数在不同的平台中会以不同格式的模型文件保存下来。各种APP也越来越多的应用这些模型文件,从而实现特定功能。
目前,模型文件通常打包在APP文件包中。当APP有变更需求或者模型文件有变更需求时,整个APP打包文件会一起变更。但是,模型文件通常较大,这样就导致APP打包文件较大,浪费了终端资源。
发明内容
本申请实施例提供一种模型文件的管理方法和终端设备,减小了模型文件在终端设备上的冗余存储,节省了终端设备的资源。
第一方面,本申请实施例提供一种模型文件的管理方法,包括:终端设备从服务器接收目标模型文件包的存储地址,根据所述目标模型文件包的存储地址,获取所述目标模型文件包;其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
在一种可能的设计中,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:所述终端设备获取所述目标模型文件包的参数,根据目标模型文件包的参数,向服务器发送第一请求,所述第一请求用于请求所述目标模型文件包。
在一种可能的设计中,所述终端设备获取所述目标模型文件包的参数,包括:所述终端设备接收服务器发送的K个模型文件包的参数,所述K为正整数,根据本地存储的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数。
在一种可能的设计中,所述目标模型文件包的参数包括所述目标模型文件包的标识,所述第一请求包括所述目标模型文件包的标识,所述目标模型文件包的标识用于所述服务器获取所述目标模型文件包的存储地址。
在一种可能的设计中,所述模型文件包的参数包括第一类参数和第二类参数;其中, 第一类参数的匹配优先级高于第二参数的匹配优先级。所述终端设备根据本地存储的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数,包括:当本地存储的模型文件包的第一类参数与所述K个模型文件包中N个模型文件包的第一类参数相匹配时,所述终端设备根据所述本地存储的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,N为小于等于K的正整数。
在一种可能的设计中,所述第二类参数包括多个子参数,每个子参数的匹配优先级不同。所述终端设备根据所述本地存储的模型文件包的第二类参数以及N个模型文件包的第二类参数,确定所述目标模型文件包的参数,包括:所述终端设备根据各个子参数的匹配优先级的顺序,对所述本地存储的模型文件包的第二类参数以及N个模型文件包的第二类参数进行匹配,以确定所述目标模型文件包的参数。
在一种可能的设计中,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:所述终端设备获取目标模型文件的参数;若所述终端设备根据所述目标模型文件的参数在本地存储的模型文件中未查找到所述目标模型文件,则所述终端设备根据所述目标模型文件的参数,获取所述目标模型文件所属的模型文件包的参数;所述终端设备向所述服务器发送第二请求,所述第二请求包括所述目标模型文件所属的所述模型文件包的参数,所述目标模型文件所属的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
在一种可能的设计中,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:所述终端设备向所述服务器发送本地存储的模型文件包的参数。所述本地存储的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
在一种可能的设计中,所述终端设备向所述服务器发送本地存储的模型文件包的参数,包括:所述终端设备接收服务器发送的第三请求,所述终端设备根据所述第三请求,向所述服务器发送本地存储的模型文件包的参数。或者,所述终端设备确定满足模型文件包的参数发送条件时,向所述服务器发送本地存储的模型文件包的参数。
第二方面,本申请实施例提供一种模型文件的管理方法,包括:服务器获取目标模型文件包的存储地址,向终端设备发送目标模型文件包的存储地址,所述存储地址用于所述终端设备获取所述目标模型文件包。其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
在一种可能的设计中,所述服务器获取目标模型文件包的存储地址之前,还包括:所述服务器接收所述终端设备发送的第一请求,所述第一请求用于请求所述目标模型文件包。
在一种可能的设计中,所述服务器接收所述终端设备发送的第一请求之前,还包括:所述服务器向所述终端设备发送所述服务器管理的K个模型文件包的参数,所述K为正整数。所述K个模型文件包的参数用于所述终端设备从所述K个模型文件包的参数中确定所述目标模型文件包的参数。
在一种可能的设计中,所述目标模型文件包的参数包括所述目标模型文件包的标识,所述第一请求包括所述目标模型文件包的标识。所述服务器获取目标模型文件包的存储地址,包括:所述服务器根据所述目标模型文件包的标识,获取所述目标模型文件包的存储地址。
在一种可能的设计中,所述服务器获取目标模型文件包的存储地址之前,还包括:所 述服务器接收所述终端设备发送的第二请求,所述第二请求包括目标模型文件所属的模型文件包的参数。所述服务器获取目标模型文件包的存储地址,包括:所述服务器根据所述目标模型文件所属的模型文件包的参数,从所述服务器管理的K个模型文件包的参数中确定所述目标文件包的参数;所述服务器根据所述目标文件包的参数获取所述目标模型文件包的存储地址。
在一种可能的设计中,所述服务器获取目标模型文件包的存储地址之前,还包括:所述服务器接收所述终端设备发送的所述终端设备本地存储的模型文件包的参数。所述服务器获取目标模型文件包的存储地址,包括:所述服务器根据所述本地存储的模型文件包的参数,从所述服务器管理的K个模型文件包的参数中确定所述目标文件包的参数;
所述服务器根据所述目标文件包的参数获取所述目标模型文件包的存储地址。
在一种可能的设计中,所述服务器接收所述终端设备发送的所述终端设备本地存储的模型文件包的参数之前,还包括:所述服务器接收所述终端设备发送的第三请求,所述第三请求用于请求所述终端设备本地存储的模型文件包的参数。
在一种可能的设计中,所述模型文件包的参数包括第一类参数和第二类参数;其中,第一类参数的匹配优先级高于第二参数的匹配优先级。所述服务器根据从所述终端设备接收的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数,包括:当从所述终端设备接收的模型文件包的第一类参数与所述K个模型文件包中N个模型文件包的第一类参数相匹配时,所述服务器根据从所述终端设备接收的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,N为小于等于K的正整数。
在一种可能的设计中,所述第二类参数包括多个子参数,每个子参数的匹配优先级不同。所述服务器根据从所述终端设备接收的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,包括:所述服务器根据各个子参数的匹配优先级的顺序,对从所述终端设备接收的模型文件包的第二类参数以及N个模型文件包的第二类参数进行匹配,以确定所述目标模型文件包的参数。
第三方面,本申请实施例提供一种终端设备,包括:
收发模块,用于从服务器接收目标模型文件包的存储地址;
处理模块,用于根据所述目标模型文件包的存储地址,获取所述目标模型文件包;
其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
在一种可能的设计中,所述处理模块还用于,在从服务器接收目标模型文件包的存储地址之前,获取所述目标模型文件包的参数;
所述收发模块,还用于根据目标模型文件包的参数,向服务器发送第一请求,所述第一请求用于请求所述目标模型文件包。
在一种可能的设计中,所述收发模块,还用接收服务器发送的K个模型文件包的参数,所述K为正整数;
所述处理模块,具体用于根据本地存储的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数。
在一种可能的设计中,所述目标模型文件包的参数包括所述目标模型文件包的标识, 所述第一请求包括所述目标模型文件包的标识,所述目标模型文件包的标识用于所述服务器获取所述目标模型文件包的存储地址。
在一种可能的设计中,所述模型文件包的参数包括第一类参数和第二类参数;其中,第一类参数的匹配优先级高于第二参数的匹配优先级。
所述处理模块,具体用于:当本地存储的模型文件包的第一类参数与所述K个模型文件包中N个模型文件包的第一类参数相匹配时,所述终端设备根据所述本地存储的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,N为小于等于K的正整数。
在一种可能的设计中,所述第二类参数包括多个子参数,每个子参数的匹配优先级不同。所述处理模块,具体用于:根据各个子参数的匹配优先级的顺序,对所述本地存储的模型文件包的第二类参数以及N个模型文件包的第二类参数进行匹配,以确定所述目标模型文件包的参数。
在一种可能的设计中,所述处理模块,还用于在所述收发模块从服务器接收目标模型文件包的存储地址之前,获取目标模型文件的参数;若根据所述目标模型文件的参数在本地存储的模型文件中未查找到所述目标模型文件,则根据所述目标模型文件的参数,获取所述目标模型文件所属的模型文件包的参数;
所述收发模块,还用于向所述服务器发送第二请求,所述第二请求包括所述目标模型文件所属的所述模型文件包的参数,所述目标模型文件所属的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
在一种可能的设计中,所述收发模块,还用于从服务器接收目标模型文件包的存储地址之前,向所述服务器发送本地存储的模型文件包的参数。所述本地存储的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
在一种可能的设计中,所述收发模块,具体用于:接收服务器发送的第三请求,并根据所述第三请求,向所述服务器发送本地存储的模型文件包的参数;或者,当确定满足模型文件包的参数发送条件时,向所述服务器发送本地存储的模型文件包的参数。
第四方面,本申请实施例提供一种服务器,包括:
处理模块,用于获取目标模型文件包的存储地址;
收发模块,用于向终端设备发送目标模型文件包的存储地址,所述存储地址用于所述终端设备获取所述目标模型文件包;
其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
在一种可能的设计中,所述收发模块,还用于在所述处理模块获取目标模型文件包的存储地址之前,接收所述终端设备发送的第一请求,所述第一请求用于请求所述目标模型文件包。
在一种可能的设计中,所述收发模块,还用于在接收所述终端设备发送的第一请求之前,向所述终端设备发送所述服务器管理的K个模型文件包的参数,所述K为正整数;
所述K个模型文件包的参数用于所述终端设备从所述K个模型文件包的参数中确定所述目标模型文件包的参数。
在一种可能的设计中,所述目标模型文件包的参数包括所述目标模型文件包的标识, 所述第一请求包括所述目标模型文件包的标识;
所述处理模块,具体用于:根据所述目标模型文件包的标识,获取所述目标模型文件包的存储地址。
在一种可能的设计中,所述收发模块,还用于在所述处理模块获取目标模型文件包的存储地址之前,接收所述终端设备发送的第二请求,所述第二请求包括目标模型文件所属的模型文件包的参数。
所述处理模块,具体用于:根据所述目标模型文件所属的模型文件包的参数,从所述服务器管理的K个模型文件包的参数中确定所述目标文件包的参数;根据所述目标文件包的参数获取所述目标模型文件包的存储地址。
在一种可能的设计中,所述收发模块,还用于在所述处理模块获取目标模型文件包的存储地址之前,接收所述终端设备发送的所述终端设备本地存储的模型文件包的参数;
所述处理模块,具体用于:根据所述本地存储的模型文件包的参数,从所述服务器管理的K个模型文件包的参数中确定所述目标文件包的参数;根据所述目标文件包的参数获取所述目标模型文件包的存储地址。
在一种可能的设计中,所述收发模块,还用于在接收所述终端设备发送的所述终端设备本地存储的模型文件包的参数之前,接收所述终端设备发送的第三请求,所述第三请求用于请求所述终端设备本地存储的模型文件包的参数。
在一种可能的设计中,所述模型文件包的参数包括第一类参数和第二类参数;其中,第一类参数的匹配优先级高于第二参数的匹配优先级。
所述处理模块,具体用于:当从所述终端设备接收的模型文件包的第一类参数与所述K个模型文件包中N个模型文件包的第一类参数相匹配时,根据从所述终端设备接收的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,N为小于等于K的正整数。
在一种可能的设计中,所述第二类参数包括多个子参数,每个子参数的匹配优先级不同。所述处理模块,具体用于:根据各个子参数的匹配优先级的顺序,对从所述终端设备接收的模型文件包的第二类参数以及N个模型文件包的第二类参数进行匹配,以确定所述目标模型文件包的参数。
第五方面,本申请实施例提供一种终端设备,包括:
用于实现第一方面的模型文件的管理方法的模块,部件或者电路。
第六方面,本申请实施例提供一种服务器,包括:
用于实现第一方面的模型文件的管理方法的模块,部件或者电路。
第七方面,本申请实施例提供一种芯片,包括:存储器和处理器,存储器用于存储程序指令,处理器用于调用存储器中的程序指令执行第一方面或第二方面本申请实施例所述的模型文件的管理方法。
第八方面,本申请实施例提供一种可读存储介质,所述可读存储介质上存储有计算机程序;所述计算机程序在被执行时,实现第一方面或第二方面本申请实施例所述的模型文件的管理方法。
第九方面,本申请实施例提供一种程序产品,所述程序产品包括计算机程序,所述计算机程序存储在可读存储介质中,终端设备的至少一个处理器可以从所述可读存储介质读 取所述计算机程序,所述至少一个处理器执行所述计算机程序使得终端设备实施第一方面或第二方面或本申请实施例任一所述的模型文件的管理方法。
第十方面,本申请实施例提供一种程序产品,所述程序产品包括计算机程序,所述计算机程序存储在可读存储介质中,服务器的至少一个处理器可以从所述可读存储介质读取所述计算机程序,所述至少一个处理器执行所述计算机程序使得服务器实施第一方面或第二方面申请实施例任一所述的模型文件的管理方法。
第十一方面,本申请实施例提供一种模型文件的管理系统,包括上述的终端设备和上述的服务器。
本申请实施例提供的模型文件的管理方法和终端设备,通过将应用程序与模型文件解耦合,终端设备可以本地存储通用的模型文件,对模型文件进行集中管理,通用的模型文件可以被多个应用程序调用,减小了模型文件在终端设备上的冗余存储,节省了终端设备的资源。
图1为本申请实施例提供的终端设备的一种界面示意图;
图2为现有的应用程序打包文件的示意图;
图3为本申请实施例提供的模型文件管理的一种原理示意图;
图4为本申请实施例适用的系统架构图;
图5为本申请实施例提供的模型文件管理的另一种原理示意图;
图6为本申请实施例提供的模型文件管理的又一种原理示意图;
图7为本申请实施例提供的模型文件的管理方法的一种流程图;
图8为本申请实施例提供的终端设备内部软件框架的一种示意图;
图9为本申请实施例提供的模型文件的管理方法的另一种流程图;
图10为本申请实施例提供的模型文件的管理方法的又一种流程图;
图11为本申请实施例提供的模型文件的管理方法的又一种流程图;
图12为本申请实施例提供的模型文件的管理方法的又一种流程图;
图13为本申请实施例提供的模型文件的管理方法的又一种流程图;
图14为本申请实施例提供的模型文件的管理方法的又一种流程图;
图15为本申请实施例提供的设备的一种结构图;
图16为本申请实施例提供的设备的另一种结构图;
图17为本申请实施例提供的终端设备的一种硬件结构图。
下面结合附图描述本申请实施例。
终端设备上可以安装多个应用程序(APP)。应用程序依赖于终端设备的硬件资源和软件资源运行。可选的,硬件资源可以包括但不限于下列中的至少一项:芯片、处理器、存储器等,软件资源可以包括但不限于下列中的至少一项:终端设备操作系统的版本、语言等。可选的,芯片可以包括但不限于中央处理器(central processing unit,CPU)、网络处理器(neural-network processing unit,NPU)、图形处理器(graphics processing unit,GPU) 等。语言可以包括中文、英语、法语、日语、韩语等。示例性的,图1为本申请实施例提供的终端设备的一种界面示意图。如图1所示,终端设备上安装有9个应用程序,名称依次为APP1~APP9。本申请实施例对终端设备上安装的应用程序的数量、名称、实现的功能不做限定。
随着AI技术的发展,应用程序可以通过AI模型文件实现特定的功能,例如,人脸识别功能、语音识别功能、语义识别功能、图像处理功能、图像修复功能、物体检测功能、智能导航功能等。在本申请实施例中,模型文件是指不同的应用程序可以通用的、与硬件资源和/或软件资源相关的、可以对特定功能提供算法支撑的相关文件。可选的,所述特定功能可以为AI特性,也可以不是。其中,本申请实施例对模型文件的名称不做限定。例如,模型文件也可以称为算法支撑文件、AI算法模型文件等。可选的,与特定功能相关的模型文件可以打包为一个模型文件包。本申请实施例对模型文件包的名称不做限定,例如,可以称为算法支撑文件包、AI算法模型文件包等。
下面通过示例对模型文件和模型文件包进行区分。例如,与语音识别功能相关的模型文件为15个,模型文件的名称分别为模型文件1~15。其中,模型文件1~7可以运行在NPU上,模型文件8~15可以运行在CPU上。与语义识别功能相关的模型文件为20个,模型文件的名称分别为模型文件21~40。其中,模型文件21~35可以运行在CPU上,模型文件36~40可以运行在NPU上。由于语音识别功能与语义识别功能通常相关联,根据支持的芯片(CPU或NPU)的不同,模型文件1~7以及模型文件21~35可以打包为模型文件包1,模型文件8~15和模型文件36~40可以打包为模型文件包2。需要说明,本申请对模型文件包涉及的特性的数量不做限定。
其中,模型文件涉及的软件资源和/或硬件资源不同时,模型文件不同。即使模型文件实现了相同功能,如果涉及的软件资源和/或硬件资源不同,也为不同的模型文件。比如,对于实现人脸识别功能的模型文件,可以包括但不限于:运行在CPU上的模型文件1、运行在NPU上的模型文件2、运行在GPU上的模型文件3、使用语言为中文的模型文件4、使用语言为英文的模型文件5等。可选的,模型文件还可以与终端设备的使用地域、用户的肤色等相关。可见,模型文件和模型文件包的数量较多。
在现有技术中,模型文件通常打包在APP文件包中。示例性的,图2为现有的应用程序打包文件的示意图。结合图1和图2,APP1打包文件包括模型文件1、模型文件2、模型文件3和其他文件1,APP2打包文件包括模型文件1、模型文件2、模型文件4和其他文件2,APP3打包文件包括模型文件1、模型文件3、模型文件5和其他文件3。其中,APP1~APP3都包括模型文件1,APP1和APP2都包括模型文件2,APP1和APP3都包括模型文件3。可见,不同的应用程序打包文件中可能包括通用的模型文件。这样,当模型文件变更或者应用程序变更时,整个应用程序打包文件需要一起更新,导致应用程序打包文件较大、模型文件冗余,而且占用了终端设备的有限资源,降低了终端设备的资源利用率。
针对上述技术问题,本申请实施例提供的模型文件的管理方法,通过对模型文件与应用程序解耦,对通用的模型文件进行集中管理,减小了应用程序打包文件的大小,减少了模型文件占用的终端设备存储资源。下面结合图3对本申请提供的模型文件管理的原理进行说明。图3中左侧与图2相似,图3中右侧示出了本申请中应用程序打包文件的内容。 如图3右侧所示,APP1打包文件包括其他文件1,APP2打包文件包括其他文件2,APP3打包文件包括其他文件3。还可以包括集中管理的模型文件,例如,模型文件1~模型文件5。可见,通过对公用的模型文件进行集中管理,大大减少了模型文件在终端设备上的冗余,节省了终端设备的资源。而且,模型文件的变更与应用程序的变更相对独立,提升了模型文件的管理效率和效果。
需要说明的是,图2和图3仅是示例,本申请实施例对应用程序使用的模型文件、应用程序打包文件中包括的具体内容不做限定。可选的,在本申请实施例中,应用程序打包文件中也可以包括模型文件,但是,包括的模型文件的数量相比于现有技术中的模型文件的数量大大减少。
下面,对本申请实施例适用的系统架构进行说明。示例性的,图4为本申请实施例适用的系统架构图。如图4所示,系统可以包括终端设备100和服务器200。本申请实施例对终端设备和服务器的数量、类型不做限定。例如,终端设备可以为具有无线连接功能的手机、平板电脑、手持设备、车载设备、可穿戴设备、计算设备等。服务器可以为电脑、单机服务器、云服务器等。终端设备与服务器之间可以进行无线通信或有线通信。其中,终端设备上安装有应用程序。应用程序使用模型文件时,可以从集中管理的多个模型文件中获取。可选的,集中管理的多个模型文件可以存储在终端设备和/或服务器中。通常,由于终端设备的存储资源有限,而模型文件的数量又多,所以,服务器上存储的模型文件的数量大于终端设备上存储的模型文件的数量。终端设备可以与服务器进行通信,从而主动或被动的通过服务器获取模型文件。可选的,在本申请实施例中,终端设备对本地存储的模型文件的更新,是以模型文件包为单位进行更新的。可选的,用户可以通过账号密码的方式登录服务器,将新开发的模型文件包、修改变更的模型文件包等发布到服务器中。服务器可以与终端设备进行通信,为终端设备提供模型文件包的更新。
下面,对本申请实施例涉及的模型文件管理框架进行说明。可选的,模型文件管理框架可以包括设置在服务器上的模型文件管理模块,可以使得服务器实现对模型文件的集中管理。可选的,模型文件管理框架还可以包括设置在终端设备上的模型文件管理模块,可以使得终端设备实现对模型文件的集中管理。模型文件管理框架可以通过软件程序和/或硬件的方式实现。
可选的,在一种实现方式中,如图5所示,模型文件管理框架可以包括设置在服务器上的模型文件管理模块和设置在终端设备上的模型文件管理模块。在该种实现方式中,终端设备上可以存储多个模型文件,例如,至少包括模型文件1~5。应用程序(APP)与模型文件管理模块之间可以跨进程通信。当应用程序运行某项业务要加载模型文件时,终端设备上的模型文件管理模块可以先在本地存储的模型文件中查找。若本地存储有与应用程序匹配的模型文件,则直接提供给应用程序。若本地没有存储与应用程序匹配的模型文件,则可以与服务器通信,从服务器获取相应的模型文件。需要说明的是,终端设备本地存储的模型文件,可以以模型文件为基本单位进行存储,也可以以模型文件包为基本单位进行存储。
可选的,在另一种实现方式中,如图6所示,模型文件管理框架可以包括设置在服务 器上的模型文件管理模块和设置在终端设备上的模型文件管理模块。该种实现方式与图5所示的实现方式相比,区别在于,终端设备上的模型文件管理模块通过模型管理APP实现。模型管理APP与终端设备上安装的其他APP相似,可以下载、更新、删除。可选的,终端设备的显示屏上可以显示模型管理APP的图标,例如,图6中右侧所示的“模型管理”图标。
下面,对本申请实施例涉及的模型文件的参数和模型文件包的参数进行说明。
具体的,模型文件具有参数,模型文件的参数用于描述模型文件和模型文件的使用环境,例如包括模型文件运行时依赖的软件资源和/或硬件资源。本申请实施例对模型文件的参数的个数、名称、参数的含义、参数的取值、参数不同取值表示的含义、参数在软件程序中的字段类型、是否必须设置等不做限定。
示例性的,参见表1,模型文件的参数可以包括表1示出的参数中的至少一个。
表1
模型文件包也具有参数,模型文件包的参数用于描述模型文件包和模型文件包相关的软件资源和/或硬件资源。本申请实施例对模型文件包的参数的个数、名称、参数的含义、参数的取值、参数不同取值表示的含义、参数在软件程序中的字段类型、是否必须设置等不做限定。示例性的,参见表2,模型文件的参数可以包括表2示出的参数中的至少一个。
表2
下面以具体地实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。
图7为本申请实施例提供的模型文件的管理方法的一种流程图。本实施例提供的模型文件的管理方法,执行主体可以为终端设备。如图7所示,本实施例提供的模型文件的管理方法,可以包括:
S701、获取应用程序触发的文件查询请求。其中,文件查询请求可以包括待查询的模型文件的参数。
其中,在本申请实施例中,待查询的模型文件也可以称为目标模型文件。
具体的,本实施例的应用场景可以为:应用程序运行某项业务时需要加载模型文件,从而触发对该模型文件的查询和获取。可选的,业务可以为AI业务。比如,当用户点击终端设备屏幕上应用程序的图标时,终端设备启动该应用程序。在应用程序启动后通过人脸识别的方式登录。此时,应用程序需要运行与人脸识别功能相关的模型文件。终端设备可以获取应用程序触发的文件查询请求。
可选的,待查询的模型文件的参数可以包括但不限于模型文件的标识和版本号。本实施例对待查询的模型文件的参数的个数不做限定。
S702、根据待查询的模型文件的参数在终端设备本地存储的模型文件中进行查找。
S703、若在终端设备本地存储的模型文件中获取待查询的模型文件,获取待查询的模型文件在终端设备中的存储地址。
可见,本实施例提供的模型文件的管理方法,终端设备本地可以存储通用的模型文件,对模型文件进行集中管理。当应用程序触发查询模型文件时,终端设备先在本地存储的模型文件中查找。如果本地存储的模型文件中包括待查询的模型文件,则将待查询的模型文件在本地的存储地址提供给应用程序。相比于现有技术,通过将应用程序与模型文件解耦 合,使得终端设备本地存储的通用模型文件被多个应用程序使用,减小了模型文件在终端设备上的冗余存储,节省了终端设备的资源。
可选的,本实施例提供的模型文件的管理方法,还可以包括:
根据待查询的模型文件在终端设备中的存储地址获取待查询的模型文件,以使应用程序加载待查询的模型文件。
具体的,应用程序可以从待查询的模型文件在本地中的存储地址读取待查询的模型文件,通过调用模型文件加载接口加载待查询的模型文件,从而实现应用程序的特定功能。
可选的,终端设备本地存储的模型文件可以为加密存储,也可以为非加密存储。本实施例对于加密存储采用的加密方式不做限定。
通过对模型文件进行加密存储,提升了模型文件集中管理的安全性。
可选的,若终端设备本地存储的模型文件为加密存储,应用程序加载待查询的模型文件之前,还可以包括:
对待查询的模型文件解密。
可选的,图8为本申请实施例提供的终端设备内部软件框架的一种示意图。如图8所示,终端设备的软件框架可以包括应用程序(APP)、模型文件管理软件开发工具包(software development kit,SDK)和模型文件管理模块。其中,应用程序可以集成有模型文件管理SDK。可选的,应用程序与模型文件管理模块之间、模型文件管理SDK与模型文件管理模块之间可以跨进程通信。模型文件管理SDK可以支持模型文件的查询、读取和解密功能。相应的,应用程序通过集成的模型文件管理SDK可以实现模型文件的查询、读取和解密功能。具体的,应用程序触发文件查询请求后,应用程序通过模型文件管理SDK提供的查询模型文件接口在终端设备本地存储的模型文件中进行查找。如果本地可以查询到待查询的模型文件,且终端设备本地存储的模型文件为加密存储时,应用程序可以通过模型文件管理SDK提供的加载模型文件接口在应用程序自己的进程内对待查询的模型文件解密以及加载。由于应用程序在自己的进程内解密以及读取模型文件,因此确保了模型文件的加载效率。
图9为本申请实施例提供的模型文件的管理方法的另一种流程图。本实施例提供的模型文件的管理方法,执行主体涉及终端设备和服务器。如图9所示,本实施例提供的模型文件的管理方法,可以包括:
S901、终端设备获取应用程序触发的文件查询请求。其中,文件查询请求可以包括待查询的模型文件的参数。
S902、终端设备根据待查询的模型文件的参数在终端设备本地存储的模型文件中进行查找。
其中,S901~S902可以参见S701~S702的描述,此处不再赘述。
S903、若在终端设备本地存储的模型文件中没有获取待查询的模型文件,根据待查询的模型文件的参数获取待更新的模型文件包的参数。
其中,在本申请实施例中,待更新的模型文件包也可以称为目标模型文件包。
具体的,本实施例的应用场景可以为:应用程序运行某项业务时需要加载模型文件,触发对该模型文件的查询和获取。终端设备先在本地存储的模型文件中查找。如果本地存 储的模型文件中没有待查询的模型文件,需要进一步从服务器获取。在本实施例中,终端设备与服务器之间可以以模型文件包为基本单位进行更新。终端设备可以根据待查询的模型文件的参数获取待更新的模型文件包的参数。
可选的,模型文件的参数与模型文件包的参数之间具有映射关系,本实施例对该映射关系不做限定。例如,参见表1。在表1中,模型文件的标识origin_id与模型文件包的标识resid之间具有映射关系。
需要说明的是,本实施例对待更新的模型文件包的参数的个数不做限定。可选的,参见表2,待更新的模型文件包的参数可以包括但不限于表2中示出的参数。
S904、终端设备向服务器发送第一请求,第一请求包括待更新的模型文件包的参数,第一请求用于请求待更新的模型文件包。
相应的,服务器接收终端设备发送的第一请求。
S905、服务器将待更新的模型文件包的参数与服务器管理的模型文件包的参数进行匹配,确定待更新的模型文件包。
后续,通过图13所示实施例对模型文件包的参数的匹配进行说明。
S906、服务器将待更新的模型文件包的存储地址发送给终端设备。
相应的,终端设备接收服务器发送的待更新的模型文件包的存储地址。
可见,本实施例提供的模型文件的管理方法,终端设备上的应用程序可以触发查询模型文件。当在终端设备本地存储的模型文件中查找不到待查找的模型文件时,可以进一步从服务器获取包括待查询的模型文件的模型文件包。相比于现有技术,通过将应用程序与模型文件解耦合,通过终端设备与服务器对通用的模型文件集中管理,减小了模型文件在终端设备上的冗余存储,节省了终端设备的资源,并且为应用程序提供了需要的模型文件,确保应用程序的正常运行。
可选的,本实施例提供的模型文件的管理方法,还可以包括:
终端设备根据待更新的模型文件包的存储地址,获取待更新的模型文件包。
具体的,终端设备可以访问待更新的模型文件包的存储地址,从而将待更新的模型文件包存储在本地。由于待更新的模型文件包中包括应用程序查找的待查找的模型文件,后续,可以向应用程序提供待查找的模型文件在终端设备本地中的存储地址,以使应用程序可以加载待查询的模型文件,从而实现应用程序的特定功能。
需要说明的是,服务器管理的模型文件包中的模型文件,可以存储在服务器中的存储器中,也可以存储在服务器之外的存储器中。
需要说明的是,服务器管理的模型文件包中的模型文件,可以加密存储,也可以非加密存储。本实施例对加密存储的存储方式不做限定。
图10为本申请实施例提供的模型文件的管理方法的又一种流程图。本实施例提供的模型文件的管理方法,执行主体涉及终端设备和服务器。如图10所示,本实施例提供的模型文件的管理方法,可以包括:
S1001、若终端设备确定满足模型文件包的参数发送条件时,终端设备向服务器发送第二请求,第二请求包括终端设备本地存储的模型文件包的参数。
相应的,服务器接收终端设备发送的第二请求。
具体的,本实施例的应用场景可以为:终端设备确定满足本地存储的模型文件包的更新条件或满足模型文件包的参数发送时,终端设备可以主动从服务器获取更新的模型文件包。本实施例对模型文件包的参数发送条件或模型文件包的更新条件不做限定。例如,满足模型文件包的参数发送周期或更新周期,或者,终端设备检测到当前的无线网络连接为无线局域网(wireless local area networks,WLAN)、蓝牙等连接方式,或者,终端设备确定当前剩余电量大于预设百分比时,可以主动触发更新本地存储的模型文件包。
在本步骤中,终端设备可以将本地存储的模型文件包的参数发送给服务器,以使服务器将终端设备本地存储的模型文件包的参数与服务器管理的模型文件包的参数进行匹配,从而确定是否需要更新终端设备本地存储的模型文件包。需要说明的是,本实施例对终端设备发送哪些模型文件包的参数不做限定。例如,终端设备可以获取最近预设时长内应用程序的使用时间,确定用户经常使用的应用程序,将用户经常使用的应用程序调用的模型文件所属的模型文件包的参数发送给服务器。又例如,终端设备可以获取应用程序的优先级,将优先级较高的应用程序调用的模型文件所属的模型文件包的参数发送给服务器。可选的,所述优先级可以为安全优先级。
S1002、服务器将第二请求中包括的终端设备本地存储的模型文件包的参数与服务器管理的模型文件包的参数进行匹配,确定待更新的模型文件包。
后续,通过图13所示实施例对模型文件包的参数的匹配进行说明。
S1003、服务器将待更新的模型文件包的存储地址发送给终端设备。
相应的,终端设备接收服务器发送的待更新的模型文件包的存储地址。
可见,本实施例提供的模型文件的管理方法,终端设备可以主动触发对本地存储的模型文件包进行更新,终端设备将本地存储的模型文件包的参数发送给服务器,服务器确定待更新的模型文件包,从而,终端设备可以完成本地存储的模型文件包的更新。相比于现有技术,通过将应用程序与模型文件解耦合,可以仅针对模型文件完成更新操作,不仅减小了模型文件在终端设备上的冗余存储,节省了终端设备的资源,并且确保了模型文件的有效性,提升了模型文件的更新效率和效果。
可选的,本实施例提供的模型文件的管理方法,还可以包括:
终端设备根据待更新的模型文件包的存储地址,获取待更新的模型文件包。
具体可以参见图9所示实施例中的说明,此处不再赘述。
图11为本申请实施例提供的模型文件的管理方法的又一种流程图。本实施例提供的模型文件的管理方法,执行主体涉及终端设备和服务器。如图11所示,本实施例提供的模型文件的管理方法,可以包括:
S1101、服务器向终端设备发送第三请求。第三请求包括服务器管理的模型文件包的参数。
相应的,终端设备接收服务器发送的第三请求。
具体的,本实施例的应用场景可以为:服务器主动触发对终端设备本地存储的模型文件包进行更新。本实施例对服务器发送第三请求的触发条件不做限定。例如,可以与图10所示实施例中终端设备发送第二请求的触发条件相似。又例如,当服务器检测到开发人员登录服务器并上传新的模型文件包时,可以向终端设备发送第三请求。
在本步骤中,服务器可以将管理的模型文件包的参数发送给终端设备,以使终端设备将终端设备本地存储的模型文件包的参数与服务器管理的模型文件包的参数进行匹配,从而确定是否需要更新终端设备本地存储的模型文件包。需要说明的是,本实施例对服务器发送哪些模型文件包的参数不做限定。例如,服务器可以将实现相同功能的模型文件包的最新版本的参数发送给终端设备。又例如,服务器可以将检测到的最新上传的模型文件包的参数发送给终端设备。
S1102、终端设备将第三请求中包括的模型文件包的参数与终端设备本地存储的模型文件包的参数进行匹配,确定待更新的模型文件包。
后续,通过图13所示实施例对模型文件包的参数的匹配进行说明。
S1103、终端设备将待更新的模型文件包的标识发送给服务器。
相应的,服务器接收终端设备发送的待更新的模型文件包的标识。
可选的,终端设备还可以将待更新的模型文件包的其他参数发送给服务器,例如,表2中除模型文件包的标识之外的至少一个参数,本实施例对此不作限定。
S1104、服务器将待更新的模型文件包的存储地址发送给终端设备。
相应的,终端设备接收服务器发送的待更新的模型文件包的存储地址。
可见,本实施例提供的模型文件的管理方法,服务器可以主动触发对终端设备本地存储的模型文件包的更新。服务器将其管理的模型文件包的参数发送给终端设备,终端设备确定本地待更新的模型文件包,从而,终端设备可以从服务器获取更新后的模型文件包,完成本地存储的模型文件包的更新。相比于现有技术,通过将应用程序与模型文件解耦合,可以仅针对模型文件完成更新操作,不仅减小了模型文件在终端设备上的冗余存储,节省了终端设备的资源,并且确保了模型文件的有效性,提升了模型文件的更新效率和效果。
可选的,本实施例提供的模型文件的管理方法,还可以包括:
终端设备根据待更新的模型文件包的存储地址,获取待更新的模型文件包。
具体可以参见图9所示实施例中的说明,此处不再赘述。
图12为本申请实施例提供的模型文件的管理方法的又一种流程图。本实施例提供的模型文件的管理方法,执行主体涉及终端设备和服务器。如图12所示,本实施例提供的模型文件的管理方法,可以包括:
S1201、服务器向终端设备发送第四请求。第四请求用于指示终端设备更新本地存储的模型文件包。
相应的,终端设备接收服务器发送的第四请求。
具体的,本实施例的应用场景可以为:服务器主动触发对终端设备本地存储的模型文件包进行更新。本实施例对服务器发送第四请求的触发条件不做限定,可以参考图11所示实施例中第三请求的触发条件。此处不再赘述。
S1202、终端设备根据第四请求向服务器发送第二请求,第二请求包括终端设备本地存储的模型文件包的参数。
相应的,服务器接收终端设备发送的第二请求。
其中,第二请求可以参见图10所示实施例中S1001中的第二请求,原理相似,此处不再赘述。
S1203、服务器将第二请求中包括的终端设备本地存储的模型文件包的参数与服务器管理的模型文件包的参数进行匹配,确定待更新的模型文件包。
S1204、服务器将待更新的模型文件包的存储地址发送给终端设备。
相应的,终端设备接收服务器发送的待更新的模型文件包的存储地址。
其中,S1203~S1204可以参见图10所示实施例中S1002~S1003,原理相似,此处不再赘述。
可选的,本实施例提供的模型文件的管理方法,还可以包括:
终端设备根据待更新的模型文件包的存储地址,获取待更新的模型文件包。
具体可以参见图9所示实施例中的说明,此处不再赘述。
可见,本实施例提供的模型文件的管理方法,服务器可以主动触发对终端设备本地存储的模型文件包的更新。服务器向终端设备发送请求消息,以指示终端设备可以对本地存储的模型文件包进行更新。终端设备将本地存储的模型文件包的参数发送给服务器,服务器确定待更新的模型文件包,从而,终端设备可以完成本地存储的模型文件包的更新。相比于现有技术,通过将应用程序与模型文件解耦合,可以仅针对模型文件完成更新操作,不仅减小了模型文件在终端设备上的冗余存储,节省了终端设备的资源,并且确保了模型文件的有效性,提升了模型文件的更新效率和效果。
需要说明,本实施例和图11所示实施例都可以应用于服务器主动触发对终端设备本地存储的模型文件包进行更新,区别在于,在本实施例中,服务器向终端设备发送的第四请求可以不携带模型文件包的参数,终端设备将本地存储的模型文件包的参数发送给服务器,由服务器确定待更新的模型文件包。而在图11所示实施例中,服务器向终端设备发送的第三请求携带服务器管理的模型文件包的参数,由终端设备确定待更新的模型文件包。
图13为本申请实施例提供的模型文件的管理方法的又一种流程图。本实施例提供的模型文件的管理方法,执行主体可以为终端设备或服务器。在本实施例中,涉及第一模型文件包和第二模型文件包,第二模型文件包的个数为至少一个。通过将第一模型文件包的参数与至少一个第二模型文件包的参数进行匹配,可以确定与第一模型文件包对应的待更新的模型文件包。如图13所示,本实施例提供的模型文件的管理方法,可以包括:
S1301、对第一模型文件包的第一类参数与至少一个第二模型文件包的第一类参数进行匹配。其中,第一模型文件包和第二模型文件包的参数均包括第一类参数和第二类参数,第一类参数的匹配优先级高于第二类参数的匹配优先级。
其中,本实施例对第一类参数和第二类参数分别包括的参数的个数不做限定。
下面,结合表2进行示例性说明。
表2中示出了12个参数。假设,模型文件包的参数包括这12个参数。其中,第一类参数可以包括4个,分别为:resid(模型文件包的标识)、version(模型文件包的版本号)、appVersion(模型文件包适用的特性版本)、interfaceVersion(模型文件包适用的算法版本),第二类参数包括剩余的8个参数。
由于第一类参数的匹配优先级高于第二类参数的匹配优先级,所以对匹配优先级高的参数首先进行匹配。需要说明的是,如果第一类参数包括多个参数,本实施例对该多个参数的匹配顺序不做限定。例如,在上面示例中,第一类参数的匹配顺序可以为: resid>version>appVersion>interfaceVersion,也可以为appVersion>interfaceVersion>resid>version等。
S1302、当第一模型文件包的第一类参数与N个第二模型文件包的第一类参数相匹配时,根据第一模型文件包的第二类参数以及N个第二模型文件包的第二类参数,确定第一模型文件包对应的待更新的模型文件包。N为正整数。
具体的,对第一模型文件包的第一类参数与至少一个第二模型文件包的第一类参数进行匹配后,如果可以获得N个针对第一类参数匹配成功的第二模型文件包,则继续对第一模型文件包的第二类参数与N个第二模型文件包的第二类参数进行匹配,最终确定第一模型文件包对应的待更新的模型文件包。
可见,通过对模型文件包的不同匹配优先级的参数分别进行匹配,可以准确的获得待更新的模型文件包。
需要说明的是,本实施例对模型文件包的各个参数的匹配条件不做限定,根据参数含义的不同可以有所不同。其中,第一类参数的匹配优先级较高,可以与参数的预设匹配条件精确匹配。第二类参数的匹配优先级较低,可以与参数的预设匹配条件模糊匹配。
下面对预设匹配条件进行示例性说明。
例如,对于第一类参数,参数“resid”的预设匹配条件可以为“相等”,参数“version”的预设匹配条件可以为“大于”,参数“appVersion”的预设匹配条件可以为“相等”,参数“interfaceVersion”的预设匹配条件可以为“相等”。
举例说明。参见表3,第二模型文件包A、C的标识、适用的特性版本和算法版本均与第一模型文件包相关参数的取值相同,且第二模型文件包A、C的版本号高于第一模型文件包的版本号,因此,第二模型文件包A、C针对第一类参数与第一模型文件包匹配成功。第二模型文件包B适用的算法版本与第一模型文件包不同,第二模型文件包C的版本号低于第一模型文件包的版本号,因此匹配不成功。
表3
参数 | resid | version | appVersion | interfaceVersion |
第一模型文件包 | 1 | 5 | 1 | 2 |
第二模型文件包A | 1 | 6 | 1 | 2 |
第二模型文件包B | 1 | 6 | 1 | 3 |
第二模型文件包C | 1 | 7 | 1 | 2 |
第二模型文件包D | 1 | 4 | 1 | 2 |
例如,对于第二类参数,优先采用精确匹配,如果无法精确匹配,可以选取取值为“通用”的第二模型文件包。
举例说明。参见表4,第二模型文件包A与第一模型文件包关于参数xpu的取值不同,因此,第二模型文件包A与第一模型文件包不匹配。第二模型文件包B的参数“product”和“district”无法精确匹配,但是取值为“通用”,因此,第二模型文件包B与第一模型文件包匹配。第二模型文件包C与第一模型文件包关于参数chipset的取值不同,因此,第二模型文件包C与第一模型文件包不匹配。第二模型文件包D的参数的取值均为“通用”,因此,第二模型文件包D与第一模型文件包匹配。
表4
参数 | product | chipset | district | xpu |
第一模型文件包 | P1 | Q1 | 中国 | CPU |
第二模型文件包A | P1 | Q1 | 中国 | NPU |
第二模型文件包B | 通用 | Q1 | 通用 | CPU |
第二模型文件包C | 通用 | Q2 | 通用 | CPU |
第二模型文件包D | 通用 | 通用 | 通用 | 通用 |
可选的,第二类参数包括多个子参数,每个子参数的匹配优先级不同。S1302中,根据第一模型文件包的第二类参数以及N个第二模型文件包的第二类参数,确定第一模型文件包对应的待更新的模型文件包,可以包括:
根据各个子参数的匹配优先级的顺序,对第一模型文件包的第二类参数以及N个第二模型文件包的第二类参数进行匹配,确定待更新的模型文件包。
下面通过示例进行说明。
还参见上面示例。假设,第二类参数包括8个参数,匹配优先级为productModel>product>chipset>chipsetVendor>xpu>productFamily>district>emuiFamily,预设匹配条件相同。
在一个示例中,参见表5。由于第二模型文件包A和第二模型文件包B的参数“product”和“chipset”的取值都为“通用”,继续比较参数“district”。第二模型文件包A与第一模型文件包的参数“district”的取值均为“中国”,因此,第二模型文件包A与第一模型文件包匹配成功。第二模型文件包B与第一模型文件包匹配不成功。
表5
参数 | product | chipset | district |
第一模型文件包 | P1 | Q1 | 中国 |
第二模型文件包A | 通用 | 通用 | 中国 |
第二模型文件包B | 通用 | 通用 | 通用 |
综合上述第一类参数和第二类参数的预设匹配规则和匹配优先级,在表6中,第二模型文件包B与第一模型文件包匹配成功。在表7中,第二模型文件包A与第一模型文件包匹配成功。在表8中,第二模型文件包B与第一模型文件包匹配成功。在表9中,第二模型文件包A与第一模型文件包匹配成功。
表6
参数 | product | chipset | district | version |
第一模型文件包 | P1 | Q1 | 中国 | 1 |
第二模型文件包A | 通用 | Q1 | 海外 | 2 |
第二模型文件包B | 通用 | 通用 | 通用 | 3 |
表7
参数 | product | chipset | district | version |
第一模型文件包 | P1 | Q1 | 中国 | 1 |
第二模型文件包A | 通用 | Q1 | 通用 | 2 |
第二模型文件包B | 通用 | 通用 | 中国 | 3 |
表8
参数 | product | chipset | district | version |
第一模型文件包 | P1 | Q1 | 中国 | 1 |
第二模型文件包A | 通用 | 通用 | 中国 | 2 |
第二模型文件包B | 通用 | 通用 | 中国 | 3 |
表9
参数 | product | chipset | district | version |
第一模型文件包 | 通用 | 通用 | 中国 | 1 |
第二模型文件包A | 通用 | 通用 | 通用 | 2 |
第二模型文件包B | 通用 | Q1 | 通用 | 3 |
需要说明的是,图7~图13所示的方法实施例,相互之间可以结合,本实施例对于结合方式不做限定。
基于上述图7~图13所示的方法实施例,本申请实施例可以提供一种模型文件的管理方法,执行主体可以为终端设备。参见图14中S1402~S1403,所述模型文件的管理方法可以包括:
终端设备从服务器接收目标模型文件包的存储地址;
所述终端设备根据所述目标模型文件包的存储地址,获取所述目标模型文件包;
其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
可选的,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:
所述终端设备获取所述目标模型文件包的参数;
所述终端设备根据目标模型文件包的参数向服务器发送第一请求,所述第一请求用于请求所述目标模型文件包。
可选的,所述终端设备获取所述目标模型文件包的参数,包括:
所述终端设备接收服务器发送的K个模型文件包的参数,所述K为正整数;
所述终端设备根据本地存储的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数。
可选的,所述目标模型文件包的参数包括所述目标模型文件包的标识,所述第一请求包括所述目标模型文件包的标识,所述目标模型文件包的标识用于所述服务器获取所述目标模型文件包的存储地址。
可选的,所述模型文件包的参数包括第一类参数和第二类参数;其中,第一类参数的匹配优先级高于第二参数的匹配优先级;
所述终端设备根据本地存储的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数,包括:
当本地存储的模型文件包的第一类参数与所述K个模型文件包中N个模型文件包的第一类参数相匹配时,所述终端设备根据所述本地存储的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,N为小于等于K的正整 数。
可选的,所述第二类参数包括多个子参数,每个子参数的匹配优先级不同;
所述终端设备根据所述本地存储的模型文件包的第二类参数以及N个模型文件包的第二类参数,确定所述目标模型文件包的参数,包括:
所述终端设备根据各个子参数的匹配优先级的顺序,对所述本地存储的模型文件包的第二类参数以及N个模型文件包的第二类参数进行匹配,以确定所述目标模型文件包的参数。
可选的,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:
所述终端设备获取目标模型文件的参数;
若所述终端设备根据所述目标模型文件的参数在本地存储的模型文件中未查找到所述目标模型文件,则根据所述目标模型文件的参数,获取所述目标模型文件所属的模型文件包的参数;
所述终端设备向所述服务器发送第二请求,所述第二请求包括所述目标模型文件所属的所述模型文件包的参数,所述目标模型文件所属的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
可选的,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:
所述终端设备向所述服务器发送本地存储的模型文件包的参数;
所述本地存储的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
可选的,所述终端设备向所述服务器发送本地存储的模型文件包的参数,包括:
终端设备接收服务器发送的第三请求,所述终端设备根据所述第三请求,向所述服务器发送本地存储的模型文件包的参数;或者,
所述终端设备确定满足模型文件包的参数发送条件时,向所述服务器发送本地存储的模型文件包的参数。
基于上述图7~图13所示的方法实施例,本申请实施例可以提供一种模型文件的管理方法,执行主体可以为服务器。参见图14中S1401~S1402,所述模型文件的管理方法可以包括:
服务器获取目标模型文件包的存储地址;
所述服务器向终端设备发送目标模型文件包的存储地址,所述存储地址用于所述终端设备获取所述目标模型文件包。
其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
可选的,所述服务器获取目标模型文件包的存储地址之前,还包括:
所述服务器接收所述终端设备发送的第一请求,所述第一请求用于请求所述目标模型文件包。
可选的,所述服务器接收所述终端设备发送的第一请求之前,还包括:
所述服务器向所述终端设备发送所述服务器管理的K个模型文件包的参数,所述K为正整数;所述K个模型文件包的参数用于所述终端设备从所述K个模型文件包的参数中确 定所述目标模型文件包的参数。
可选的,所述目标模型文件包的参数包括所述目标模型文件包的标识,所述第一请求包括所述目标模型文件包的标识。所述服务器获取目标模型文件包的存储地址,包括:所述服务器根据所述目标模型文件包的标识,获取所述目标模型文件包的存储地址。
可选的,所述服务器获取目标模型文件包的存储地址之前,还包括:
所述服务器接收所述终端设备发送的第二请求,所述第二请求包括目标模型文件所属的模型文件包的参数;
所述服务器获取目标模型文件包的存储地址,包括:
所述服务器根据所述目标模型文件所属的模型文件包的参数,从所述服务器管理的K个模型文件包的参数中确定所述目标文件包的参数;
所述服务器根据所述目标文件包的参数获取所述目标模型文件包的存储地址。
可选的,所述服务器获取目标模型文件包的存储地址之前,还包括:
所述服务器接收所述终端设备发送的所述终端设备本地存储的模型文件包的参数;
所述服务器获取目标模型文件包的存储地址,包括:
所述服务器根据所述本地存储的模型文件包的参数,从所述服务器管理的K个模型文件包的参数中确定所述目标文件包的参数;
所述服务器根据所述目标文件包的参数获取所述目标模型文件包的存储地址。
可选的,所述服务器接收所述终端设备发送的所述终端设备本地存储的模型文件包的参数之前,还包括:
所述服务器接收所述终端设备发送的第三请求,所述第三请求用于请求所述终端设备本地存储的模型文件包的参数。
可选的,所述模型文件包的参数包括第一类参数和第二类参数;其中,第一类参数的匹配优先级高于第二参数的匹配优先级;
所述服务器根据从所述终端设备接收的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数,包括:
当从所述终端设备接收的模型文件包的第一类参数与所述K个模型文件包中N个模型文件包的第一类参数相匹配时,所述服务器根据从所述终端设备接收的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,N为小于等于K的正整数。
可选的,所述第二类参数包括多个子参数,每个子参数的匹配优先级不同;
所述服务器根据从所述终端设备接收的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,包括:
所述服务器根据各个子参数的匹配优先级的顺序,对从所述终端设备接收的模型文件包的第二类参数以及N个模型文件包的第二类参数进行匹配,以确定所述目标模型文件包的参数。
图15为本申请实施例提供的设备的一种结构图。本实施例提供的设备,可以执行本申请上述方法实施例中终端设备或服务器执行的操作。如图15所示,本实施例提供的设备,可以包括收发模块1501和处理模块1502。
其中,当该设备为终端设备时,
收发模块1501,用于从服务器接收目标模型文件包的存储地址;
处理模块1502,用于根据所述目标模型文件包的存储地址,获取所述目标模型文件包;
其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
其中,当该设备为服务器时,
处理模块1502,用于获取目标模型文件包的存储地址;
收发模块1501,用于向终端设备发送目标模型文件包的存储地址,所述存储地址用于所述终端设备获取所述目标模型文件包;
其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
收发模块1501和处理模块1502还可以执行本申请上述方法实施例中终端设备或服务器执行的其他操作,其技术原理和技术效果类似,此处不再赘述。
图16为本申请实施例提供的设备的另一种结构图。本实施例提供的设备,可以执行本申请上述方法实施例中终端设备或服务器执行的操作。如图16所示,本实施例提供的设备,可以包括处理器1601、存储器1602和收发器1603,所述收发器1603用于接收数据或者发送数据,所述存储器1602用于存储指令,所述处理器1601用于执行所述存储器1602中存储的指令,用于执行本申请上述方法实施例中终端设备或服务器执行的操作,技术原理和技术效果相似,此处不再赘述。
图17为本申请实施例提供的终端设备的一种硬件结构图。如图17所示,终端设备3000包括但不限于:射频单元301、网络模块302、音频输出单元303、输入单元304、传感器305、显示单元306、用户输入单元307、接口单元308、存储器309、处理器340、电源341等部件。本领域技术人员可以理解,图17中示出的终端设备结构并不构成对终端设备的限定,终端设备3000可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本申请实施例中,终端设备包括但不限于手机、平板电脑、掌上电脑等。
其中,用户输入单元307,用于接收用户的输入;显示单元306,用于响应于用户输入单元307接收的输入,根据输入显示内容。
应理解的是,本申请实施例中,射频单元301可用于收发信息或通话过程中,信号的接收和发送。通常,射频单元301包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元301还可以通过无线通信系统与网络和其他设备通信。
终端设备3000通过网络模块302为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。
音频输出单元303可以将射频单元301或网络模块302接收的或者在存储器309中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元303还可以提供与终端设备3000执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等)。音频输出单元303包括扬声器、蜂鸣器以及受话器等。
输入单元304用于接收音频或视频信号。输入单元304可以包括图形处理器(Graphics Processing Unit,GPU)3043和麦克风3042,图形处理器3043用于对摄像头等捕捉的图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元306上。经图形处理器3043处理后的图像帧可以存储在存储器309(或其它存储介质)中或者经由射频单元301或网络模块302进行发送。麦克风3042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元301发送到移动通信基站的格式输出。
终端设备3000还包括至少一种传感器305,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板3063的亮度,接近传感器可在终端设备3000移动到耳边时,关闭显示面板3063和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别终端设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器305还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。
显示单元306用于显示由用户输入的信息或提供给用户的信息。显示单元306可包括显示面板3063,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板3063。
用户输入单元307可用于接收输入的数字或字符信息,以及产生与终端设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元307包括触控面板3073以及其他输入设备3072。触控面板3073,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板3073上或在触控面板3073附近的操作)。触控面板3073可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器340,接收处理器340发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板3073。除了触控面板3073,用户输入单元307还可以包括其他输入设备3072。具体地,其他输入设备3072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。
进一步的,触控面板3073可覆盖在显示面板3063上,当触控面板3073检测到在其上或附近的触摸操作后,传送给处理器340以确定触摸事件的类型,随后处理器340根据触摸事件的类型在显示面板3063上提供相应的视觉输出。虽然在图17中,触控面板3073与显示面板3063是作为两个独立的部件来实现终端设备的输入和输出功能,但是在某些实施例中,可以将触控面板3073与显示面板3063集成而实现终端设备的输入和输出功能,具体此处不做限定。
接口单元308为外部装置与终端设备3000连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元308可以用于接收来自外部装置的输入(例如,数据信息、电力等等) 并且将接收到的输入传输到终端设备3000内的一个或多个元件或者可以用于在终端设备3000和外部装置之间传输数据。
存储器309可用于存储软件程序以及各种数据。存储器309可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器309可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
处理器340是终端设备的控制中心,利用各种接口和线路连接整个终端设备的各个部分,通过运行或执行存储在存储器309内的软件程序和/或模块,以及调用存储在存储器309内的数据,执行终端设备的各种功能和处理数据,从而对终端设备进行整体监控。处理器340可包括一个或多个处理单元;可选的,处理器340可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器340中。
请参照图17,本申请实施例中,存储器309中存储计算机程序,其中,所述处理器340运行所述计算机程序,以使得所述终端设备执行上述方法实施例中终端设备执行的操作。
在本申请实施例中,处理器可以是通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
在本申请实施例中,存储器可以是非易失性存储器,比如硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)等,还可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM)。存储器是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本申请实施例中的存储器还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。
Claims (20)
- 一种模型文件的管理方法,其特征在于,包括:终端设备从服务器接收目标模型文件包的存储地址;所述终端设备根据所述目标模型文件包的存储地址,获取所述目标模型文件包;其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
- 根据权利要求1所述的方法,其特征在于,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:所述终端设备获取所述目标模型文件包的参数;所述终端设备根据目标模型文件包的参数向服务器发送第一请求,所述第一请求用于请求所述目标模型文件包。
- 根据权利要求2所述的方法,其特征在于,所述终端设备获取所述目标模型文件包的参数,包括:所述终端设备接收服务器发送的K个模型文件包的参数,所述K为正整数;所述终端设备根据本地存储的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数。
- 根据权利要求3所述的方法,其特征在于,所述目标模型文件包的参数包括所述目标模型文件包的标识,所述第一请求包括所述目标模型文件包的标识,所述目标模型文件包的标识用于所述服务器获取所述目标模型文件包的存储地址。
- 根据权利要求3或4所述的方法,其特征在于,所述模型文件包的参数包括第一类参数和第二类参数;其中,第一类参数的匹配优先级高于第二参数的匹配优先级;所述终端设备根据本地存储的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数,包括:当本地存储的模型文件包的第一类参数与所述K个模型文件包中N个模型文件包的第一类参数相匹配时,所述终端设备根据所述本地存储的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,N为小于等于K的正整数。
- 根据权利要求5所述的方法,其特征在于,所述第二类参数包括多个子参数,每个子参数的匹配优先级不同;所述终端设备根据所述本地存储的模型文件包的第二类参数以及N个模型文件包的第二类参数,确定所述目标模型文件包的参数,包括:所述终端设备根据各个子参数的匹配优先级的顺序,对所述本地存储的模型文件包的第二类参数以及N个模型文件包的第二类参数进行匹配,以确定所述目标模型文件包的参数。
- 根据权利要求1所述的方法,其特征在于,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:所述终端设备获取目标模型文件的参数;若所述终端设备根据所述目标模型文件的参数在本地存储的模型文件中未查找到所述目标模型文件,则根据所述目标模型文件的参数,获取所述目标模型文件所属的模型文 件包的参数;所述终端设备向所述服务器发送第二请求,所述第二请求包括所述目标模型文件所属的所述模型文件包的参数,所述目标模型文件所属的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
- 根据权利要求1所述的方法,其特征在于,所述终端设备从服务器接收目标模型文件包的存储地址之前,还包括:所述终端设备向所述服务器发送本地存储的模型文件包的参数;所述本地存储的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
- 根据权利要求8所述的方法,其特征在于,所述终端设备向所述服务器发送本地存储的模型文件包的参数,包括:终端设备接收服务器发送的第三请求,所述终端设备根据所述第三请求,向所述服务器发送本地存储的模型文件包的参数;或者,所述终端设备确定满足模型文件包的参数发送条件时,向所述服务器发送本地存储的模型文件包的参数。
- 一种终端设备,其特征在于,包括:收发器,用于从服务器接收目标模型文件包的存储地址;处理器,用于根据所述目标模型文件包的存储地址,获取所述目标模型文件包;其中,所述目标模型文件包是根据所述终端设备本地存储的模型文件包的参数与所述服务器管理的模型文件包的参数确定的。
- 根据权利要求10所述的终端设备,其特征在于,所述处理器还用于:获取所述目标模型文件包的参数;所述收发器,还用于根据目标模型文件包的参数向服务器发送第一请求,所述第一请求用于请求所述目标模型文件包。
- 根据权利要求11所述的终端设备,其特征在于,所述收发器具体用于:接收服务器发送的K个模型文件包的参数,所述K为正整数;所述处理器具体用于,根据本地存储的模型文件包的参数,从所述K个模型文件包的参数中确定所述目标模型文件包的参数。
- 根据权利要求12所述的终端设备,其特征在于,所述目标模型文件包的参数包括所述目标模型文件包的标识,所述第一请求包括所述目标模型文件包的标识,所述目标模型文件包的标识用于所述服务器获取所述目标模型文件包的存储地址。
- 根据权利要求12或13所述的终端设备,其特征在于,所述模型文件包的参数包括第一类参数和第二类参数;其中,第一类参数的匹配优先级高于第二参数的匹配优先级;所述处理器具体用于:当本地存储的模型文件包的第一类参数与所述K个模型文件包中N个模型文件包的第一类参数相匹配时,根据所述本地存储的模型文件包的第二类参数以及所述N个模型文件包的第二类参数,确定所述目标模型文件包的参数,N为小于等于K的正整数。
- 根据权利要求14所述的终端设备,其特征在于,所述第二类参数包括多个子参数,每个子参数的匹配优先级不同;所述处理器具体用于:根据各个子参数的匹配优先级的顺序,对所述本地存储的模型文件包的第二类参数以及N个模型文件包的第二类参数进行匹配,以确定所述目标模型文件包的参数。
- 根据权利要求10所述的终端设备,其特征在于,所述处理器还用于:获取目标模型文件的参数;若根据所述目标模型文件的参数在本地存储的模型文件中未查找到所述目标模型文件,则根据所述目标模型文件的参数,获取所述目标模型文件所属的模型文件包的参数;所述收发器,还用于向所述服务器发送第二请求,所述第二请求包括所述目标模型文件所属的所述模型文件包的参数,所述目标模型文件所属的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
- 根据权利要求10所述的终端设备,其特征在于,所述收发器还用于:向所述服务器发送本地存储的模型文件包的参数;所述本地存储的模型文件包的参数用于所述服务器确定所述目标模型文件包的存储地址。
- 根据权利要求17所述的终端设备,其特征在于,所述收发器具体用于:接收服务器发送的第三请求,所述终端设备根据所述第三请求,向所述服务器发送本地存储的模型文件包的参数;或者,确定满足模型文件包的参数发送条件时,向所述服务器发送本地存储的模型文件包的参数。
- 一种终端设备,其特征在于,包括:处理器、存储器,以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序,所述终端设备执行如权利要求1至9任一项所述的方法。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,终端设备执行如权利要求1至9任一项所述的方法。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021523205A JP7136416B2 (ja) | 2018-11-01 | 2019-11-01 | モデルファイル管理方法および端末デバイス |
CN201980039130.7A CN112262556B (zh) | 2018-11-01 | 2019-11-01 | 模型文件的管理方法和终端设备 |
US17/284,898 US11940992B2 (en) | 2018-11-01 | 2019-11-01 | Model file management method and terminal device |
EP19878760.8A EP3843356B1 (en) | 2018-11-01 | 2019-11-01 | Management method for model files, terminal device and computer-readable storage medium |
Applications Claiming Priority (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811298105.4 | 2018-11-01 | ||
CN201811298105 | 2018-11-01 | ||
CN201910336055 | 2019-04-24 | ||
CN201910336055.2 | 2019-04-24 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020088681A1 true WO2020088681A1 (zh) | 2020-05-07 |
Family
ID=70464676
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/115166 WO2020088681A1 (zh) | 2018-11-01 | 2019-11-01 | 模型文件的管理方法和终端设备 |
Country Status (5)
Country | Link |
---|---|
US (1) | US11940992B2 (zh) |
EP (1) | EP3843356B1 (zh) |
JP (1) | JP7136416B2 (zh) |
CN (1) | CN112262556B (zh) |
WO (1) | WO2020088681A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114995899A (zh) * | 2022-05-16 | 2022-09-02 | 上海商汤智能科技有限公司 | 程序运行方法和装置、电子设备、存储介质 |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114327671A (zh) * | 2021-12-03 | 2022-04-12 | 北京达佳互联信息技术有限公司 | 参数配置方法、装置、设备及存储介质 |
CN114546223A (zh) * | 2022-01-25 | 2022-05-27 | 吕贺 | 文件控制方法、装置、电子设备及计算机可读存储介质 |
CN114817200B (zh) * | 2022-05-06 | 2024-04-05 | 新疆利丰智能科技股份有限公司 | 一种基于物联网的文档数据云端管理方法、系统及储存介质 |
WO2024165724A1 (en) * | 2023-02-10 | 2024-08-15 | Interdigital Ce Patent Holdings, Sas | Methods, architectures, apparatuses and systems for artificial intelligence model delivery in a wireless network |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957753A (zh) * | 2010-09-10 | 2011-01-26 | 中国科学院软件研究所 | 一种软件生产线构造方法及系统 |
CN108074210A (zh) * | 2016-11-10 | 2018-05-25 | 成都赫尔墨斯科技股份有限公司 | 一种用于云渲染的对象获取系统和方法 |
CN108073350A (zh) * | 2016-11-10 | 2018-05-25 | 成都赫尔墨斯科技股份有限公司 | 一种用于云渲染的对象存储系统和方法 |
CN108573453A (zh) * | 2018-03-30 | 2018-09-25 | 平安科技(深圳)有限公司 | 保险产品计算模型的配置方法、装置、计算机设备及存储介质 |
Family Cites Families (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110191747A1 (en) * | 1999-10-05 | 2011-08-04 | Borland Software Corporation | Supporting and deploying distributed computing components |
US20070294357A1 (en) | 2006-06-20 | 2007-12-20 | Lennox Bertrand Antoine | Geospatial community facilitator |
US8191075B2 (en) * | 2008-03-06 | 2012-05-29 | Microsoft Corporation | State management of operating system and applications |
US9218359B2 (en) | 2010-07-02 | 2015-12-22 | Code Systems Corporation | Method and system for profiling virtual application resource utilization patterns by executing virtualized application |
TWI492086B (zh) | 2011-04-11 | 2015-07-11 | D Link Corp | Hide the file's real path for cloud processing |
US8914768B2 (en) * | 2012-03-28 | 2014-12-16 | Bmc Software, Inc. | Automated blueprint assembly for assembling an application |
WO2014005209A1 (en) * | 2012-07-06 | 2014-01-09 | Research In Motion Limited | System and methods for matching identifiable patterns and enabling associated actions |
US10097417B2 (en) * | 2013-01-24 | 2018-10-09 | Vencore Labs, Inc. | Method and system for visualizing and analyzing a field area network |
CN104657170A (zh) | 2013-11-25 | 2015-05-27 | 腾讯科技(上海)有限公司 | 一种数据更新方法、装置及系统 |
CN109977086B (zh) | 2013-11-29 | 2023-09-01 | 华为终端有限公司 | 终端间应用共享的方法和终端 |
CN103631626A (zh) | 2013-11-29 | 2014-03-12 | 乐视致新电子科技(天津)有限公司 | 一种软件更新方法及电子设备 |
CN104714819B (zh) * | 2013-12-16 | 2019-11-15 | 中兴通讯股份有限公司 | 文件系统升级包制作方法、升级方法及装置、终端 |
JP6371870B2 (ja) | 2014-06-30 | 2018-08-08 | アマゾン・テクノロジーズ・インコーポレーテッド | 機械学習サービス |
KR102386863B1 (ko) | 2015-09-09 | 2022-04-13 | 삼성전자주식회사 | 사용자 기반 언어 모델 생성 장치, 방법 및 음성 인식 장치 |
CN105119944B (zh) | 2015-09-23 | 2019-01-18 | 北京金山安全软件有限公司 | 一种应用的启动方法和相关装置 |
CN106254467A (zh) | 2016-08-05 | 2016-12-21 | 北京小米移动软件有限公司 | 文件分享方法及装置 |
CN106569844B (zh) * | 2016-09-23 | 2020-05-12 | 北京五八信息技术有限公司 | 程序代码更新的处理方法、装置和设备 |
CN107885317A (zh) | 2016-09-29 | 2018-04-06 | 阿里巴巴集团控股有限公司 | 一种基于手势的交互方法及装置 |
CN106708537A (zh) | 2017-01-22 | 2017-05-24 | 百度在线网络技术(北京)有限公司 | 应用更新方法和装置 |
-
2019
- 2019-11-01 WO PCT/CN2019/115166 patent/WO2020088681A1/zh unknown
- 2019-11-01 US US17/284,898 patent/US11940992B2/en active Active
- 2019-11-01 JP JP2021523205A patent/JP7136416B2/ja active Active
- 2019-11-01 EP EP19878760.8A patent/EP3843356B1/en active Active
- 2019-11-01 CN CN201980039130.7A patent/CN112262556B/zh active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101957753A (zh) * | 2010-09-10 | 2011-01-26 | 中国科学院软件研究所 | 一种软件生产线构造方法及系统 |
CN108074210A (zh) * | 2016-11-10 | 2018-05-25 | 成都赫尔墨斯科技股份有限公司 | 一种用于云渲染的对象获取系统和方法 |
CN108073350A (zh) * | 2016-11-10 | 2018-05-25 | 成都赫尔墨斯科技股份有限公司 | 一种用于云渲染的对象存储系统和方法 |
CN108573453A (zh) * | 2018-03-30 | 2018-09-25 | 平安科技(深圳)有限公司 | 保险产品计算模型的配置方法、装置、计算机设备及存储介质 |
Non-Patent Citations (1)
Title |
---|
See also references of EP3843356A4 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114995899A (zh) * | 2022-05-16 | 2022-09-02 | 上海商汤智能科技有限公司 | 程序运行方法和装置、电子设备、存储介质 |
Also Published As
Publication number | Publication date |
---|---|
JP2022506052A (ja) | 2022-01-17 |
US20210390092A1 (en) | 2021-12-16 |
EP3843356A1 (en) | 2021-06-30 |
CN112262556B (zh) | 2022-01-21 |
EP3843356C0 (en) | 2024-08-21 |
CN112262556A (zh) | 2021-01-22 |
EP3843356A4 (en) | 2021-08-18 |
EP3843356B1 (en) | 2024-08-21 |
US11940992B2 (en) | 2024-03-26 |
JP7136416B2 (ja) | 2022-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020088681A1 (zh) | 模型文件的管理方法和终端设备 | |
US11057376B2 (en) | Method, apparatus, and system for controlling intelligent device, and storage medium | |
EP3591940B1 (en) | Mirror image distribution method, and mirror image acquisition method and apparatus | |
WO2021129762A1 (zh) | 应用分享方法、电子设备及计算机可读存储介质 | |
US10817255B2 (en) | Scene sound effect control method, and electronic device | |
CN108717432B (zh) | 资源查询方法及装置 | |
US11481357B2 (en) | Album display method, electronic device, and storage medium | |
CN112084747B (zh) | 一种资源管理方法、装置、电子设备及存储介质 | |
CN113420051B (zh) | 一种数据查询方法、装置、电子设备和存储介质 | |
WO2020258952A1 (zh) | 权限配置方法及终端设备 | |
CN110780793B (zh) | 一种树形菜单的构建方法、装置、电子设备及存储介质 | |
CN109885257A (zh) | 一种磁盘文件读写方法及装置 | |
CN111399819B (zh) | 数据生成方法、装置、电子设备及存储介质 | |
CN114115895A (zh) | 一种代码查询方法、装置、电子设备和存储介质 | |
WO2024139279A1 (zh) | 访问控制列表规则配置方法、装置、电子设备及存储介质 | |
CN109902092B (zh) | 一种数据存储系统的操作方法、装置和移动终端 | |
CN112559532B (zh) | 一种基于红黑树的数据插入方法、装置及电子设备 | |
US11327845B2 (en) | Image synchronization method and device, and server | |
CN113900920A (zh) | 数据处理方法、装置、电子设备及计算机可读存储介质 | |
US20230394008A1 (en) | Distributed file access method and related device | |
CN115048463B (zh) | 数据迁移方法、系统及存储介质 | |
CN111930686B (zh) | 存储日志的方法、装置和计算机设备 | |
CN116820677A (zh) | 一种业务数据迁移方法、装置、电子设备及存储介质 | |
CN116069693A (zh) | 批量处理命令的方法、装置、电子设备及存储介质 | |
CN116170222A (zh) | K8s鉴权方法、相关设备及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19878760 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2019878760 Country of ref document: EP Effective date: 20210325 |
|
ENP | Entry into the national phase |
Ref document number: 2021523205 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |