CN112328325A - Execution method and device of model file, terminal equipment and storage medium - Google Patents

Execution method and device of model file, terminal equipment and storage medium Download PDF

Info

Publication number
CN112328325A
CN112328325A CN202011230209.9A CN202011230209A CN112328325A CN 112328325 A CN112328325 A CN 112328325A CN 202011230209 A CN202011230209 A CN 202011230209A CN 112328325 A CN112328325 A CN 112328325A
Authority
CN
China
Prior art keywords
execution
model
model file
identification information
executing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011230209.9A
Other languages
Chinese (zh)
Inventor
张山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202011230209.9A priority Critical patent/CN112328325A/en
Publication of CN112328325A publication Critical patent/CN112328325A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application is applicable to the technical field of big data, and provides an execution method, an execution device, terminal equipment and a storage medium of a model file, wherein the method comprises the following steps: receiving a first execution request, wherein the first execution request comprises identification information of a model file; determining the execution equipment corresponding to the identification information according to a preset model equipment mapping table, wherein the model equipment mapping table contains the mapping relation between the identification information of the model file and the execution equipment, and the execution equipment stores the model file corresponding to the identification information; and if the execution device corresponding to the identification information is a second execution device, forwarding the first execution request to the second execution device, wherein the second execution device is used for executing the model file corresponding to the identification information according to the first execution request. Therefore, the process that the model files are frequently loaded to the memory and unloaded from the memory is reduced, the execution efficiency of the model files is improved, and the training efficiency of multi-model training is further improved.

Description

Execution method and device of model file, terminal equipment and storage medium
Technical Field
The present application relates to the field of big data technologies, and in particular, to a method and an apparatus for executing a model file, a terminal device, and a computer-readable storage medium.
Background
With the rapid development of artificial intelligence, more and more machine learning models are widely applied to various application scenarios. Before the machine learning model is applied to an application scene, the terminal equipment loads a model file of the machine learning model in the hard disk into a memory of the terminal equipment, executes the model file loaded into the memory, and trains a large number of training samples to optimize model parameters of the machine learning model.
In the related art, each time a machine learning model is trained, a corresponding model file needs to be loaded into a memory of a terminal device, but a plurality of model files are usually available in one application scene, so that when the machine learning model in one application scene is trained, the terminal device needs to switch different model files, and the file size of each model file is between several megabytes and several tens of megabytes, so that a large amount of time is consumed for loading and unloading the model files in the execution process of the current model file, and the training efficiency of the model training process is very low.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for executing a model file, a terminal device, and a computer-readable storage medium, so as to solve the problem in the prior art that a model training process is inefficient in model training.
A first aspect of an embodiment of the present application provides a method for executing a model file, including:
receiving a first execution request, wherein the first execution request comprises identification information of a model file;
determining the execution equipment corresponding to the identification information according to a preset model equipment mapping table, wherein the model equipment mapping table contains the mapping relation between the identification information of the model file and the execution equipment, and the execution equipment stores the model file corresponding to the identification information;
and if the execution device corresponding to the identification information is a second execution device, forwarding the first execution request to the second execution device, wherein the second execution device is used for executing the model file corresponding to the identification information according to the first execution request.
According to the execution method of the model file, the execution device corresponding to the identification information in the first execution request is determined according to the preset model device mapping table by obtaining the first execution request, so that the plurality of model files are respectively stored in the plurality of execution devices, and the mapping relation between the model files and the execution device is maintained by adopting the model device mapping table, so that the execution device in which the model files corresponding to the identification information are stored can be determined; and if the execution device corresponding to the identification information is a second execution device, forwarding the first execution request to the second execution device, so that the execution request can be forwarded internally between the execution devices of the training platform, and the training platform can call a single execution device to store and execute a model file, thereby reducing the processes of frequently loading and unloading the model file to and from a memory, improving the execution efficiency of the model file, and further improving the training efficiency of multi-model training.
A second aspect of an embodiment of the present application provides an apparatus for executing a model file, including:
the receiving module is used for receiving a model file execution request, and the model file execution request contains identification information of a model file;
the determining module is used for determining the executing equipment corresponding to the identification information according to a preset model equipment mapping table, the model equipment mapping table contains the mapping relation between the identification information of the model file and the executing equipment, and the executing equipment stores the model file corresponding to the identification information;
and the forwarding module is used for forwarding the model file execution request to the second execution device if the execution device corresponding to the identification information is the second execution device, and the second execution device is used for executing the model file corresponding to the identification information according to the model file execution request.
A third aspect of the embodiments of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the terminal device, where the processor implements the steps of the method for executing the model file provided in the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps of the execution method of the model file provided by the first aspect.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating an implementation of a method for executing a model file according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating an implementation of a method for executing a model file according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating an implementation of a method for executing a model file according to yet another embodiment of the present application;
FIG. 4 is a block diagram of an apparatus for executing a model file according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
In the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
As described in the related art, in the current model file execution mode, after the first execution device obtains the execution request of the model file, then, the model file corresponding to the model ID (identification information) is called to the hard disk space of the first execution device for execution, so that for the first execution device, when the model to be trained has a plurality of model files, such as model a and model B, the first execution device needs to first retrieve model a from the hard disk to load the model a into the memory space, executing the model A in the memory space, unloading the model A in the memory space after the execution is finished, calling the model B from the hard disk to be loaded into the memory space for execution, and a model file is usually between several million and several tens of million, so that a great deal of time is needed for loading and unloading model data, and the execution efficiency of the model file in the model training process is greatly influenced.
In view of this, an embodiment of the present application provides a method for executing a model file, which includes obtaining a first execution request, determining, according to a preset model device mapping table, an execution device corresponding to identification information in the first execution request, so as to respectively store a plurality of model files in a plurality of execution devices, and maintaining a mapping relationship between the model files and the execution devices by using the model device mapping table, thereby determining the execution device in which the model file corresponding to the identification information is stored; and if the execution device corresponding to the identification information is a second execution device, forwarding the first execution request to the second execution device, so that the execution request can be forwarded internally between the execution devices of the training platform, and the training platform can call a single execution device to store and execute a model file, thereby reducing the processes of frequently loading and unloading the model file to and from a memory, improving the execution efficiency of the model file, and further improving the training efficiency of multi-model training.
By way of example and not limitation, this embodiment provides an application scenario of a model training method, which is specifically as follows:
in the identification process of the identity card, the head portrait and the characters in the identity card are generally required to be identified, the corresponding network model comprises a head portrait identification model and a character identification model, in addition, in order to extract the head portrait in the identity card, the network model also comprises a boundary identification model, and the character identification model is divided into a large character set identification model and a small character set identification model according to the difference of character types, such as the difference of numbers and Chinese characters, so in the identification process of the identity card, the related network model comprises a head portrait identification model, a boundary identification model, a large character set model and a large character set model, and each model is respectively corresponding to one or more model files. In the existing mode, the above 4 network models are all completed on one execution device, so that when each identity card sample is trained, each model file needs to be loaded once, and before the next model file is loaded, the model files in the memory of the execution device are unloaded, which means that the current mode consumes very much time.
In the embodiment, the number of models to be trained is determined, so that executing devices with corresponding number are selected, for example, 4 executing devices correspond to the 4 network models, a model file of each model is distributed to one executing device in a data fragmentation mode, and a model device mapping table is generated, for example, a model file of an avatar recognition model is distributed to the executing device 1, a model file of a boundary recognition model is distributed to the executing device 2, a model file of a large character set recognition model is distributed to the executing device 3, and a model file of a small character set recognition model is distributed to the executing device 4; and recording the corresponding relation between the training equipment and the model ID through a model equipment mapping table, and respectively storing the model equipment mapping table to each execution equipment. When any one of the execution devices receives a model file execution request carrying a model ID and a training sample, the execution device calls a model device mapping table to inquire the execution device corresponding to the model ID, and forwards the model file execution request to the execution device corresponding to the model ID, so that the execution device corresponding to the model ID executes the corresponding model file to train the training sample in the model file execution request. For example, when the execution device 1 receives a Model file execution request carrying a Model ID of Model3 and a training sample, the execution device 1 calls a Model device mapping table to query the execution device corresponding to the Model3 as the training device 3, the Model file execution request is forwarded to the execution device 3, the execution device 3 executes the Model file having the Model ID of Model3 to train the training sample, obtain a training result (execution result), and returns the training result to the execution device 1, and the execution device 1 returns the training result to the request sending end. Therefore, the model file loading and unloading method and device do not need the execution device to frequently load and unload the model file, loading time and unloading time are reduced, and model multi-type training efficiency is improved.
It can be understood that when each execution device is started, the model file in the hard disk of the execution device is automatically loaded to the memory, so that the model file is loaded in advance, and the model training efficiency is further improved.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a method for executing a model file according to an embodiment of the present application. An execution main body of the execution method of the model file provided by the embodiment of the application is a first execution device, and the first execution device may be a terminal device, and the terminal device includes but is not limited to a terminal such as a smart phone, a tablet computer, a desktop computer, a supercomputer, and a personal digital assistant. The execution method of the model file shown in fig. 1 includes steps S101 to S103, which are described in detail below.
S101, receiving a first execution request, wherein the first execution request comprises identification information of a model file.
In this embodiment, the first execution device receives a first execution request sent by a request sending end, where the first execution request is a task request for executing a specified model file, and may be an HTTP request sent by a client to the first execution device, a request mode of the request may be a POST mode, and request parameters include, but are not limited to, identification information of a model text and a model training sample. Illustratively, a user selects identification information of a specified model file and a model training sample for model training through a client in communication connection with a first execution device, and sends a first execution request carrying the identification information and the model training sample to the first execution device in a POST manner, and the first execution device receives the first execution request.
The model file is a model file of the machine learning model to be trained, and comprises algorithm information and model information of the machine learning model. The identification information is character information representing unique identification of the model file, which includes, but is not limited to, character information consisting of numbers, letters, punctuation marks, and chinese characters. It is understood that the setting process of the identification information may be performed on the first execution device, and may also be performed on other terminal devices. Illustratively, a unique model ID (identity document) number may be assigned to the model file by the client as the identification information, and then the model file to which the ID number is assigned is stored in the first execution device; when the model file is subjected to data fragmentation, the hash value of the model file is calculated based on certain file characteristics of the model file, the model file is stored in the first execution device, and the hash value is used as the identification information of the model file by the first execution device.
S102, determining the execution equipment corresponding to the identification information according to a preset model equipment mapping table, wherein the model equipment mapping table contains the mapping relation between the identification information of the model file and the execution equipment, and the execution equipment stores the model file corresponding to the identification information.
In this embodiment, the executing device is a terminal device for executing a model file during model training, and includes a first executing device and a plurality of second executing devices. The first execution device stores a model device mapping table in advance, the model device mapping table is a mapping relation table between identification information of a model file and the execution device, and the model file is stored in a hard disk space of the execution device. It is understood that the model device mapping table may be generated by the first executing device or other terminal devices, that is, the executing body for generating the model device mapping table may be the same as or different from the executing body for using the model device mapping table.
Illustratively, the model device mapping table is a mapping table maintained based on a redis database, and the mapping relationship is stored between the model ID and the executing device in a key-value manner. For example, the MODEL files include MODEL a, MODEL B, and MODEL C, the MODEL IDs of the MODEL files are MODEL1, MODEL2, and MODEL3, the three MODEL files store three execution devices (i.e., 1 first execution device and 2 second execution devices), the device addresses of the three execution devices are 192.168.1.1, 192.168.1.2, and 192.168.1.3, respectively, the MODEL device mapping table may be expressed in a manner of MODEL1 being 192.168.1.1, MODEL2 being 192.168.1.2, and MODEL3 being 192.168.1.3, so as to describe the correspondence between the MODEL files and the execution devices. It will be appreciated that the mapping relationships may be expressed differently based on the model device mapping tables maintained by the different databases.
The first execution device inquires the execution device corresponding to the model ID according to a preset model device mapping table, if the training device corresponding to the model ID is the first execution device, the model file corresponding to the model ID is called from the hard disk space in the first execution device according to the model ID in the first execution request, so that the model file is loaded to the memory space of the first execution device, the model file loaded to the memory space is executed, and the model is trained according to the model training sample in the first execution request. If the execution device corresponding to the model ID is the second execution device, the process proceeds to step S103. According to the embodiment of the application, the execution equipment corresponding to the model file of the model ID is inquired according to the model equipment mapping table, so that one execution equipment can execute one model file, the phenomenon that one execution equipment needs to spend a large amount of time for loading and unloading the model file due to continuous execution of a plurality of model files is avoided, and the execution efficiency of the model file in the model training process is improved.
And S103, if the execution device corresponding to the identification information is a second execution device, forwarding the first execution request to the second execution device, wherein the second execution device is used for executing the model file corresponding to the identification information according to the first execution request.
In this embodiment, the second execution device is communicatively connected to the first execution device. The second execution device stores a corresponding model file, and the second execution device does not refer to a specific execution device but refers to any one of the other execution devices except the first execution device. It should be understood that the first executing device and the second executing device may store one or more model files, and preferably, in order to avoid the occurrence of execution requests requiring the same executing device to continuously execute the model files, the executing device stores only one model file.
Optionally, the second execution device may also store a model device mapping table, that is, the second execution device may also receive the first execution request, query the execution device corresponding to the model ID according to the model device mapping table, and forward the first execution request to the first execution device or another second execution device according to the queried execution device, or does not forward the first execution request. Illustratively, when a first executing device executes a model file, a second executing device receives a first executing request newly sent by a request sending end, the second executing device queries an executing device corresponding to a model ID based on the model ID of the first executing request, if the executing device corresponding to the model ID is another second executing device, the first executing request is forwarded to the other second executing device corresponding to the model ID, if the executing device corresponding to the model ID is the second executing device, the first executing request is not forwarded, the second executing device executes the first executing request, if the executing device corresponding to the model ID is the first executing device, the first executing request is forwarded to the first executing device, and after the first executing device finishes executing the current model file, the first executing request is executed. It should be noted that the above process is only used as an example and not a limitation.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a method for executing a model file according to another embodiment of the present application. With respect to the embodiment corresponding to fig. 1, the method for executing the model file provided in this embodiment further includes steps S201 to S203 before step S102. The details are as follows:
s201, obtaining a plurality of model files.
In this embodiment, the terminal and the device obtain a plurality of model files from the distributed database. For example, model files for Faq speech recognition models and decision models of the question-answering system, model files for speech recognition models and intention recognition models of the toronto dialog system, and the like are obtained from an AP algorithm platform (Affinity prediction). It will be appreciated that a business project (such as the Faq question-answering system or the Torontal dialogue system described above) typically has multiple models, one for each model, and one or more model files.
S202, carrying out data fragmentation on the plurality of model files to obtain a fragmentation result, wherein the fragmentation result comprises the corresponding relation between the identification information of each model file and the execution equipment.
In this embodiment, the terminal device performs data fragmentation on the plurality of model files to obtain a fragmentation result. Data fragmentation refers to the process by which data in a distributed database is replicated across various physical databases of a network scenario. The data fragmentation mode can comprise a data Hash value fragmentation mode, a consistency Hash value fragmentation mode, a data Hash value range fragmentation mode and the like. In this embodiment, a plurality of model files are respectively stored in a plurality of different execution devices in a data fragmentation manner, so that each execution device only executes the stored model file, thereby avoiding the problem that a single execution device executes a plurality of model files, which results in time consuming loading and time consuming unloading, and breaking through the limitation of the physical memory size of a single execution device, and the model files after data fragmentation can better support more concurrent calls of programs, thereby improving the utilization rate of the model files.
In an embodiment, the data slicing is performed on a plurality of model files to obtain a slicing result, including: calculating hash values corresponding to the model files according to the identification information of the model files; and storing each model file in the execution equipment corresponding to the hash value of the model file according to the preset corresponding relation between the hash value and the execution equipment to obtain a fragmentation result.
In this embodiment, the hash value is the most common data structure, and is a numerical value obtained by calculating the identification information of the model file by using a hash function, and the model file is mapped to a slot (slot) in the table according to the key value of the model file, so that quick access is facilitated. Most programming languages support hash tables, such as ditt in python, map in C + +, Hashtable in Java, table in Lua, and so on. In a hash table, the simplest hash function is mod N (N is the size of the table). I.e. the key value is calculated as a hash value (here an integer) and the remainder is the position in the table by taking the remainder of N. It is understood that the key value is the above-mentioned identification information in this embodiment.
The terminal device stores a preset corresponding relationship between the hash value and the execution device in advance, where the preset corresponding relationship may include: a first correspondence between a hash value and an executing device; or, a second correspondence between one execution device and at least one hash value range, where the hash value range includes a plurality of hash values.
Optionally, the data fragmentation is implemented based on a data Hash value fragmentation mode. Specifically, the hash value is calculated according to the identification information (key) of the model file, and the hash value is mapped with the nodes (i.e., the execution devices) in the system, so that data with different hash values are distributed to different nodes. Illustratively, the model ID is selected as a key of the data fragment, the execution device is selected as a node, and then the model files corresponding to different model IDs are distributed to different execution devices according to the difference of the model IDs.
Optionally, the data fragmentation is implemented based on a consistent Hash value fragmentation mode. Specifically, the model file is mapped to a Hash ring which is connected end to end according to the characteristic value, and simultaneously, the node (according to the IP address or the machine name Hash) is mapped to the ring. For the Hash value of the model file, starting from the position of the model file on the ring, the first node found clockwise serves as the storage node of the model file. Illustratively, assuming that the range of model IDs is [0, 1000], the positions of the execution devices PC1, PC2, and PC3 on the ring are 100, 400, 800, respectively, with the model IDs as Hash values, for model files with model IDs of 99, 302, and 606, the model file with model ID of 99 is stored in the PC1, the model file with model ID of 302 is distributed in the PC2, and the model data with model ID of 606 is distributed in the PC 3.
Optionally, the data fragmentation is implemented based on a data Hash value range fragmentation mode. Specifically, the key values are divided into different intervals, and each physical node is responsible for one or more intervals. For example, the model IDs are used as Hash values, the model ID sections that can be distributed by the execution devices PC1, PC2, and PC3 are respectively set as PC1(0,200), PC2(200, 500), and PC3(500, 1000), and then the model file corresponding to the model ID is stored on the execution device in the corresponding section according to the specific values of the model ID, for example, the model file with the model ID of 102 is stored on the execution device in the section (0,200).
It can be understood that, in this embodiment, the number of servers may be selected according to the number of the business models, so that each server loads one model data into the memory. Specifically, the number of model files is determined, for example, the number of model files is 3, server information to be stored in the model files is configured, each server maintains mapping information of other model servers, and finally, when a system is initialized, the information is maintained in a memory mapping table of redis.
S203, generating a model device mapping table according to the corresponding relation between each model file and the execution device.
In this embodiment, a model file is stored in an execution device, a model ID of the model file and a device address of the execution device are obtained, and a model device mapping table is generated according to the model ID and the device address.
In a possible implementation manner, on the basis of the embodiment shown in fig. 1 or fig. 2, after determining, according to a preset model device mapping table, an execution device corresponding to the identification information, the method further includes: and if the execution equipment corresponding to the identification information is the first execution equipment, the first execution equipment executes the model file corresponding to the identification information according to the first execution request.
In this embodiment, if the execution device corresponding to the identification information is the first execution device, it indicates that the model file of the model to be trained is stored on the first execution device, so that the first execution device calls the model file in the hard disk space to load into the memory space of the first execution device, and executes the model file loaded into the memory space.
In a possible implementation manner, on the basis of the embodiment shown in fig. 1 or fig. 2, if the execution device corresponding to the identification information is the second execution device, after forwarding the first execution request to the second execution device, the method further includes: and obtaining an execution result obtained by the second execution equipment executing the model file, and feeding back the execution result to the request initiating end.
In this embodiment, the second execution device loads the model file corresponding to the model ID in the hard disk space of the second execution device into the memory space thereof according to the first execution request forwarded by the first execution device, executes the model file, trains the model to be trained according to the model training sample in the first request, obtains a training result (execution result), and returns the training result to the first execution device, and the first execution device feeds back the training result to the request sending terminal that sent the first execution request.
Illustratively, a user accesses the execution device PC1 through a client, and sends a first execution request to the execution device PC1, where the first execution request carries model training samples and identification information with a model ID of model3, the execution device PC1 obtains the first execution request, and queries an execution machine corresponding to the model3 from a mapper mapping table (model device mapping table), for example, if the query result is that the model3 is PC3, the execution device PC1 forwards the first execution request to the execution device PC3, the execution device PC3 trains the model3 according to the model training samples of the first execution request, returns the training result to the execution device PC1 after the training is completed, and the execution device PC1 returns the training result to the client.
According to the implementation, the models are respectively stored in the multiple execution devices, the corresponding relation between the models and the devices is maintained by adopting the model storage mapping table, so that the training platform can adopt a single machine to store and train the models, the frequent loading and unloading processes of the model files to and from the memory are reduced, the requests can be forwarded between the application interiors, and compared with the mode that the requests are returned to the client side and re-requested by the client side, the complexity of the operation of the client side request model is reduced.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a method for executing a model file according to yet another embodiment of the present application. With respect to the embodiment corresponding to fig. 1, the method for executing the model file provided in this embodiment further includes steps S301 to S302 before. The details are as follows:
s301, receiving a second execution request forwarded by a second execution device, where the second execution request includes identification information of a model file stored by the first execution device.
In this embodiment, the second execution request is received by the second execution device from the request sending end, which is similar to the first execution request, and specifically refer to the explanation of the first execution request in the embodiment of fig. 1, which is not described herein again.
S302, according to the identification information of the model file stored by the first execution device, executing the model file corresponding to the identification information.
In this embodiment, a process of executing the model file by the first execution device is similar to that of executing the model file by the second execution device, and specifically, the first execution request may be explained with reference to fig. 1, which is not described herein again.
In all embodiments of the present application, a corresponding model device mapping table is obtained based on a correspondence between a model file and an execution device, and specifically, the model device mapping table is obtained by generating a fragmentation result obtained by performing data fragmentation on the model file by a terminal device, for example, by using hash value fragmentation. Uploading the model device mapping table to the blockchain can ensure the security and the fair transparency to the user. The user equipment may download the model device mapping table from the blockchain to verify whether the model device mapping table is tampered. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Referring to fig. 4, fig. 4 is a block diagram illustrating a structure of a model file apparatus according to an embodiment of the present disclosure. The device in this embodiment includes modules for performing the steps in the embodiments corresponding to fig. 1 to 3. Please refer to fig. 1 to 3 and fig. 1 to 3 for the corresponding embodiments. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 4, the model file executing apparatus includes:
a receiving module 401, configured to receive a model file execution request, where the model file execution request includes identification information of a model file;
a determining module 402, configured to determine, according to a preset model device mapping table, an executing device corresponding to the identification information, where the model device mapping table includes a mapping relationship between the identification information of the model file and the executing device, and the executing device stores the model file corresponding to the identification information;
a forwarding module 403, configured to forward the model file execution request to a second execution device if the execution device corresponding to the identifier information is the second execution device, where the second execution device is configured to execute the model file corresponding to the identifier information according to the model file execution request.
According to the execution device of the model file provided by the embodiment of the application, a receiving module 401 receives a first execution request, and a determining module 402 determines, according to a preset model device mapping table, execution devices corresponding to identification information in the first execution request, so that a plurality of model files are respectively stored in the plurality of execution devices, and a mapping relation between the model files and the execution devices is maintained by using the model device mapping table, so that the execution devices in which the model files corresponding to the identification information are stored can be determined; and if the execution device corresponding to the identification information is a second execution device, forwarding the first execution request to the second execution device through the forwarding module 403, so that the execution request can be forwarded internally between the execution devices of the training platform, and the training platform can call a single execution device to store and execute a model file, thereby reducing processes of frequently loading and unloading the model file to and from a memory, improving the execution efficiency of the model file, and further improving the training efficiency of multi-model training.
As an embodiment of the present application, the apparatus for executing the model file further includes:
the acquisition module is used for acquiring a plurality of model files;
the fragmentation module is used for carrying out data fragmentation on the plurality of model files to obtain a fragmentation result, and the fragmentation result comprises the corresponding relation between the identification information of each model file and the execution equipment;
and the generating module is used for generating a model equipment mapping table according to the corresponding relation between each model file and the execution equipment.
As an embodiment of the present application, the slicing module is further configured to:
calculating hash values corresponding to the model files according to the identification information of the model files;
and storing each model file in the execution equipment corresponding to the hash value of the model file according to the preset corresponding relation between the hash value and the execution equipment to obtain a fragmentation result.
As an embodiment of the present application, the preset correspondence between the hash value and the execution device includes: a first correspondence between a hash value and an executing device; or, a second correspondence between one execution device and at least one hash value range, where the hash value range includes a plurality of hash values.
As an embodiment of the present application, the apparatus for executing the model file further includes:
and the execution module is used for executing the model file corresponding to the identification information by the first execution device according to the first execution request if the execution device corresponding to the identification information is the first execution device.
As an embodiment of the present application, the apparatus for executing the model file further includes:
and the feedback module is used for acquiring an execution result obtained by the second execution equipment executing the model file and feeding the execution result back to the request initiating end.
As an embodiment of the present application, the apparatus for executing the model file further includes:
the second receiving module is used for receiving a second execution request forwarded by second execution equipment, wherein the second execution request contains identification information of the model file stored by the first execution equipment;
and the second execution module is used for executing the model file corresponding to the identification information according to the identification information of the model file stored by the first execution device.
It should be understood that, in the structural block diagram of the execution apparatus of the model file shown in fig. 4, each module is used to execute each step in the embodiment corresponding to fig. 1 to 3, and each step in the embodiment corresponding to fig. 1 to 3 has been explained in detail in the above embodiment, and specific reference is made to the relevant description in the embodiment corresponding to fig. 1 to 3 and fig. 1 to 3, which is not repeated herein.
Fig. 5 is a block diagram of a terminal device according to another embodiment of the present application. The terminal device may be the first execution device described above. As shown in fig. 5, the terminal device 50 of this embodiment includes: a processor 51, a memory 52 and a computer program 53, such as a program of an execution method of a model file, stored in the memory 52 and executable on the processor 51. The processor 51 implements the steps in the embodiments of the execution method of each model file described above, such as S101 to S103 shown in fig. 1, or S201 to S203 and S301 to S302 shown in fig. 2 and 3, when executing the computer program 53. Alternatively, when the processor 51 executes the computer program 53, the functions of the modules in the embodiment corresponding to fig. 4, for example, the functions of the modules 401 to 403 shown in fig. 4, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 4, which is not repeated herein.
Illustratively, the computer program 53 may be divided into one or more modules, which are stored in the memory 52 and executed by the processor 51 to perform the steps of the execution method of the model document of the present application. One or more of the modules may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 53 in the terminal device 50. For example, the computer program 53 may be divided into a receiving module, a determining module, and a forwarding module, each of which functions specifically as described above.
Those skilled in the art will appreciate that fig. 5 is merely an example of a terminal device 50 and does not constitute a limitation of terminal device 50 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 51 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 52 may be an internal storage unit of the terminal device 50, such as a hard disk or a memory of the terminal device 50. The memory 52 may also be an external storage device of the terminal device 50, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) and the like provided on the terminal device 50. Further, the memory 52 may also include both an internal storage unit of the terminal device 50 and an external storage device. The memory 52 is used for storing computer programs and other programs and data required by the first execution device. The memory 52 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. An execution method of a model file is applied to a first execution device and comprises the following steps:
receiving a first execution request, wherein the first execution request contains identification information of a model file;
determining the execution equipment corresponding to the identification information according to a preset model equipment mapping table, wherein the model equipment mapping table contains the mapping relation between the identification information of the model file and the execution equipment, and the execution equipment stores the model file corresponding to the identification information;
and if the execution device corresponding to the identification information is a second execution device, forwarding the first execution request to the second execution device, wherein the second execution device is used for executing the model file corresponding to the identification information according to the first execution request.
2. The method for executing the model file according to claim 1, wherein before determining the executing device corresponding to the identification information according to a preset model device mapping table, the method comprises:
obtaining a plurality of model files;
performing data fragmentation on the plurality of model files to obtain a fragmentation result, wherein the fragmentation result comprises a corresponding relation between identification information of each model file and the execution equipment;
and generating the model equipment mapping table according to the corresponding relation between each model file and the execution equipment.
3. The method for executing the model file according to claim 2, wherein the performing data fragmentation on the plurality of model files to obtain a fragmentation result comprises:
calculating the hash value corresponding to each model file according to the identification information of each model file;
and storing each model file in the execution equipment corresponding to the hash value of the model file according to the preset corresponding relation between the hash value and the execution equipment to obtain the fragmentation result.
4. The method for executing the model file according to claim 3, wherein the preset correspondence between the hash value and the execution device includes: a first correspondence between one of said hash values and one of said execution devices;
or, a second corresponding relationship between one of the execution devices and at least one hash value range, where the hash value range includes a plurality of hash values.
5. The method for executing the model file according to any one of claims 1 to 4, wherein after determining the executing device corresponding to the identification information according to a preset model device mapping table, the method further comprises:
and if the execution equipment corresponding to the identification information is first execution equipment, the first execution equipment executes the model file corresponding to the identification information according to the first execution request.
6. The method for executing the model file according to any one of claims 1 to 4, wherein if the executing device corresponding to the identification information is a second executing device, after forwarding the first executing request to the second executing device, the method further includes:
and obtaining an execution result obtained by the second execution device executing the model file, and feeding back the execution result to a request initiating terminal.
7. The method for executing a model file according to any one of claims 1 to 4, further comprising:
receiving a second execution request forwarded by the second execution device, wherein the second execution request contains identification information of the model file stored by the first execution device;
and executing the model file corresponding to the identification information according to the identification information of the model file stored by the first execution equipment.
8. An apparatus for executing a model file, comprising:
the receiving module is used for receiving a model file execution request, and the model file execution request contains identification information of a model file;
the determining module is configured to determine, according to a preset model device mapping table, an executing device corresponding to the identification information, where the model device mapping table includes a mapping relationship between the identification information of the model file and the executing device, and the executing device stores the model file corresponding to the identification information;
and the forwarding module is configured to forward the model file execution request to a second execution device if the execution device corresponding to the identification information is the second execution device, where the second execution device is configured to execute the model file corresponding to the identification information according to the model file execution request.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202011230209.9A 2020-11-06 2020-11-06 Execution method and device of model file, terminal equipment and storage medium Pending CN112328325A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011230209.9A CN112328325A (en) 2020-11-06 2020-11-06 Execution method and device of model file, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011230209.9A CN112328325A (en) 2020-11-06 2020-11-06 Execution method and device of model file, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112328325A true CN112328325A (en) 2021-02-05

Family

ID=74315670

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011230209.9A Pending CN112328325A (en) 2020-11-06 2020-11-06 Execution method and device of model file, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112328325A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112883654A (en) * 2021-03-24 2021-06-01 国家超级计算天津中心 Model training system based on data driving
CN113703826A (en) * 2021-07-29 2021-11-26 北京三快在线科技有限公司 Method, apparatus, device and storage medium for responding to data processing request

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854525A (en) * 2009-04-03 2010-10-06 国家广播电影电视总局广播科学研究院 Partitioned-push file distribution and fast filtering method
US20140241347A1 (en) * 2013-02-25 2014-08-28 Google Inc. Static translation of network forwarding plane models into target implementation in the hardware abstraction layer
CN104579873A (en) * 2015-01-27 2015-04-29 三星电子(中国)研发中心 Method and system for controlling intelligent home equipment
CN105025102A (en) * 2015-07-17 2015-11-04 中国海洋大学 Network storage and calling method and storage system of 3D printing model file
CN105095010A (en) * 2015-08-20 2015-11-25 浪潮(北京)电子信息产业有限公司 Public information model function verification method and system aiming at storage equipment
CN110309112A (en) * 2019-06-18 2019-10-08 深圳壹账通智能科技有限公司 A kind of data processing method, equipment, server and readable storage medium storing program for executing
CN110351342A (en) * 2019-06-20 2019-10-18 平安科技(深圳)有限公司 Service order processing method, device, computer equipment and storage medium
CN110516130A (en) * 2019-08-28 2019-11-29 北京明略软件***有限公司 Metadata processing method and device, storage medium, electronic device
CN111241559A (en) * 2020-01-07 2020-06-05 深圳壹账通智能科技有限公司 Training model protection method, device, system, equipment and computer storage medium
CN111481928A (en) * 2020-04-13 2020-08-04 网易(杭州)网络有限公司 Animation loading method and device, server and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854525A (en) * 2009-04-03 2010-10-06 国家广播电影电视总局广播科学研究院 Partitioned-push file distribution and fast filtering method
US20140241347A1 (en) * 2013-02-25 2014-08-28 Google Inc. Static translation of network forwarding plane models into target implementation in the hardware abstraction layer
CN104579873A (en) * 2015-01-27 2015-04-29 三星电子(中国)研发中心 Method and system for controlling intelligent home equipment
CN105025102A (en) * 2015-07-17 2015-11-04 中国海洋大学 Network storage and calling method and storage system of 3D printing model file
CN105095010A (en) * 2015-08-20 2015-11-25 浪潮(北京)电子信息产业有限公司 Public information model function verification method and system aiming at storage equipment
CN110309112A (en) * 2019-06-18 2019-10-08 深圳壹账通智能科技有限公司 A kind of data processing method, equipment, server and readable storage medium storing program for executing
CN110351342A (en) * 2019-06-20 2019-10-18 平安科技(深圳)有限公司 Service order processing method, device, computer equipment and storage medium
CN110516130A (en) * 2019-08-28 2019-11-29 北京明略软件***有限公司 Metadata processing method and device, storage medium, electronic device
CN111241559A (en) * 2020-01-07 2020-06-05 深圳壹账通智能科技有限公司 Training model protection method, device, system, equipment and computer storage medium
CN111481928A (en) * 2020-04-13 2020-08-04 网易(杭州)网络有限公司 Animation loading method and device, server and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王平泉;罗红;孙岩;: "面向物联网的多元标识映射模型", 中国科学:信息科学, no. 10, 15 October 2013 (2013-10-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112883654A (en) * 2021-03-24 2021-06-01 国家超级计算天津中心 Model training system based on data driving
CN113703826A (en) * 2021-07-29 2021-11-26 北京三快在线科技有限公司 Method, apparatus, device and storage medium for responding to data processing request

Similar Documents

Publication Publication Date Title
CN106933854B (en) Short link processing method and device and server
CN108228799B (en) Object index information storage method and device
CN112328325A (en) Execution method and device of model file, terminal equipment and storage medium
CN111414379A (en) Serial number generation method, device, equipment and computer readable storage medium
CN108965450B (en) Service request response method, device, computer equipment and storage medium
CN110737681A (en) Locking processing method and device for processing request, computer equipment and storage medium
CN112100152A (en) Service data processing method, system, server and readable storage medium
CN111522574B (en) Differential packet generation method and related equipment
CN113051102A (en) File backup method, device, system, storage medium and computer equipment
CN110619204A (en) Invitation code generation method and device, terminal equipment and storage medium
CN108776665B (en) Data processing method and device
CN108389124B (en) Data processing method, data processing device, computer equipment and storage medium
CN113656098A (en) Configuration acquisition method and system
CN111126604B (en) Model training method, device, server and storage medium
CN110765125B (en) Method and device for storing data
CN112764897B (en) Task request processing method, device and system and computer readable storage medium
CN110806979A (en) Interface return value checking method, device, equipment and storage medium
CN112783866B (en) Data reading method, device, computer equipment and storage medium
CN111339170A (en) Data processing method and device, computer equipment and storage medium
CN114637969A (en) Target object authentication method and device
CN111045787B (en) Rapid continuous experiment method and system
CN113032820A (en) File storage method, access method, device, equipment and storage medium
US10635726B2 (en) Data processing circuit and data processing method
CN110474954A (en) Sharing files method, apparatus, computer equipment and readable storage medium storing program for executing based on block chain
CN114884974B (en) Data multiplexing method, system and computing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination